Package sk.gursky.films.rest
Class UsersController
java.lang.Object
sk.gursky.films.rest.UsersController
@CrossOrigin
@RestController
public class UsersController
extends java.lang.Object
-
Constructor Summary
Constructors Constructor Description UsersController()
-
Method Summary
Modifier and Type Method Description void
checkToken(java.lang.String token)
java.util.List<Group>
getAllGroups()
Group
getGroupById(java.lang.Long id)
MyUser
getMyUserById(java.lang.Long id, java.lang.String token)
java.util.Set<java.lang.String>
getPermissions(java.lang.String token)
Returns set of permissions of the logged user identified by token.java.util.List<SimpleUser>
getSimpleUsers()
void
getToken(java.lang.String token)
java.lang.String
getToken(NameAndPassword nameAndPassword)
User
getUserById(java.lang.Long id, java.lang.String token)
java.util.List<User>
getUsers(java.lang.String token)
User
register(User user)
void
removeGroupById(java.lang.Long id, java.lang.String token)
void
removeUserById(java.lang.Long id, java.lang.String token)
Group
saveGroup(Group group, java.lang.String token)
User
saveUser(java.lang.String token, User user)
java.util.List<java.lang.String>
testConflict(User user)
Returns list of conflict fields.
-
Constructor Details
-
UsersController
public UsersController()
-
-
Method Details
-
getSimpleUsers
-
getToken
@RequestMapping(value="/login", method=POST) public java.lang.String getToken(@RequestBody NameAndPassword nameAndPassword) -
getToken
@RequestMapping("/logout/{token}") public void getToken(@PathVariable java.lang.String token) -
checkToken
@RequestMapping("/check-token/{token}") public void checkToken(@PathVariable java.lang.String token) -
getPermissions
@RequestMapping("/permissions/{token}") public java.util.Set<java.lang.String> getPermissions(@PathVariable java.lang.String token)Returns set of permissions of the logged user identified by token.- Parameters:
token
-- Returns:
- permissions
-
testConflict
@RequestMapping(value="/user-conflicts", method=POST) public java.util.List<java.lang.String> testConflict(@RequestBody User user)Returns list of conflict fields. Possible values are 'name' and 'email'.- Parameters:
user
-- Returns:
-
getUsers
@RequestMapping("/users/{token}") public java.util.List<User> getUsers(@PathVariable java.lang.String token) -
getMyUserById
@RequestMapping("/bg-user/{id}/{token}") public MyUser getMyUserById(@PathVariable java.lang.Long id, @PathVariable java.lang.String token) -
getUserById
@RequestMapping("/user/{id}/{token}") public User getUserById(@PathVariable java.lang.Long id, @PathVariable java.lang.String token) -
saveUser
-
register
-
removeUserById
@RequestMapping(value="/user/{id}/{token}", method=DELETE) public void removeUserById(@PathVariable java.lang.Long id, @PathVariable java.lang.String token) -
getAllGroups
-
getGroupById
-
saveGroup
-
removeGroupById
@RequestMapping(value="/group/{id}/{token}", method=DELETE) public void removeGroupById(@PathVariable java.lang.Long id, @PathVariable java.lang.String token)
-