MLC-298/Implement backend role management
3 fils de conversation non résolus
3 fils de conversation non résolus
- Add CRUD operations for Role entity
- Implement validation for role name uniqueness and permissions
- Add pagination and filtering for role listing
- Setup DTOs and mappers for Role and permissions
- Handle status counts
Rapports de requête de fusion
Activité
Filtrer l'activité
29 @PostMapping(UPDATE_ROLE) 30 public ResponseEntity<RoleDTO> updateRole(@RequestParam Long id, @RequestBody RoleDTO dto) 31 throws FunctionalException { 32 RoleDTO updated = roleService.update(id, dto); 33 return ResponseEntity.status(HttpStatus.OK).body(updated); 34 } 35 36 @PostMapping(DELETE_ROLE) 37 public ResponseEntity<String> deleteRole(@RequestParam Long id) throws FunctionalException { 38 roleService.deleteRole(id); 39 return ResponseEntity.status(HttpStatus.OK).body("Role deleted successfully."); 40 } 41 42 @GetMapping(ROLE_BY_ID) 43 public ResponseEntity<RoleDTO> getRoleById(@PathVariable Long id) throws FunctionalException { 44 RoleDTO role = roleService.getRoleById(id); changed this line in version 2 of the diff
35 36 @PostMapping(DELETE_ROLE) 37 public ResponseEntity<String> deleteRole(@RequestParam Long id) throws FunctionalException { 38 roleService.deleteRole(id); 39 return ResponseEntity.status(HttpStatus.OK).body("Role deleted successfully."); 40 } 41 42 @GetMapping(ROLE_BY_ID) 43 public ResponseEntity<RoleDTO> getRoleById(@PathVariable Long id) throws FunctionalException { 44 RoleDTO role = roleService.getRoleById(id); 45 return ResponseEntity.ok(role); 46 } 47 48 @GetMapping(ALL_ROLES) 49 public ResponseEntity<Page<RoleDTO>> getAllRoles(@ModelAttribute RoleSearchRequest request) { 50 Page<RoleDTO> result = roleService.getAllRoles(request); changed this line in version 2 of the diff
41 42 @GetMapping(ROLE_BY_ID) 43 public ResponseEntity<RoleDTO> getRoleById(@PathVariable Long id) throws FunctionalException { 44 RoleDTO role = roleService.getRoleById(id); 45 return ResponseEntity.ok(role); 46 } 47 48 @GetMapping(ALL_ROLES) 49 public ResponseEntity<Page<RoleDTO>> getAllRoles(@ModelAttribute RoleSearchRequest request) { 50 Page<RoleDTO> result = roleService.getAllRoles(request); 51 return ResponseEntity.ok(result); 52 } 53 54 @GetMapping(ROLES_STATUS_COUNTS) 55 public ResponseEntity<RoleStatusCountDTO> getRoleStatusCounts() { 56 RoleStatusCountDTO counts = roleService.getRoleStatusCount(); changed this line in version 2 of the diff
added 1 commit
- 8bf28080 - Refactor RoleController to remove unnecessary local variables
mentioned in commit c6b0ea53
Veuillez vous inscrire ou vous connecter pour répondre