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 Details

    • RoleController

      public RoleController()
  • Method Details

    • saveRole

      @PostMapping("/roles") @ResponseStatus(CREATED) public void saveRole(@RequestBody Role role)
      Save a new role
      Specified by:
      saveRole in interface RoleControllerInterface
      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 interface RoleControllerInterface
      Parameters:
      roleToUserDTO - DTO containing the username and role name