Class RoleController
java.lang.Object
com.dada.banking_project.controllers.impl.RoleController
- All Implemented Interfaces:
RoleControllerInterface
@RestController
@RequestMapping("/api")
public class RoleController
extends Object
implements RoleControllerInterface
RESTful API for Role management
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addRoleToUser
(RoleToUserDTO roleToUserDTO) Add a role to a uservoid
Save a new role
-
Constructor Details
-
RoleController
public RoleController()
-
-
Method Details
-
saveRole
Save a new role- Specified by:
saveRole
in interfaceRoleControllerInterface
- Parameters:
role
- role to be saved
-
addRoleToUser
@PostMapping("/roles/addtouser") @ResponseStatus(NO_CONTENT) public void addRoleToUser(@RequestBody RoleToUserDTO roleToUserDTO) Add a role to a user- Specified by:
addRoleToUser
in interfaceRoleControllerInterface
- Parameters:
roleToUserDTO
- DTO containing the username and role name
-