Skip to content
Snippets Groups Projects
Commit dde371f3 authored by Daniel Gerhardt's avatar Daniel Gerhardt
Browse files

Add UserController for API v3

parent 15ed6f79
Branches
1 merge request!89Foundation for development of version 3.0
package de.thm.arsnova.controller;
import de.thm.arsnova.entities.LoginCredentials;
import de.thm.arsnova.entities.UserProfile;
import de.thm.arsnova.services.UserService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/user")
public class UserController extends AbstractEntityController<UserProfile> {
private UserService userService;
public UserController(final UserService userService) {
super(userService);
this.userService = userService;
}
@PostMapping("/register")
public void register(@RequestBody LoginCredentials loginCredentials) {
userService.create(loginCredentials.getLoginId(), loginCredentials.getPassword());
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment