style: 返回值警告消除
返回值警告消除 由 Result 为 Result<?> 由 Option 为 Option<Type>
This commit is contained in:
@@ -49,8 +49,8 @@ public class SysRoleController {
|
||||
|
||||
@Operation(summary = "角色下拉列表")
|
||||
@GetMapping("/options")
|
||||
public Result<List<Option>> listRoleOptions() {
|
||||
List<Option> list = roleService.listRoleOptions();
|
||||
public Result<List<Option<Long>>> listRoleOptions() {
|
||||
List<Option<Long>> list = roleService.listRoleOptions();
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ public class SysRoleController {
|
||||
@PostMapping
|
||||
@PreAuthorize("@ss.hasPerm('sys:role:add')")
|
||||
@PreventRepeatSubmit
|
||||
public Result addRole(@Valid @RequestBody RoleForm roleForm) {
|
||||
public Result<?> addRole(@Valid @RequestBody RoleForm roleForm) {
|
||||
boolean result = roleService.saveRole(roleForm);
|
||||
return Result.judge(result);
|
||||
}
|
||||
@@ -75,7 +75,7 @@ public class SysRoleController {
|
||||
@Operation(summary = "修改角色")
|
||||
@PutMapping(value = "/{id}")
|
||||
@PreAuthorize("@ss.hasPerm('sys:role:edit')")
|
||||
public Result updateRole(@Valid @RequestBody RoleForm roleForm) {
|
||||
public Result<?> updateRole(@Valid @RequestBody RoleForm roleForm) {
|
||||
boolean result = roleService.saveRole(roleForm);
|
||||
return Result.judge(result);
|
||||
}
|
||||
@@ -83,7 +83,7 @@ public class SysRoleController {
|
||||
@Operation(summary = "删除角色")
|
||||
@DeleteMapping("/{ids}")
|
||||
@PreAuthorize("@ss.hasPerm('sys:role:delete')")
|
||||
public Result deleteRoles(
|
||||
public Result<?> deleteRoles(
|
||||
@Parameter(description = "删除角色,多个以英文逗号(,)拼接") @PathVariable String ids
|
||||
) {
|
||||
boolean result = roleService.deleteRoles(ids);
|
||||
@@ -92,7 +92,7 @@ public class SysRoleController {
|
||||
|
||||
@Operation(summary = "修改角色状态")
|
||||
@PutMapping(value = "/{roleId}/status")
|
||||
public Result updateRoleStatus(
|
||||
public Result<?> updateRoleStatus(
|
||||
@Parameter(description = "角色ID") @PathVariable Long roleId,
|
||||
@Parameter(description = "状态(1:启用;0:禁用)") @RequestParam Integer status
|
||||
) {
|
||||
@@ -111,7 +111,7 @@ public class SysRoleController {
|
||||
|
||||
@Operation(summary = "分配菜单(包括按钮权限)给角色")
|
||||
@PutMapping("/{roleId}/menus")
|
||||
public Result assignMenusToRole(
|
||||
public Result<?> assignMenusToRole(
|
||||
@PathVariable Long roleId,
|
||||
@RequestBody List<Long> menuIds
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user