style: 返回值警告消除
返回值警告消除 由 Result 为 Result<?> 由 Option 为 Option<Type>
This commit is contained in:
@@ -42,7 +42,7 @@ public class AuthController {
|
||||
@Operation(summary = "注销")
|
||||
@DeleteMapping("/logout")
|
||||
@LogAnnotation(value = "注销", module = LogModuleEnum.LOGIN)
|
||||
public Result logout() {
|
||||
public Result<?> logout() {
|
||||
authService.logout();
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public class FileController {
|
||||
@DeleteMapping
|
||||
@Operation(summary = "文件删除")
|
||||
@SneakyThrows
|
||||
public Result deleteFile(
|
||||
public Result<?> deleteFile(
|
||||
@Parameter(description = "文件路径") @RequestParam String filePath
|
||||
) {
|
||||
boolean result = ossService.deleteFile(filePath);
|
||||
|
||||
@@ -57,14 +57,14 @@ public class GeneratorController {
|
||||
@Operation(summary = "保存代码生成配置")
|
||||
@PostMapping("/{tableName}/config")
|
||||
@LogAnnotation(value = "生成代码", module = LogModuleEnum.OTHER)
|
||||
public Result saveGenConfig(@RequestBody GenConfigForm formData) {
|
||||
public Result<?> saveGenConfig(@RequestBody GenConfigForm formData) {
|
||||
generatorService.saveGenConfig(formData);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@Operation(summary = "删除代码生成配置")
|
||||
@DeleteMapping("/{tableName}/config")
|
||||
public Result deleteGenConfig(
|
||||
public Result<?> deleteGenConfig(
|
||||
@Parameter(description = "表名", example = "sys_user") @PathVariable String tableName
|
||||
) {
|
||||
generatorService.deleteGenConfig(tableName);
|
||||
@@ -87,7 +87,7 @@ public class GeneratorController {
|
||||
byte[] data = generatorService.downloadCode(tableNames);
|
||||
response.reset();
|
||||
response.setHeader("Content-Disposition", "attachment; filename=\"youlai-admin-code.zip\"");
|
||||
response.addHeader("Content-Length", "" + data.length);
|
||||
response.addHeader("Content-Length", String.valueOf(data.length));
|
||||
response.addHeader("Access-Control-Allow-Origin", "*");
|
||||
response.setHeader("Pragma", "no-cache");
|
||||
response.setHeader("Cache-Control", "no-cache");
|
||||
|
||||
@@ -45,8 +45,8 @@ public class SysDeptController {
|
||||
|
||||
@Operation(summary = "部门下拉列表")
|
||||
@GetMapping("/options")
|
||||
public Result<List<Option>> getDeptOptions() {
|
||||
List<Option> list = deptService.listDeptOptions();
|
||||
public Result<List<Option<Long>>> getDeptOptions() {
|
||||
List<Option<Long>> list = deptService.listDeptOptions();
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ public class SysDeptController {
|
||||
@PostMapping
|
||||
@PreAuthorize("@ss.hasPerm('sys:dept:add')")
|
||||
@PreventRepeatSubmit
|
||||
public Result saveDept(
|
||||
public Result<?> saveDept(
|
||||
@Valid @RequestBody DeptForm formData
|
||||
) {
|
||||
Long id = deptService.saveDept(formData);
|
||||
@@ -73,7 +73,7 @@ public class SysDeptController {
|
||||
@Operation(summary = "修改部门")
|
||||
@PutMapping(value = "/{deptId}")
|
||||
@PreAuthorize("@ss.hasPerm('sys:dept:edit')")
|
||||
public Result updateDept(
|
||||
public Result<?> updateDept(
|
||||
@PathVariable Long deptId,
|
||||
@Valid @RequestBody DeptForm formData
|
||||
) {
|
||||
@@ -84,7 +84,7 @@ public class SysDeptController {
|
||||
@Operation(summary = "删除部门")
|
||||
@DeleteMapping("/{ids}")
|
||||
@PreAuthorize("@ss.hasPerm('sys:dept:delete')")
|
||||
public Result deleteDepartments(
|
||||
public Result<?> deleteDepartments(
|
||||
@Parameter(description ="部门ID,多个以英文逗号(,)分割") @PathVariable("ids") String ids
|
||||
) {
|
||||
boolean result = deptService.deleteByIds(ids);
|
||||
|
||||
@@ -46,17 +46,17 @@ public class SysDictController {
|
||||
|
||||
@Operation(summary = "字典列表")
|
||||
@GetMapping("/list")
|
||||
public Result<List<Option>> getDictList() {
|
||||
List<Option> list = dictService.getDictList();
|
||||
public Result<List<Option<String>>> getDictList() {
|
||||
List<Option<String>> list = dictService.getDictList();
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@Operation(summary = "字典数据项列表")
|
||||
@GetMapping("/{code}/options")
|
||||
public Result<List<Option>> getDictOptions(
|
||||
public Result<List<Option<Long>>> getDictOptions(
|
||||
@Parameter(description = "字典编码") @PathVariable String code
|
||||
) {
|
||||
List<Option> options = dictService.listDictItemsByCode(code);
|
||||
List<Option<Long>> options = dictService.listDictItemsByCode(code);
|
||||
return Result.success(options);
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ public class SysDictController {
|
||||
@PostMapping
|
||||
@PreAuthorize("@ss.hasPerm('sys:dict:add')")
|
||||
@PreventRepeatSubmit
|
||||
public Result saveDict(@RequestBody DictForm formData) {
|
||||
public Result<?> saveDict(@RequestBody DictForm formData) {
|
||||
boolean result = dictService.saveDict(formData);
|
||||
return Result.judge(result);
|
||||
}
|
||||
@@ -81,7 +81,7 @@ public class SysDictController {
|
||||
@Operation(summary = "修改字典")
|
||||
@PutMapping("/{id}")
|
||||
@PreAuthorize("@ss.hasPerm('sys:dict:edit')")
|
||||
public Result updateDict(
|
||||
public Result<?> updateDict(
|
||||
@PathVariable Long id,
|
||||
@RequestBody DictForm DictForm
|
||||
) {
|
||||
@@ -92,7 +92,7 @@ public class SysDictController {
|
||||
@Operation(summary = "删除字典")
|
||||
@DeleteMapping("/{ids}")
|
||||
@PreAuthorize("@ss.hasPerm('sys:dict:delete')")
|
||||
public Result deleteDictionaries(
|
||||
public Result<?> deleteDictionaries(
|
||||
@Parameter(description = "字典ID,多个以英文逗号(,)拼接") @PathVariable String ids
|
||||
) {
|
||||
dictService.deleteDictByIds(ids);
|
||||
|
||||
@@ -47,7 +47,7 @@ public class SysMenuController {
|
||||
|
||||
@Operation(summary = "菜单下拉列表")
|
||||
@GetMapping("/options")
|
||||
public Result listMenuOptions(
|
||||
public Result<?> listMenuOptions(
|
||||
@Parameter(description = "是否只查询父级菜单")
|
||||
@RequestParam(required = false, defaultValue = "false") boolean onlyParent
|
||||
) {
|
||||
@@ -76,7 +76,7 @@ public class SysMenuController {
|
||||
@PostMapping
|
||||
@PreAuthorize("@ss.hasPerm('sys:menu:add')")
|
||||
@PreventRepeatSubmit
|
||||
public Result addMenu(@RequestBody MenuForm menuForm) {
|
||||
public Result<?> addMenu(@RequestBody MenuForm menuForm) {
|
||||
boolean result = menuService.saveMenu(menuForm);
|
||||
return Result.judge(result);
|
||||
}
|
||||
@@ -84,7 +84,7 @@ public class SysMenuController {
|
||||
@Operation(summary = "修改菜单")
|
||||
@PutMapping(value = "/{id}")
|
||||
@PreAuthorize("@ss.hasPerm('sys:menu:edit')")
|
||||
public Result updateMenu(
|
||||
public Result<?> updateMenu(
|
||||
@RequestBody MenuForm menuForm
|
||||
) {
|
||||
boolean result = menuService.saveMenu(menuForm);
|
||||
@@ -94,7 +94,7 @@ public class SysMenuController {
|
||||
@Operation(summary = "删除菜单")
|
||||
@DeleteMapping("/{id}")
|
||||
@PreAuthorize("@ss.hasPerm('sys:menu:delete')")
|
||||
public Result deleteMenu(
|
||||
public Result<?> deleteMenu(
|
||||
@Parameter(description = "菜单ID,多个以英文(,)分割") @PathVariable("id") Long id
|
||||
) {
|
||||
boolean result = menuService.deleteMenu(id);
|
||||
@@ -103,7 +103,7 @@ public class SysMenuController {
|
||||
|
||||
@Operation(summary = "修改菜单显示状态")
|
||||
@PatchMapping("/{menuId}")
|
||||
public Result updateMenuVisible(
|
||||
public Result<?> updateMenuVisible(
|
||||
@Parameter(description = "菜单ID") @PathVariable Long menuId,
|
||||
@Parameter(description = "显示状态(1:显示;0:隐藏)") Integer visible
|
||||
|
||||
|
||||
@@ -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
|
||||
) {
|
||||
|
||||
@@ -67,7 +67,7 @@ public class SysUserController {
|
||||
@PostMapping
|
||||
@PreAuthorize("@ss.hasPerm('sys:user:add')")
|
||||
@PreventRepeatSubmit
|
||||
public Result saveUser(
|
||||
public Result<?> saveUser(
|
||||
@RequestBody @Valid UserForm userForm
|
||||
) {
|
||||
boolean result = userService.saveUser(userForm);
|
||||
@@ -86,7 +86,7 @@ public class SysUserController {
|
||||
@Operation(summary = "修改用户")
|
||||
@PutMapping(value = "/{userId}")
|
||||
@PreAuthorize("@ss.hasPerm('sys:user:edit')")
|
||||
public Result updateUser(
|
||||
public Result<?> updateUser(
|
||||
@Parameter(description = "用户ID") @PathVariable Long userId,
|
||||
@RequestBody @Validated UserForm userForm) {
|
||||
boolean result = userService.updateUser(userId, userForm);
|
||||
@@ -96,7 +96,7 @@ public class SysUserController {
|
||||
@Operation(summary = "删除用户")
|
||||
@DeleteMapping("/{ids}")
|
||||
@PreAuthorize("@ss.hasPerm('sys:user:delete')")
|
||||
public Result deleteUsers(
|
||||
public Result<?> deleteUsers(
|
||||
@Parameter(description = "用户ID,多个以英文逗号(,)分割") @PathVariable String ids
|
||||
) {
|
||||
boolean result = userService.deleteUsers(ids);
|
||||
@@ -106,7 +106,7 @@ public class SysUserController {
|
||||
@Operation(summary = "修改用户密码")
|
||||
@PatchMapping(value = "/{userId}/password")
|
||||
@PreAuthorize("@ss.hasPerm('sys:user:password:reset')")
|
||||
public Result updatePassword(
|
||||
public Result<?> updatePassword(
|
||||
@Parameter(description = "用户ID") @PathVariable Long userId,
|
||||
@RequestParam String password
|
||||
) {
|
||||
@@ -116,7 +116,7 @@ public class SysUserController {
|
||||
|
||||
@Operation(summary = "修改用户状态")
|
||||
@PatchMapping(value = "/{userId}/status")
|
||||
public Result updateUserStatus(
|
||||
public Result<?> updateUserStatus(
|
||||
@Parameter(description = "用户ID") @PathVariable Long userId,
|
||||
@Parameter(description = "用户状态(1:启用;0:禁用)") @RequestParam Integer status
|
||||
) {
|
||||
@@ -152,7 +152,7 @@ public class SysUserController {
|
||||
|
||||
@Operation(summary = "导入用户")
|
||||
@PostMapping("/import")
|
||||
public Result importUsers(MultipartFile file) throws IOException {
|
||||
public Result<?> importUsers(MultipartFile file) throws IOException {
|
||||
UserImportListener listener = new UserImportListener();
|
||||
String msg = ExcelUtils.importExcel(file.getInputStream(), UserImportDTO.class, listener);
|
||||
return Result.success(msg);
|
||||
|
||||
Reference in New Issue
Block a user