fix(): 修改项目编码规范

detached
dongzeliang 2024-06-07 17:16:03 +08:00
parent d03437431a
commit 2d87ebddd8
17 changed files with 31 additions and 30 deletions

View File

@ -8,6 +8,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
@ -26,8 +27,8 @@ public class SysFileController {
/**
*
*/
@PostMapping("upload")
public Result<SysFile> upload (MultipartFile file) {
@PostMapping("/upload")
public Result<SysFile> upload (@RequestPart(value = "file") MultipartFile file) {
try {
// 上传并返回访问地址
String url = sysFileService.uploadFile(file);

View File

@ -52,7 +52,7 @@ public class GenController extends BaseController {
*/
@RequiresPermissions("tool:gen:query")
@GetMapping(value = "/{tableId}")
public Result getInfo (@PathVariable Long tableId) {
public Result getInfo (@PathVariable("tableId") Long tableId) {
GenTable table = genTableService.selectGenTableById(tableId);
List<GenTable> tables = genTableService.selectGenTableAll();
List<GenTableColumn> list = genTableColumnService.selectGenTableColumnListByTableId(tableId);
@ -120,7 +120,7 @@ public class GenController extends BaseController {
@RequiresPermissions("tool:gen:remove")
@Log(title = "代码生成", businessType = BusinessType.DELETE)
@DeleteMapping("/{tableIds}")
public Result remove (@PathVariable Long[] tableIds) {
public Result remove (@PathVariable("tableIds") Long[] tableIds) {
genTableService.deleteGenTableByIds(tableIds);
return success();
}

View File

@ -109,7 +109,7 @@ public class ${ClassName}Controller extends BaseController
@RequiresPermissions("${permissionPrefix}:remove")
@Log(title = "${functionName}", businessType = BusinessType.DELETE)
@DeleteMapping("/{${pkColumn.javaField}s}")
public Result remove(@PathVariable ${pkColumn.javaType}[] ${pkColumn.javaField}s)
public Result remove(@PathVariable("${pkColumn.javaField}s") ${pkColumn.javaType}[] ${pkColumn.javaField}s)
{
return toAjax(${className}Service.delete${ClassName}By${pkColumn.capJavaField}s(${pkColumn.javaField}s));
}

View File

@ -142,7 +142,7 @@ public class SysJobController extends BaseController {
@RequiresPermissions("monitor:job:remove")
@Log(title = "定时任务", businessType = BusinessType.DELETE)
@DeleteMapping("/{jobIds}")
public Result remove (@PathVariable Long[] jobIds) throws SchedulerException, TaskException {
public Result remove (@PathVariable("jobIds") Long[] jobIds) throws SchedulerException, TaskException {
jobService.deleteJobByIds(jobIds);
return success();
}

View File

@ -54,7 +54,7 @@ public class SysJobLogController extends BaseController {
*/
@RequiresPermissions("monitor:job:query")
@GetMapping(value = "/{jobLogId}")
public Result getInfo (@PathVariable Long jobLogId) {
public Result getInfo (@PathVariable("jobLogId") Long jobLogId) {
return success(jobLogService.selectJobLogById(jobLogId));
}
@ -64,7 +64,7 @@ public class SysJobLogController extends BaseController {
@RequiresPermissions("monitor:job:remove")
@Log(title = "定时任务调度日志", businessType = BusinessType.DELETE)
@DeleteMapping("/{jobLogIds}")
public Result remove (@PathVariable Long[] jobLogIds) {
public Result remove (@PathVariable("jobLogIds") Long[] jobLogIds) {
return toAjax(jobLogService.deleteJobLogByIds(jobLogIds));
}

View File

@ -26,7 +26,7 @@ import java.util.List;
@RestController
@RequestMapping("/config")
public class SysConfigController extends BaseController {
@Autowired
private SysConfigService configService;
@ -54,7 +54,7 @@ public class SysConfigController extends BaseController {
*
*/
@GetMapping(value = "/{configId}")
public Result getInfo (@PathVariable Long configId) {
public Result getInfo (@PathVariable("configId") Long configId) {
return success(configService.getById(configId));
}
@ -62,7 +62,7 @@ public class SysConfigController extends BaseController {
*
*/
@GetMapping(value = "/configKey/{configKey}")
public Result getConfigKey (@PathVariable String configKey) {
public Result<String> getConfigKey (@PathVariable("configKey") String configKey) {
return success(configService.selectConfigByKey(configKey));
}
@ -100,7 +100,7 @@ public class SysConfigController extends BaseController {
@RequiresPermissions("system:config:remove")
@Log(title = "参数管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{configIds}")
public Result remove (@PathVariable Long[] configIds) {
public Result remove (@PathVariable("configIds") Long[] configIds) {
configService.removeBatchByIds(Arrays.asList(configIds));
return success();
}

View File

@ -55,7 +55,7 @@ public class SysDeptController extends BaseController {
*/
@RequiresPermissions("system:dept:query")
@GetMapping(value = "/{deptId}")
public Result getInfo (@PathVariable Long deptId) {
public Result getInfo (@PathVariable("deptId") Long deptId) {
deptService.checkDeptDataScope(deptId);
return success(deptService.selectDeptById(deptId));
}
@ -100,7 +100,7 @@ public class SysDeptController extends BaseController {
@RequiresPermissions("system:dept:remove")
@Log(title = "部门管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{deptId}")
public Result remove (@PathVariable Long deptId) {
public Result remove (@PathVariable("deptId") Long deptId) {
if (deptService.hasChildByDeptId(deptId)) {
return warn("存在下级部门,不允许删除");
}

View File

@ -56,7 +56,7 @@ public class SysDictDataController extends BaseController {
*/
@RequiresPermissions("system:dict:query")
@GetMapping(value = "/{dictCode}")
public Result getInfo (@PathVariable Long dictCode) {
public Result getInfo (@PathVariable("dictCode") Long dictCode) {
return success(dictDataService.selectDictDataById(dictCode));
}
@ -64,7 +64,7 @@ public class SysDictDataController extends BaseController {
*
*/
@GetMapping(value = "/type/{dictType}")
public Result dictType (@PathVariable String dictType) {
public Result dictType (@PathVariable("dictType") String dictType) {
List<SysDictData> data = dictTypeService.selectDictDataByType(dictType);
if (StringUtils.isNull(data)) {
data = new ArrayList<SysDictData>();
@ -100,7 +100,7 @@ public class SysDictDataController extends BaseController {
@RequiresPermissions("system:dict:remove")
@Log(title = "字典类型", businessType = BusinessType.DELETE)
@DeleteMapping("/{dictCodes}")
public Result remove (@PathVariable Long[] dictCodes) {
public Result remove (@PathVariable("dictCode") Long[] dictCodes) {
dictDataService.deleteDictDataByIds(dictCodes);
return success();
}

View File

@ -50,7 +50,7 @@ public class SysDictTypeController extends BaseController {
*/
@RequiresPermissions("system:dict:query")
@GetMapping(value = "/{dictId}")
public Result getInfo (@PathVariable Long dictId) {
public Result getInfo (@PathVariable("dictId") Long dictId) {
return success(dictTypeService.selectDictTypeById(dictId));
}
@ -88,7 +88,7 @@ public class SysDictTypeController extends BaseController {
@RequiresPermissions("system:dict:remove")
@Log(title = "字典类型", businessType = BusinessType.DELETE)
@DeleteMapping("/{dictIds}")
public Result remove (@PathVariable Long[] dictIds) {
public Result remove (@PathVariable("dictIds") Long[] dictIds) {
dictTypeService.deleteDictTypeByIds(dictIds);
return success();
}

View File

@ -52,7 +52,7 @@ public class SysLogininforController extends BaseController {
@RequiresPermissions("system:logininfor:remove")
@Log(title = "登录日志", businessType = BusinessType.DELETE)
@DeleteMapping("/{infoIds}")
public Result remove (@PathVariable Long[] infoIds) {
public Result remove (@PathVariable("infoIds") Long[] infoIds) {
return toAjax(logininforService.deleteLogininforByIds(infoIds));
}

View File

@ -44,7 +44,7 @@ public class SysMenuController extends BaseController {
*/
@RequiresPermissions("system:menu:query")
@GetMapping(value = "/{menuId}")
public Result getInfo (@PathVariable Long menuId) {
public Result getInfo (@PathVariable("menuId") Long menuId) {
return success(menuService.selectMenuById(menuId));
}

View File

@ -42,7 +42,7 @@ public class SysNoticeController extends BaseController {
*/
@RequiresPermissions("system:notice:query")
@GetMapping(value = "/{noticeId}")
public Result getInfo (@PathVariable Long noticeId) {
public Result getInfo (@PathVariable("noticeId") Long noticeId) {
return success(noticeService.selectNoticeById(noticeId));
}
@ -74,7 +74,7 @@ public class SysNoticeController extends BaseController {
@RequiresPermissions("system:notice:remove")
@Log(title = "通知公告", businessType = BusinessType.DELETE)
@DeleteMapping("/{noticeIds}")
public Result remove (@PathVariable Long[] noticeIds) {
public Result remove (@PathVariable("noticeIds") Long[] noticeIds) {
return toAjax(noticeService.deleteNoticeByIds(noticeIds));
}
}

View File

@ -47,7 +47,7 @@ public class SysOperlogController extends BaseController {
@Log(title = "操作日志", businessType = BusinessType.DELETE)
@RequiresPermissions("system:operlog:remove")
@DeleteMapping("/{operIds}")
public Result remove (@PathVariable Long[] operIds) {
public Result remove (@PathVariable("operIds") Long[] operIds) {
return toAjax(operLogService.deleteOperLogByIds(operIds));
}

View File

@ -53,7 +53,7 @@ public class SysPostController extends BaseController {
*/
@RequiresPermissions("system:post:query")
@GetMapping(value = "/{postId}")
public Result getInfo (@PathVariable Long postId) {
public Result getInfo (@PathVariable("postId") Long postId) {
return success(postService.selectPostById(postId));
}
@ -95,7 +95,7 @@ public class SysPostController extends BaseController {
@RequiresPermissions("system:post:remove")
@Log(title = "岗位管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{postIds}")
public Result remove (@PathVariable Long[] postIds) {
public Result remove (@PathVariable("postIds") Long[] postIds) {
return toAjax(postService.deletePostByIds(postIds));
}

View File

@ -62,7 +62,7 @@ public class SysRoleController extends BaseController {
*/
@RequiresPermissions("system:role:query")
@GetMapping(value = "/{roleId}")
public Result getInfo (@PathVariable Long roleId) {
public Result getInfo (@PathVariable("roleId") Long roleId) {
roleService.checkRoleDataScope(roleId);
return success(roleService.selectRoleById(roleId));
}
@ -133,7 +133,7 @@ public class SysRoleController extends BaseController {
@RequiresPermissions("system:role:remove")
@Log(title = "角色管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{roleIds}")
public Result remove (@PathVariable Long[] roleIds) {
public Result remove (@PathVariable("roleIds") Long[] roleIds) {
return toAjax(roleService.deleteRoleByIds(roleIds));
}

View File

@ -220,7 +220,7 @@ public class SysUserController extends BaseController {
@RequiresPermissions("system:user:remove")
@Log(title = "用户管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{userIds}")
public Result remove (@PathVariable Long[] userIds) {
public Result remove (@PathVariable("userIds") Long[] userIds) {
if (ArrayUtils.contains(userIds, SecurityUtils.getUserId())) {
return error("当前用户不能删除");
}

View File

@ -62,7 +62,7 @@ public class SysUserOnlineController extends BaseController {
@RequiresPermissions("monitor:online:forceLogout")
@Log(title = "在线用户", businessType = BusinessType.FORCE)
@DeleteMapping("/{tokenId}")
public Result forceLogout (@PathVariable String tokenId) {
public Result forceLogout (@PathVariable("tokenId") String tokenId) {
redisService.deleteObject(CacheConstants.LOGIN_TOKEN_KEY + tokenId);
return success();
}