Package com.espacogeek.geek.controllers
Class UserStatusController
java.lang.Object
com.espacogeek.geek.controllers.UserStatusController
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateUserCustomStatus(String name, org.springframework.security.core.Authentication authentication) Creates a new custom tracking status label for the authenticated user.deleteUserCustomStatus(Integer id, org.springframework.security.core.Authentication authentication) Deletes a custom tracking status owned by the authenticated user.getUserCustomStatuses(org.springframework.security.core.Authentication authentication) Returns all custom tracking statuses created by the authenticated user.updateUserCustomStatus(Integer id, String name, org.springframework.security.core.Authentication authentication) Updates the name of an existing custom tracking status owned by the authenticated user.
-
Constructor Details
-
UserStatusController
public UserStatusController()
-
-
Method Details
-
getUserCustomStatuses
@QueryMapping(name="getUserCustomStatuses") @PreAuthorize("hasRole(\'user\')") public List<UserCustomStatusModel> getUserCustomStatuses(org.springframework.security.core.Authentication authentication) Returns all custom tracking statuses created by the authenticated user.- Parameters:
authentication- the currently authenticated user- Returns:
- list of the user's custom status labels
-
createUserCustomStatus
@MutationMapping(name="createUserCustomStatus") @PreAuthorize("hasRole(\'user\')") public UserCustomStatusModel createUserCustomStatus(@Argument(name="name") String name, org.springframework.security.core.Authentication authentication) Creates a new custom tracking status label for the authenticated user.- Parameters:
name- the label for the custom status (e.g. "Re-watching")authentication- the currently authenticated user- Returns:
- the newly created custom status
-
updateUserCustomStatus
@MutationMapping(name="updateUserCustomStatus") @PreAuthorize("hasRole(\'user\')") public UserCustomStatusModel updateUserCustomStatus(@Argument(name="id") Integer id, @Argument(name="name") String name, org.springframework.security.core.Authentication authentication) Updates the name of an existing custom tracking status owned by the authenticated user.- Parameters:
id- the ID of the custom status to updatename- the new labelauthentication- the currently authenticated user- Returns:
- the updated custom status
-
deleteUserCustomStatus
@MutationMapping(name="deleteUserCustomStatus") @PreAuthorize("hasRole(\'user\')") public Boolean deleteUserCustomStatus(@Argument(name="id") Integer id, org.springframework.security.core.Authentication authentication) Deletes a custom tracking status owned by the authenticated user.- Parameters:
id- the ID of the custom status to deleteauthentication- the currently authenticated user- Returns:
trueif deleted,falseif not found
-