From 3fc0ef7d6dba0ce02cdc5d693d29558e202cc57a Mon Sep 17 00:00:00 2001 From: "20932067@zju.edu.cn" Date: Fri, 19 Feb 2021 16:10:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E6=9D=83=E9=99=90=E6=A0=87?= =?UTF-8?q?=E8=AF=86=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/monitor/ServerController.java | 2 +- .../monitor/SysLogininforController.java | 8 +++--- .../monitor/SysOperlogController.java | 8 +++--- .../monitor/SysUserOnlineController.java | 4 +-- .../web/controller/system/FileController.java | 26 +++++++++---------- .../controller/system/RegularController.java | 12 ++++----- .../system/SysConfigController.java | 14 +++++----- .../controller/system/SysDeptController.java | 12 ++++----- .../system/SysDictDataController.java | 12 ++++----- .../system/SysDictTypeController.java | 14 +++++----- .../controller/system/SysMenuController.java | 10 +++---- .../system/SysNoticeController.java | 10 +++---- .../controller/system/SysPostController.java | 12 ++++----- .../controller/system/SysRoleController.java | 18 ++++++------- .../controller/system/SysUserController.java | 18 ++++++------- .../controller/tool/SwaggerController.java | 2 +- .../web/service/PermissionService.java | 4 +-- .../framework/web/service/TokenService.java | 20 ++++++++++++++ .../controller/ApiclassController.java | 14 +++++----- .../generator/controller/GenController.java | 24 ++++++++--------- .../controller/InterTableController.java | 20 +++++++------- .../controller/ModuleController.java | 14 +++++----- .../generator/controller/QueryController.java | 14 +++++----- .../controller/UniQueryController.java | 12 ++++----- .../src/main/resources/vm/java/class.java.vm | 2 +- .../main/resources/vm/java/controller.java.vm | 12 ++++----- .../quartz/controller/SysJobController.java | 16 ++++++------ .../controller/SysJobLogController.java | 10 +++---- hchyun/hchyun-system/pom.xml | 5 ---- .../hchyun/system/service/FileService.java | 6 ++++- .../system/service/impl/FileServiceImpl.java | 4 ++- .../test/controller/AssFatherController.java | 12 ++++----- .../test/controller/ResultsController.java | 12 ++++----- .../hchyun/test/controller/StuController.java | 12 ++++----- .../test/controller/TestTreeController.java | 12 ++++----- 35 files changed, 214 insertions(+), 193 deletions(-) diff --git a/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/monitor/ServerController.java b/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/monitor/ServerController.java index 39f5cf3..9b02870 100644 --- a/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/monitor/ServerController.java +++ b/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/monitor/ServerController.java @@ -16,7 +16,7 @@ import com.hchyun.framework.web.domain.Server; @RestController @RequestMapping("/monitor/server") public class ServerController extends BaseController { - @PreAuthorize("@ss.hasPermi('monitor:server:list')") + @PreAuthorize("@hchyun.hasPermi('monitor:server:list')") @GetMapping() public AjaxResult getInfo() throws Exception { Server server = new Server(); diff --git a/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/monitor/SysLogininforController.java b/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/monitor/SysLogininforController.java index 26868aa..dc74983 100644 --- a/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/monitor/SysLogininforController.java +++ b/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/monitor/SysLogininforController.java @@ -29,7 +29,7 @@ public class SysLogininforController extends BaseController { @Autowired private ISysLogininforService logininforService; - @PreAuthorize("@ss.hasPermi('monitor:logininfor:list')") + @PreAuthorize("@hchyun.hasPermi('monitor:logininfor:list')") @GetMapping("/list") public TableDataInfo list(SysLogininfor logininfor) { startPage(); @@ -38,7 +38,7 @@ public class SysLogininforController extends BaseController { } @Log(title = "登录日志", businessType = BusinessType.EXPORT) - @PreAuthorize("@ss.hasPermi('monitor:logininfor:export')") + @PreAuthorize("@hchyun.hasPermi('monitor:logininfor:export')") @GetMapping("/export") public AjaxResult export(SysLogininfor logininfor) { List list = logininforService.selectLogininforList(logininfor); @@ -46,14 +46,14 @@ public class SysLogininforController extends BaseController { return util.exportExcel(list, "登录日志"); } - @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')") + @PreAuthorize("@hchyun.hasPermi('monitor:logininfor:remove')") @Log(title = "登录日志", businessType = BusinessType.DELETE) @DeleteMapping("/{infoIds}") public AjaxResult remove(@PathVariable Long[] infoIds) { return toAjax(logininforService.deleteLogininforByIds(infoIds)); } - @PreAuthorize("@ss.hasPermi('monitor:logininfor:remove')") + @PreAuthorize("@hchyun.hasPermi('monitor:logininfor:remove')") @Log(title = "登录日志", businessType = BusinessType.CLEAN) @DeleteMapping("/clean") public AjaxResult clean() { diff --git a/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/monitor/SysOperlogController.java b/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/monitor/SysOperlogController.java index d9fc61c..5a9a42f 100644 --- a/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/monitor/SysOperlogController.java +++ b/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/monitor/SysOperlogController.java @@ -29,7 +29,7 @@ public class SysOperlogController extends BaseController { @Autowired private ISysOperLogService operLogService; - @PreAuthorize("@ss.hasPermi('monitor:operlog:list')") + @PreAuthorize("@hchyun.hasPermi('monitor:operlog:list')") @GetMapping("/list") public TableDataInfo list(SysOperLog operLog) { startPage(); @@ -38,7 +38,7 @@ public class SysOperlogController extends BaseController { } @Log(title = "操作日志", businessType = BusinessType.EXPORT) - @PreAuthorize("@ss.hasPermi('monitor:operlog:export')") + @PreAuthorize("@hchyun.hasPermi('monitor:operlog:export')") @GetMapping("/export") public AjaxResult export(SysOperLog operLog) { List list = operLogService.selectOperLogList(operLog); @@ -46,14 +46,14 @@ public class SysOperlogController extends BaseController { return util.exportExcel(list, "操作日志"); } - @PreAuthorize("@ss.hasPermi('monitor:operlog:remove')") + @PreAuthorize("@hchyun.hasPermi('monitor:operlog:remove')") @DeleteMapping("/{operIds}") public AjaxResult remove(@PathVariable Long[] operIds) { return toAjax(operLogService.deleteOperLogByIds(operIds)); } @Log(title = "操作日志", businessType = BusinessType.CLEAN) - @PreAuthorize("@ss.hasPermi('monitor:operlog:remove')") + @PreAuthorize("@hchyun.hasPermi('monitor:operlog:remove')") @DeleteMapping("/clean") public AjaxResult clean() { operLogService.cleanOperLog(); diff --git a/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/monitor/SysUserOnlineController.java b/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/monitor/SysUserOnlineController.java index 80d5cfd..2a337b0 100644 --- a/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/monitor/SysUserOnlineController.java +++ b/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/monitor/SysUserOnlineController.java @@ -38,7 +38,7 @@ public class SysUserOnlineController extends BaseController { @Autowired private RedisCache redisCache; - @PreAuthorize("@ss.hasPermi('monitor:online:list')") + @PreAuthorize("@hchyun.hasPermi('monitor:online:list')") @GetMapping("/list") public TableDataInfo list(String ipaddr, String userName) { Collection keys = redisCache.keys(Constants.LOGIN_TOKEN_KEY + "*"); @@ -69,7 +69,7 @@ public class SysUserOnlineController extends BaseController { /** * 强退用户 */ - @PreAuthorize("@ss.hasPermi('monitor:online:forceLogout')") + @PreAuthorize("@hchyun.hasPermi('monitor:online:forceLogout')") @Log(title = "在线用户", businessType = BusinessType.FORCE) @DeleteMapping("/{tokenId}") public AjaxResult forceLogout(@PathVariable String tokenId) { diff --git a/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/FileController.java b/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/FileController.java index 58e0f16..c496129 100644 --- a/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/FileController.java +++ b/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/FileController.java @@ -1,7 +1,5 @@ package com.hchyun.web.controller.system; -import java.io.FileNotFoundException; -import java.io.IOException; import java.io.Serializable; import java.util.HashMap; import java.util.List; @@ -10,14 +8,12 @@ import java.util.Map; import com.hchyun.common.constant.ReturnConstants; import com.hchyun.common.core.controller.HcyBaseController; +import com.hchyun.common.core.entity.model.LoginUser; import com.hchyun.common.utils.ServerResult; -import com.hchyun.system.dto.FileDownload; +import com.hchyun.framework.web.service.TokenService; import com.hchyun.system.entity.SysFile; import com.hchyun.system.utils.FtpUtils; import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; -import org.apache.commons.io.IOUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.security.access.prepost.PreAuthorize; @@ -56,10 +52,13 @@ public class FileController extends HcyBaseController { @Autowired private FileService fileService; + @Autowired + private TokenService tokenService; + /** * 查询文件信息列表 */ - @PreAuthorize("@ss.hasPermi('system:file:list')") + @PreAuthorize("@hchyun.hasPermi('system:file:list')") @PutMapping("/list") public Serializable list(@Validated @RequestBody SysFile sysFile) { try { @@ -79,7 +78,7 @@ public class FileController extends HcyBaseController { /** * 导出文件信息列表 */ - @PreAuthorize("@ss.hasPermi('system:file:export')") + @PreAuthorize("@hchyun.hasPermi('system:file:export')") @Log(title = "文件信息", businessType = BusinessType.EXPORT) @PutMapping("/export") public AjaxResult export(@Validated @RequestBody SysFile sysFile) { @@ -100,7 +99,7 @@ public class FileController extends HcyBaseController { /** * 获取文件信息详细信息 */ - @PreAuthorize("@ss.hasPermi('system:file:query')") + @PreAuthorize("@hchyun.hasPermi('system:file:query')") @GetMapping(value = "/{fileId}") public AjaxResult getInfo(@PathVariable("fileId") Long fileId) { try { @@ -119,7 +118,7 @@ public class FileController extends HcyBaseController { /** * 新增文件信息 */ - @PreAuthorize("@ss.hasPermi('system:file:add')") + @PreAuthorize("@hchyun.hasPermi('system:file:add')") @Log(title = "文件信息", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody SysFile sysFile) { @@ -146,7 +145,7 @@ public class FileController extends HcyBaseController { /** * 修改文件信息 */ - @PreAuthorize("@ss.hasPermi('system:file:edit')") + @PreAuthorize("@hchyun.hasPermi('system:file:edit')") @Log(title = "文件信息", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody SysFile sysFile) { @@ -167,7 +166,7 @@ public class FileController extends HcyBaseController { /** * 删除文件信息 */ - @PreAuthorize("@ss.hasPermi('system:file:remove')") + @PreAuthorize("@hchyun.hasPermi('system:file:remove')") @Log(title = "文件信息", businessType = BusinessType.DELETE) @DeleteMapping("/{fileIds}") public AjaxResult remove(@PathVariable Long[] fileIds) { @@ -190,7 +189,8 @@ public class FileController extends HcyBaseController { @GetMapping("/download/{fileId}") public AjaxResult download(@PathVariable Long fileId, HttpServletRequest request, HttpServletResponse response) { try { - ServerResult serverResult = fileService.downloadFile(fileId); + LoginUser user = tokenService.getFileUser(request); + ServerResult serverResult = fileService.downloadFile(fileId,user); if (serverResult.isStart()) { return AjaxResult.success(serverResult.getData().getFileName()); } else { diff --git a/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/RegularController.java b/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/RegularController.java index 735fc4a..2690b5a 100644 --- a/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/RegularController.java +++ b/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/RegularController.java @@ -46,7 +46,7 @@ public class RegularController extends HcyBaseController { * @param regular * @return */ - @PreAuthorize("@ss.hasPermi('system:regular:list')") + @PreAuthorize("@hchyun.hasPermi('system:regular:list')") @GetMapping("/list") public Serializable list(Regular regular) { try { @@ -69,7 +69,7 @@ public class RegularController extends HcyBaseController { * @param regular * @return */ - @PreAuthorize("@ss.hasPermi('system:regular:export')") + @PreAuthorize("@hchyun.hasPermi('system:regular:export')") @Log(title = "校验规则", businessType = BusinessType.EXPORT) @GetMapping("/export") public AjaxResult export(Regular regular) { @@ -93,7 +93,7 @@ public class RegularController extends HcyBaseController { * @param id * @return */ - @PreAuthorize("@ss.hasPermi('system:regular:query')") + @PreAuthorize("@hchyun.hasPermi('system:regular:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { try { @@ -115,7 +115,7 @@ public class RegularController extends HcyBaseController { * @param regular * @return */ - @PreAuthorize("@ss.hasPermi('system:regular:add')") + @PreAuthorize("@hchyun.hasPermi('system:regular:add')") @Log(title = "校验规则", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody Regular regular) { @@ -150,7 +150,7 @@ public class RegularController extends HcyBaseController { * @param regular * @return */ - @PreAuthorize("@ss.hasPermi('system:regular:edit')") + @PreAuthorize("@hchyun.hasPermi('system:regular:edit')") @Log(title = "校验规则", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody Regular regular) { @@ -185,7 +185,7 @@ public class RegularController extends HcyBaseController { * @param ids * @return */ - @PreAuthorize("@ss.hasPermi('system:regular:remove')") + @PreAuthorize("@hchyun.hasPermi('system:regular:remove')") @Log(title = "校验规则", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { diff --git a/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/SysConfigController.java b/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/SysConfigController.java index 4f5cdb4..f7534ce 100644 --- a/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/SysConfigController.java +++ b/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/SysConfigController.java @@ -39,7 +39,7 @@ public class SysConfigController extends BaseController { /** * 获取参数配置列表 */ - @PreAuthorize("@ss.hasPermi('system:config:list')") + @PreAuthorize("@hchyun.hasPermi('system:config:list')") @GetMapping("/list") public TableDataInfo list(SysConfig config) { startPage(); @@ -48,7 +48,7 @@ public class SysConfigController extends BaseController { } @Log(title = "参数管理", businessType = BusinessType.EXPORT) - @PreAuthorize("@ss.hasPermi('system:config:export')") + @PreAuthorize("@hchyun.hasPermi('system:config:export')") @GetMapping("/export") public AjaxResult export(SysConfig config) { List list = configService.selectConfigList(config); @@ -59,7 +59,7 @@ public class SysConfigController extends BaseController { /** * 根据参数编号获取详细信息 */ - @PreAuthorize("@ss.hasPermi('system:config:query')") + @PreAuthorize("@hchyun.hasPermi('system:config:query')") @GetMapping(value = "/{configId}") public AjaxResult getInfo(@PathVariable Long configId) { return AjaxResult.success(configService.selectConfigById(configId)); @@ -76,7 +76,7 @@ public class SysConfigController extends BaseController { /** * 新增参数配置 */ - @PreAuthorize("@ss.hasPermi('system:config:add')") + @PreAuthorize("@hchyun.hasPermi('system:config:add')") @Log(title = "参数管理", businessType = BusinessType.INSERT) @PostMapping @RepeatSubmit @@ -91,7 +91,7 @@ public class SysConfigController extends BaseController { /** * 修改参数配置 */ - @PreAuthorize("@ss.hasPermi('system:config:edit')") + @PreAuthorize("@hchyun.hasPermi('system:config:edit')") @Log(title = "参数管理", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@Validated @RequestBody SysConfig config) { @@ -105,7 +105,7 @@ public class SysConfigController extends BaseController { /** * 删除参数配置 */ - @PreAuthorize("@ss.hasPermi('system:config:remove')") + @PreAuthorize("@hchyun.hasPermi('system:config:remove')") @Log(title = "参数管理", businessType = BusinessType.DELETE) @DeleteMapping("/{configIds}") public AjaxResult remove(@PathVariable Long[] configIds) { @@ -115,7 +115,7 @@ public class SysConfigController extends BaseController { /** * 清空缓存 */ - @PreAuthorize("@ss.hasPermi('system:config:remove')") + @PreAuthorize("@hchyun.hasPermi('system:config:remove')") @Log(title = "参数管理", businessType = BusinessType.CLEAN) @DeleteMapping("/clearCache") public AjaxResult clearCache() { diff --git a/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/SysDeptController.java b/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/SysDeptController.java index 1a4bf05..30d801b 100644 --- a/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/SysDeptController.java +++ b/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/SysDeptController.java @@ -39,7 +39,7 @@ public class SysDeptController extends BaseController { /** * 获取部门列表 */ - @PreAuthorize("@ss.hasPermi('system:dept:list')") + @PreAuthorize("@hchyun.hasPermi('system:dept:list')") @GetMapping("/list") public AjaxResult list(SysDept dept) { List depts = deptService.selectDeptList(dept); @@ -49,7 +49,7 @@ public class SysDeptController extends BaseController { /** * 查询部门列表(排除节点) */ - @PreAuthorize("@ss.hasPermi('system:dept:list')") + @PreAuthorize("@hchyun.hasPermi('system:dept:list')") @GetMapping("/list/exclude/{deptId}") public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId) { List depts = deptService.selectDeptList(new SysDept()); @@ -67,7 +67,7 @@ public class SysDeptController extends BaseController { /** * 根据部门编号获取详细信息 */ - @PreAuthorize("@ss.hasPermi('system:dept:query')") + @PreAuthorize("@hchyun.hasPermi('system:dept:query')") @GetMapping(value = "/{deptId}") public AjaxResult getInfo(@PathVariable Long deptId) { return AjaxResult.success(deptService.selectDeptById(deptId)); @@ -97,7 +97,7 @@ public class SysDeptController extends BaseController { /** * 新增部门 */ - @PreAuthorize("@ss.hasPermi('system:dept:add')") + @PreAuthorize("@hchyun.hasPermi('system:dept:add')") @Log(title = "部门管理", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@Validated @RequestBody SysDept dept) { @@ -111,7 +111,7 @@ public class SysDeptController extends BaseController { /** * 修改部门 */ - @PreAuthorize("@ss.hasPermi('system:dept:edit')") + @PreAuthorize("@hchyun.hasPermi('system:dept:edit')") @Log(title = "部门管理", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@Validated @RequestBody SysDept dept) { @@ -130,7 +130,7 @@ public class SysDeptController extends BaseController { /** * 删除部门 */ - @PreAuthorize("@ss.hasPermi('system:dept:remove')") + @PreAuthorize("@hchyun.hasPermi('system:dept:remove')") @Log(title = "部门管理", businessType = BusinessType.DELETE) @DeleteMapping("/{deptId}") public AjaxResult remove(@PathVariable Long deptId) { diff --git a/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/SysDictDataController.java b/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/SysDictDataController.java index e646d4c..ca7385f 100644 --- a/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/SysDictDataController.java +++ b/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/SysDictDataController.java @@ -38,7 +38,7 @@ public class SysDictDataController extends BaseController { @Autowired private ISysDictTypeService dictTypeService; - @PreAuthorize("@ss.hasPermi('system:dict:list')") + @PreAuthorize("@hchyun.hasPermi('system:dict:list')") @GetMapping("/list") public TableDataInfo list(SysDictData dictData) { startPage(); @@ -47,7 +47,7 @@ public class SysDictDataController extends BaseController { } @Log(title = "字典数据", businessType = BusinessType.EXPORT) - @PreAuthorize("@ss.hasPermi('system:dict:export')") + @PreAuthorize("@hchyun.hasPermi('system:dict:export')") @GetMapping("/export") public AjaxResult export(SysDictData dictData) { List list = dictDataService.selectDictDataList(dictData); @@ -58,7 +58,7 @@ public class SysDictDataController extends BaseController { /** * 查询字典数据详细 */ - @PreAuthorize("@ss.hasPermi('system:dict:query')") + @PreAuthorize("@hchyun.hasPermi('system:dict:query')") @GetMapping(value = "/{dictCode}") public AjaxResult getInfo(@PathVariable Long dictCode) { return AjaxResult.success(dictDataService.selectDictDataById(dictCode)); @@ -75,7 +75,7 @@ public class SysDictDataController extends BaseController { /** * 新增字典类型 */ - @PreAuthorize("@ss.hasPermi('system:dict:add')") + @PreAuthorize("@hchyun.hasPermi('system:dict:add')") @Log(title = "字典数据", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@Validated @RequestBody SysDictData dict) { @@ -86,7 +86,7 @@ public class SysDictDataController extends BaseController { /** * 修改保存字典类型 */ - @PreAuthorize("@ss.hasPermi('system:dict:edit')") + @PreAuthorize("@hchyun.hasPermi('system:dict:edit')") @Log(title = "字典数据", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@Validated @RequestBody SysDictData dict) { @@ -97,7 +97,7 @@ public class SysDictDataController extends BaseController { /** * 删除字典类型 */ - @PreAuthorize("@ss.hasPermi('system:dict:remove')") + @PreAuthorize("@hchyun.hasPermi('system:dict:remove')") @Log(title = "字典类型", businessType = BusinessType.DELETE) @DeleteMapping("/{dictCodes}") public AjaxResult remove(@PathVariable Long[] dictCodes) { diff --git a/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/SysDictTypeController.java b/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/SysDictTypeController.java index 6523d20..3ad81ad 100644 --- a/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/SysDictTypeController.java +++ b/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/SysDictTypeController.java @@ -35,7 +35,7 @@ public class SysDictTypeController extends BaseController { @Autowired private ISysDictTypeService dictTypeService; - @PreAuthorize("@ss.hasPermi('system:dict:list')") + @PreAuthorize("@hchyun.hasPermi('system:dict:list')") @GetMapping("/list") public TableDataInfo list(SysDictType dictType) { startPage(); @@ -44,7 +44,7 @@ public class SysDictTypeController extends BaseController { } @Log(title = "字典类型", businessType = BusinessType.EXPORT) - @PreAuthorize("@ss.hasPermi('system:dict:export')") + @PreAuthorize("@hchyun.hasPermi('system:dict:export')") @GetMapping("/export") public AjaxResult export(SysDictType dictType) { List list = dictTypeService.selectDictTypeList(dictType); @@ -55,7 +55,7 @@ public class SysDictTypeController extends BaseController { /** * 查询字典类型详细 */ - @PreAuthorize("@ss.hasPermi('system:dict:query')") + @PreAuthorize("@hchyun.hasPermi('system:dict:query')") @GetMapping(value = "/{dictId}") public AjaxResult getInfo(@PathVariable Long dictId) { return AjaxResult.success(dictTypeService.selectDictTypeById(dictId)); @@ -64,7 +64,7 @@ public class SysDictTypeController extends BaseController { /** * 新增字典类型 */ - @PreAuthorize("@ss.hasPermi('system:dict:add')") + @PreAuthorize("@hchyun.hasPermi('system:dict:add')") @Log(title = "字典类型", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@Validated @RequestBody SysDictType dict) { @@ -78,7 +78,7 @@ public class SysDictTypeController extends BaseController { /** * 修改字典类型 */ - @PreAuthorize("@ss.hasPermi('system:dict:edit')") + @PreAuthorize("@hchyun.hasPermi('system:dict:edit')") @Log(title = "字典类型", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@Validated @RequestBody SysDictType dict) { @@ -92,7 +92,7 @@ public class SysDictTypeController extends BaseController { /** * 删除字典类型 */ - @PreAuthorize("@ss.hasPermi('system:dict:remove')") + @PreAuthorize("@hchyun.hasPermi('system:dict:remove')") @Log(title = "字典类型", businessType = BusinessType.DELETE) @DeleteMapping("/{dictIds}") public AjaxResult remove(@PathVariable Long[] dictIds) { @@ -102,7 +102,7 @@ public class SysDictTypeController extends BaseController { /** * 清空缓存 */ - @PreAuthorize("@ss.hasPermi('system:dict:remove')") + @PreAuthorize("@hchyun.hasPermi('system:dict:remove')") @Log(title = "字典类型", businessType = BusinessType.CLEAN) @DeleteMapping("/clearCache") public AjaxResult clearCache() { diff --git a/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/SysMenuController.java b/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/SysMenuController.java index ebc69a6..b774f55 100644 --- a/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/SysMenuController.java +++ b/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/SysMenuController.java @@ -44,7 +44,7 @@ public class SysMenuController extends BaseController { /** * 获取菜单列表 */ - @PreAuthorize("@ss.hasPermi('system:menu:list')") + @PreAuthorize("@hchyun.hasPermi('system:menu:list')") @GetMapping("/list") public AjaxResult list(SysMenu menu) { LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest()); @@ -56,7 +56,7 @@ public class SysMenuController extends BaseController { /** * 根据菜单编号获取详细信息 */ - @PreAuthorize("@ss.hasPermi('system:menu:query')") + @PreAuthorize("@hchyun.hasPermi('system:menu:query')") @GetMapping(value = "/{menuId}") public AjaxResult getInfo(@PathVariable Long menuId) { return AjaxResult.success(menuService.selectMenuById(menuId)); @@ -89,7 +89,7 @@ public class SysMenuController extends BaseController { /** * 新增菜单 */ - @PreAuthorize("@ss.hasPermi('system:menu:add')") + @PreAuthorize("@hchyun.hasPermi('system:menu:add')") @Log(title = "菜单管理", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@Validated @RequestBody SysMenu menu) { @@ -106,7 +106,7 @@ public class SysMenuController extends BaseController { /** * 修改菜单 */ - @PreAuthorize("@ss.hasPermi('system:menu:edit')") + @PreAuthorize("@hchyun.hasPermi('system:menu:edit')") @Log(title = "菜单管理", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@Validated @RequestBody SysMenu menu) { @@ -125,7 +125,7 @@ public class SysMenuController extends BaseController { /** * 删除菜单 */ - @PreAuthorize("@ss.hasPermi('system:menu:remove')") + @PreAuthorize("@hchyun.hasPermi('system:menu:remove')") @Log(title = "菜单管理", businessType = BusinessType.DELETE) @DeleteMapping("/{menuId}") public AjaxResult remove(@PathVariable("menuId") Long menuId) { diff --git a/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/SysNoticeController.java b/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/SysNoticeController.java index 6a2cf37..f9ea6ca 100644 --- a/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/SysNoticeController.java +++ b/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/SysNoticeController.java @@ -36,7 +36,7 @@ public class SysNoticeController extends BaseController { /** * 获取通知公告列表 */ - @PreAuthorize("@ss.hasPermi('system:notice:list')") + @PreAuthorize("@hchyun.hasPermi('system:notice:list')") @GetMapping("/list") public TableDataInfo list(SysNotice notice) { startPage(); @@ -47,7 +47,7 @@ public class SysNoticeController extends BaseController { /** * 根据通知公告编号获取详细信息 */ - @PreAuthorize("@ss.hasPermi('system:notice:query')") + @PreAuthorize("@hchyun.hasPermi('system:notice:query')") @GetMapping(value = "/{noticeId}") public AjaxResult getInfo(@PathVariable Long noticeId) { return AjaxResult.success(noticeService.selectNoticeById(noticeId)); @@ -56,7 +56,7 @@ public class SysNoticeController extends BaseController { /** * 新增通知公告 */ - @PreAuthorize("@ss.hasPermi('system:notice:add')") + @PreAuthorize("@hchyun.hasPermi('system:notice:add')") @Log(title = "通知公告", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@Validated @RequestBody SysNotice notice) { @@ -67,7 +67,7 @@ public class SysNoticeController extends BaseController { /** * 修改通知公告 */ - @PreAuthorize("@ss.hasPermi('system:notice:edit')") + @PreAuthorize("@hchyun.hasPermi('system:notice:edit')") @Log(title = "通知公告", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@Validated @RequestBody SysNotice notice) { @@ -78,7 +78,7 @@ public class SysNoticeController extends BaseController { /** * 删除通知公告 */ - @PreAuthorize("@ss.hasPermi('system:notice:remove')") + @PreAuthorize("@hchyun.hasPermi('system:notice:remove')") @Log(title = "通知公告", businessType = BusinessType.DELETE) @DeleteMapping("/{noticeIds}") public AjaxResult remove(@PathVariable Long[] noticeIds) { diff --git a/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/SysPostController.java b/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/SysPostController.java index 87d3520..b14f9b2 100644 --- a/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/SysPostController.java +++ b/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/SysPostController.java @@ -38,7 +38,7 @@ public class SysPostController extends BaseController { /** * 获取岗位列表 */ - @PreAuthorize("@ss.hasPermi('system:post:list')") + @PreAuthorize("@hchyun.hasPermi('system:post:list')") @GetMapping("/list") public TableDataInfo list(SysPost post) { startPage(); @@ -47,7 +47,7 @@ public class SysPostController extends BaseController { } @Log(title = "岗位管理", businessType = BusinessType.EXPORT) - @PreAuthorize("@ss.hasPermi('system:post:export')") + @PreAuthorize("@hchyun.hasPermi('system:post:export')") @GetMapping("/export") public AjaxResult export(SysPost post) { List list = postService.selectPostList(post); @@ -58,7 +58,7 @@ public class SysPostController extends BaseController { /** * 根据岗位编号获取详细信息 */ - @PreAuthorize("@ss.hasPermi('system:post:query')") + @PreAuthorize("@hchyun.hasPermi('system:post:query')") @GetMapping(value = "/{postId}") public AjaxResult getInfo(@PathVariable Long postId) { return AjaxResult.success(postService.selectPostById(postId)); @@ -67,7 +67,7 @@ public class SysPostController extends BaseController { /** * 新增岗位 */ - @PreAuthorize("@ss.hasPermi('system:post:add')") + @PreAuthorize("@hchyun.hasPermi('system:post:add')") @Log(title = "岗位管理", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@Validated @RequestBody SysPost post) { @@ -83,7 +83,7 @@ public class SysPostController extends BaseController { /** * 修改岗位 */ - @PreAuthorize("@ss.hasPermi('system:post:edit')") + @PreAuthorize("@hchyun.hasPermi('system:post:edit')") @Log(title = "岗位管理", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@Validated @RequestBody SysPost post) { @@ -99,7 +99,7 @@ public class SysPostController extends BaseController { /** * 删除岗位 */ - @PreAuthorize("@ss.hasPermi('system:post:remove')") + @PreAuthorize("@hchyun.hasPermi('system:post:remove')") @Log(title = "岗位管理", businessType = BusinessType.DELETE) @DeleteMapping("/{postIds}") public AjaxResult remove(@PathVariable Long[] postIds) { diff --git a/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/SysRoleController.java b/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/SysRoleController.java index 82206f5..491fb3a 100644 --- a/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/SysRoleController.java +++ b/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/SysRoleController.java @@ -53,7 +53,7 @@ public class SysRoleController extends BaseController { @Autowired private ISysUserService userService; - @PreAuthorize("@ss.hasPermi('system:role:list')") + @PreAuthorize("@hchyun.hasPermi('system:role:list')") @GetMapping("/list") public TableDataInfo list(SysRole role) { startPage(); @@ -62,7 +62,7 @@ public class SysRoleController extends BaseController { } @Log(title = "角色管理", businessType = BusinessType.EXPORT) - @PreAuthorize("@ss.hasPermi('system:role:export')") + @PreAuthorize("@hchyun.hasPermi('system:role:export')") @GetMapping("/export") public AjaxResult export(SysRole role) { List list = roleService.selectRoleList(role); @@ -73,7 +73,7 @@ public class SysRoleController extends BaseController { /** * 根据角色编号获取详细信息 */ - @PreAuthorize("@ss.hasPermi('system:role:query')") + @PreAuthorize("@hchyun.hasPermi('system:role:query')") @GetMapping(value = "/{roleId}") public AjaxResult getInfo(@PathVariable Long roleId) { return AjaxResult.success(roleService.selectRoleById(roleId)); @@ -82,7 +82,7 @@ public class SysRoleController extends BaseController { /** * 新增角色 */ - @PreAuthorize("@ss.hasPermi('system:role:add')") + @PreAuthorize("@hchyun.hasPermi('system:role:add')") @Log(title = "角色管理", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@Validated @RequestBody SysRole role) { @@ -99,7 +99,7 @@ public class SysRoleController extends BaseController { /** * 修改保存角色 */ - @PreAuthorize("@ss.hasPermi('system:role:edit')") + @PreAuthorize("@hchyun.hasPermi('system:role:edit')") @Log(title = "角色管理", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@Validated @RequestBody SysRole role) { @@ -127,7 +127,7 @@ public class SysRoleController extends BaseController { /** * 修改保存数据权限 */ - @PreAuthorize("@ss.hasPermi('system:role:edit')") + @PreAuthorize("@hchyun.hasPermi('system:role:edit')") @Log(title = "角色管理", businessType = BusinessType.UPDATE) @PutMapping("/dataScope") public AjaxResult dataScope(@RequestBody SysRole role) { @@ -138,7 +138,7 @@ public class SysRoleController extends BaseController { /** * 状态修改 */ - @PreAuthorize("@ss.hasPermi('system:role:edit')") + @PreAuthorize("@hchyun.hasPermi('system:role:edit')") @Log(title = "角色管理", businessType = BusinessType.UPDATE) @PutMapping("/changeStatus") public AjaxResult changeStatus(@RequestBody SysRole role) { @@ -150,7 +150,7 @@ public class SysRoleController extends BaseController { /** * 删除角色 */ - @PreAuthorize("@ss.hasPermi('system:role:remove')") + @PreAuthorize("@hchyun.hasPermi('system:role:remove')") @Log(title = "角色管理", businessType = BusinessType.DELETE) @DeleteMapping("/{roleIds}") public AjaxResult remove(@PathVariable Long[] roleIds) { @@ -160,7 +160,7 @@ public class SysRoleController extends BaseController { /** * 获取角色选择框列表 */ - @PreAuthorize("@ss.hasPermi('system:role:query')") + @PreAuthorize("@hchyun.hasPermi('system:role:query')") @GetMapping("/optionselect") public AjaxResult optionselect(Integer type) { if (type == 1 || type == 2) { diff --git a/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/SysUserController.java b/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/SysUserController.java index 9e9c140..69aacfe 100644 --- a/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/SysUserController.java +++ b/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/system/SysUserController.java @@ -56,7 +56,7 @@ public class SysUserController extends BaseController { /** * 获取用户列表 */ - @PreAuthorize("@ss.hasPermi('system:user:list')") + @PreAuthorize("@hchyun.hasPermi('system:user:list')") @GetMapping("/list") public TableDataInfo list(SysUser user) { startPage(); @@ -65,7 +65,7 @@ public class SysUserController extends BaseController { } @Log(title = "用户管理", businessType = BusinessType.EXPORT) - @PreAuthorize("@ss.hasPermi('system:user:export')") + @PreAuthorize("@hchyun.hasPermi('system:user:export')") @GetMapping("/export") public AjaxResult export(SysUser user) { List list = userService.selectUserList(user); @@ -74,7 +74,7 @@ public class SysUserController extends BaseController { } @Log(title = "用户管理", businessType = BusinessType.IMPORT) - @PreAuthorize("@ss.hasPermi('system:user:import')") + @PreAuthorize("@hchyun.hasPermi('system:user:import')") @PostMapping("/importData") public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception { ExcelUtil util = new ExcelUtil(SysUser.class); @@ -94,7 +94,7 @@ public class SysUserController extends BaseController { /** * 根据用户编号获取详细信息 */ - @PreAuthorize("@ss.hasPermi('system:user:query')") + @PreAuthorize("@hchyun.hasPermi('system:user:query')") @GetMapping(value = {"/", "/{userId}"}) public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId) { AjaxResult ajax = AjaxResult.success(); @@ -112,7 +112,7 @@ public class SysUserController extends BaseController { /** * 新增用户 */ - @PreAuthorize("@ss.hasPermi('system:user:add')") + @PreAuthorize("@hchyun.hasPermi('system:user:add')") @Log(title = "用户管理", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@Validated @RequestBody SysUser user) { @@ -131,7 +131,7 @@ public class SysUserController extends BaseController { /** * 修改用户 */ - @PreAuthorize("@ss.hasPermi('system:user:edit')") + @PreAuthorize("@hchyun.hasPermi('system:user:edit')") @Log(title = "用户管理", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@Validated @RequestBody SysUser user) { @@ -148,7 +148,7 @@ public class SysUserController extends BaseController { /** * 删除用户 */ - @PreAuthorize("@ss.hasPermi('system:user:remove')") + @PreAuthorize("@hchyun.hasPermi('system:user:remove')") @Log(title = "用户管理", businessType = BusinessType.DELETE) @DeleteMapping("/{userIds}") public AjaxResult remove(@PathVariable Long[] userIds) { @@ -158,7 +158,7 @@ public class SysUserController extends BaseController { /** * 重置密码 */ - @PreAuthorize("@ss.hasPermi('system:user:resetPwd')") + @PreAuthorize("@hchyun.hasPermi('system:user:resetPwd')") @Log(title = "用户管理", businessType = BusinessType.UPDATE) @PutMapping("/resetPwd") public AjaxResult resetPwd(@RequestBody SysUser user) { @@ -171,7 +171,7 @@ public class SysUserController extends BaseController { /** * 状态修改 */ - @PreAuthorize("@ss.hasPermi('system:user:edit')") + @PreAuthorize("@hchyun.hasPermi('system:user:edit')") @Log(title = "用户管理", businessType = BusinessType.UPDATE) @PutMapping("/changeStatus") public AjaxResult changeStatus(@RequestBody SysUser user) { diff --git a/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/tool/SwaggerController.java b/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/tool/SwaggerController.java index 23c9547..cae2553 100644 --- a/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/tool/SwaggerController.java +++ b/hchyun/hchyun-admin/src/main/java/com/hchyun/web/controller/tool/SwaggerController.java @@ -14,7 +14,7 @@ import com.hchyun.common.core.controller.BaseController; @Controller @RequestMapping("/tool/swagger") public class SwaggerController extends BaseController { - @PreAuthorize("@ss.hasPermi('tool:swagger:view')") + @PreAuthorize("@hchyun.hasPermi('tool:swagger:view')") @GetMapping() public String index() { return redirect("/swagger-ui.html"); diff --git a/hchyun/hchyun-framework/src/main/java/com/hchyun/framework/web/service/PermissionService.java b/hchyun/hchyun-framework/src/main/java/com/hchyun/framework/web/service/PermissionService.java index 4261263..5155a71 100644 --- a/hchyun/hchyun-framework/src/main/java/com/hchyun/framework/web/service/PermissionService.java +++ b/hchyun/hchyun-framework/src/main/java/com/hchyun/framework/web/service/PermissionService.java @@ -11,11 +11,11 @@ import com.hchyun.common.utils.ServletUtils; import com.hchyun.common.utils.StringUtils; /** - * RuoYi首创 自定义权限实现,ss取自SpringSecurity首字母 + * todo 自定义权限实现,ss取自SpringSecurity首字母 * * @author hchyun */ -@Service("ss") +@Service("hchyun") public class PermissionService { /** * 所有权限标识 diff --git a/hchyun/hchyun-framework/src/main/java/com/hchyun/framework/web/service/TokenService.java b/hchyun/hchyun-framework/src/main/java/com/hchyun/framework/web/service/TokenService.java index 4b96389..22828e6 100644 --- a/hchyun/hchyun-framework/src/main/java/com/hchyun/framework/web/service/TokenService.java +++ b/hchyun/hchyun-framework/src/main/java/com/hchyun/framework/web/service/TokenService.java @@ -68,6 +68,26 @@ public class TokenService { return null; } + /** + * 文件获取用户信息 + */ + public LoginUser getFileUser(HttpServletRequest request){ + String token = request.getHeader("token"); + if (StringUtils.isNotEmpty(token) && token.startsWith(Constants.TOKEN_PREFIX)){ + token = token.replace(Constants.TOKEN_PREFIX,""); + } + if (StringUtils.isNotEmpty(token)){ + Claims claims = parseToken(token); + + String uuid = (String) claims.get(Constants.LOGIN_USER_KEY); + String userKey = getTokenKey(uuid); + return redisCache.getCacheObject(userKey); + }else { + return null; + } + } + + /** * 设置用户身份信息 */ diff --git a/hchyun/hchyun-generator/src/main/java/com/hchyun/generator/controller/ApiclassController.java b/hchyun/hchyun-generator/src/main/java/com/hchyun/generator/controller/ApiclassController.java index 04ea16c..6889f06 100644 --- a/hchyun/hchyun-generator/src/main/java/com/hchyun/generator/controller/ApiclassController.java +++ b/hchyun/hchyun-generator/src/main/java/com/hchyun/generator/controller/ApiclassController.java @@ -45,7 +45,7 @@ public class ApiclassController extends HcyBaseController { * * @return */ - @PreAuthorize("@ss.hasAnyPermi('tool:apiclass:querylist')") + @PreAuthorize("@hchyun.hasAnyPermi('tool:apiclass:querylist')") @GetMapping("querylist") public AjaxResult queryList() { try { @@ -64,7 +64,7 @@ public class ApiclassController extends HcyBaseController { /** * 查询接口类名列表 */ - @PreAuthorize("@ss.hasPermi('tool:apiclass:list')") + @PreAuthorize("@hchyun.hasPermi('tool:apiclass:list')") @GetMapping("/list") public Serializable list(Apiclass apiclass) { try { @@ -84,7 +84,7 @@ public class ApiclassController extends HcyBaseController { /** * 导出接口类名列表 */ - @PreAuthorize("@ss.hasPermi('tool:apiclass:export')") + @PreAuthorize("@hchyun.hasPermi('tool:apiclass:export')") @Log(title = "接口类名", businessType = BusinessType.EXPORT) @GetMapping("/export") public AjaxResult export(Apiclass apiclass) { @@ -105,7 +105,7 @@ public class ApiclassController extends HcyBaseController { /** * 获取接口类名详细信息 */ - @PreAuthorize("@ss.hasPermi('tool:apiclass:query')") + @PreAuthorize("@hchyun.hasPermi('tool:apiclass:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { try { @@ -124,7 +124,7 @@ public class ApiclassController extends HcyBaseController { /** * 新增接口类名 */ - @PreAuthorize("@ss.hasPermi('tool:apiclass:add')") + @PreAuthorize("@hchyun.hasPermi('tool:apiclass:add')") @Log(title = "接口类名", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody Apiclass apiclass) { @@ -153,7 +153,7 @@ public class ApiclassController extends HcyBaseController { /** * 修改接口类名 */ - @PreAuthorize("@ss.hasPermi('tool:apiclass:edit')") + @PreAuthorize("@hchyun.hasPermi('tool:apiclass:edit')") @Log(title = "接口类名", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody Apiclass apiclass) { @@ -183,7 +183,7 @@ public class ApiclassController extends HcyBaseController { /** * 删除接口类名 */ - @PreAuthorize("@ss.hasPermi('tool:apiclass:remove')") + @PreAuthorize("@hchyun.hasPermi('tool:apiclass:remove')") @Log(title = "接口类名", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { diff --git a/hchyun/hchyun-generator/src/main/java/com/hchyun/generator/controller/GenController.java b/hchyun/hchyun-generator/src/main/java/com/hchyun/generator/controller/GenController.java index d063540..62234fd 100644 --- a/hchyun/hchyun-generator/src/main/java/com/hchyun/generator/controller/GenController.java +++ b/hchyun/hchyun-generator/src/main/java/com/hchyun/generator/controller/GenController.java @@ -48,7 +48,7 @@ public class GenController extends BaseController { /** * 查询代码生成列表 */ - @PreAuthorize("@ss.hasPermi('tool:gen:list')") + @PreAuthorize("@hchyun.hasPermi('tool:gen:list')") @GetMapping("/list") public TableDataInfo genList(GenTable genTable) { startPage(); @@ -59,7 +59,7 @@ public class GenController extends BaseController { /** * 修改代码生成业务 */ - @PreAuthorize("@ss.hasPermi('tool:gen:query')") + @PreAuthorize("@hchyun.hasPermi('tool:gen:query')") @GetMapping(value = "/{talbleId}") public AjaxResult getInfo(@PathVariable Long talbleId) { GenTable table = genTableService.selectGenTableById(talbleId); @@ -75,7 +75,7 @@ public class GenController extends BaseController { /** * 查询数据库列表 */ - @PreAuthorize("@ss.hasPermi('tool:gen:list')") + @PreAuthorize("@hchyun.hasPermi('tool:gen:list')") @GetMapping("/db/list") public TableDataInfo dataList(GenTable genTable) { startPage(); @@ -86,7 +86,7 @@ public class GenController extends BaseController { /** * 查询数据表字段列表 */ - @PreAuthorize("@ss.hasPermi('tool:gen:list')") + @PreAuthorize("@hchyun.hasPermi('tool:gen:list')") @GetMapping(value = "/column/{talbleId}") public TableDataInfo columnList(Long tableId) { TableDataInfo dataInfo = new TableDataInfo(); @@ -99,7 +99,7 @@ public class GenController extends BaseController { /** * 导入表结构(保存) */ - @PreAuthorize("@ss.hasPermi('tool:gen:list')") + @PreAuthorize("@hchyun.hasPermi('tool:gen:list')") @Log(title = "代码生成", businessType = BusinessType.IMPORT) @PostMapping("/importTable") public AjaxResult importTableSave(String tables) { @@ -114,7 +114,7 @@ public class GenController extends BaseController { * todo * 修改保存代码生成业务 */ - @PreAuthorize("@ss.hasPermi('tool:gen:edit')") + @PreAuthorize("@hchyun.hasPermi('tool:gen:edit')") @Log(title = "代码生成", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult editSave(@Validated @RequestBody GenTable genTable) { @@ -126,7 +126,7 @@ public class GenController extends BaseController { /** * 删除代码生成 */ - @PreAuthorize("@ss.hasPermi('tool:gen:remove')") + @PreAuthorize("@hchyun.hasPermi('tool:gen:remove')") @Log(title = "代码生成", businessType = BusinessType.DELETE) @DeleteMapping("/{tableIds}") public AjaxResult remove(@PathVariable Long[] tableIds) { @@ -146,7 +146,7 @@ public class GenController extends BaseController { /** * 预览代码 */ - @PreAuthorize("@ss.hasPermi('tool:gen:preview')") + @PreAuthorize("@hchyun.hasPermi('tool:gen:preview')") @GetMapping("/preview/{tableId}") public AjaxResult preview(@PathVariable("tableId") Long tableId) throws IOException { Map dataMap = genTableService.previewCode(tableId); @@ -156,7 +156,7 @@ public class GenController extends BaseController { /** * 生成代码(下载方式) */ - @PreAuthorize("@ss.hasPermi('tool:gen:code')") + @PreAuthorize("@hchyun.hasPermi('tool:gen:code')") @Log(title = "代码生成", businessType = BusinessType.GENCODE) @GetMapping("/download/{tableName}") public void download(HttpServletResponse response, @PathVariable("tableName") String tableName) throws IOException { @@ -167,7 +167,7 @@ public class GenController extends BaseController { /** * 生成代码(自定义路径) */ - @PreAuthorize("@ss.hasPermi('tool:gen:code')") + @PreAuthorize("@hchyun.hasPermi('tool:gen:code')") @Log(title = "代码生成", businessType = BusinessType.GENCODE) @GetMapping("/genCode/{tableName}") public AjaxResult genCode(@PathVariable("tableName") String tableName) { @@ -182,7 +182,7 @@ public class GenController extends BaseController { /** * 同步数据库 */ - @PreAuthorize("@ss.hasPermi('tool:gen:edit')") + @PreAuthorize("@hchyun.hasPermi('tool:gen:edit')") @Log(title = "代码生成", businessType = BusinessType.UPDATE) @GetMapping("/synchDb/{tableName}") public AjaxResult synchDb(@PathVariable("tableName") String tableName) { @@ -193,7 +193,7 @@ public class GenController extends BaseController { /** * 批量生成代码 */ - @PreAuthorize("@ss.hasPermi('tool:gen:code')") + @PreAuthorize("@hchyun.hasPermi('tool:gen:code')") @Log(title = "代码生成", businessType = BusinessType.GENCODE) @GetMapping("/batchGenCode") public void batchGenCode(HttpServletResponse response, String tables) throws IOException { diff --git a/hchyun/hchyun-generator/src/main/java/com/hchyun/generator/controller/InterTableController.java b/hchyun/hchyun-generator/src/main/java/com/hchyun/generator/controller/InterTableController.java index 8ffde23..0472892 100644 --- a/hchyun/hchyun-generator/src/main/java/com/hchyun/generator/controller/InterTableController.java +++ b/hchyun/hchyun-generator/src/main/java/com/hchyun/generator/controller/InterTableController.java @@ -59,7 +59,7 @@ public class InterTableController extends HcyBaseController { /** * 查询接口信息列表 */ - @PreAuthorize("@ss.hasPermi('generator:intertable:list')") + @PreAuthorize("@hchyun.hasPermi('generator:intertable:list')") @GetMapping("/list") public Serializable list(InterTable interTable) { try { @@ -80,7 +80,7 @@ public class InterTableController extends HcyBaseController { */ @ApiOperation("预览代码(工作流)") - @PreAuthorize("@ss.hasPermi('generator:intertable:classpreview')") + @PreAuthorize("@hchyun.hasPermi('generator:intertable:classpreview')") @Log(title = "预览代码(工作流)", businessType = BusinessType.GENCODE) @GetMapping("/classpreview/{id}") public AjaxResult classPreview(@PathVariable("id") Long id) { @@ -101,7 +101,7 @@ public class InterTableController extends HcyBaseController { * 预览代码(工作台) */ @ApiOperation("预览代码(工作台)") - @PreAuthorize("@ss.hasPermi('generator:intertable:modulepreview')") + @PreAuthorize("@hchyun.hasPermi('generator:intertable:modulepreview')") @Log(title = "预览代码(工作台)", businessType = BusinessType.GENCODE) @GetMapping("/modulepreview/{id}") public AjaxResult modulePreview(@PathVariable("id") Long id) { @@ -126,7 +126,7 @@ public class InterTableController extends HcyBaseController { * @return */ @ApiOperation("生成代码(工作流)") - @PreAuthorize("@ss.hasPermi('generator:intertable:classgen')") + @PreAuthorize("@hchyun.hasPermi('generator:intertable:classgen')") @Log(title = "生成代码(工作流)", businessType = BusinessType.GENCODE) @GetMapping("/classgen/{id}") public AjaxResult classGenerator(@PathVariable("id") Long id, HttpServletResponse response) { @@ -152,7 +152,7 @@ public class InterTableController extends HcyBaseController { * @return */ @ApiOperation("生成代码(工作台)") - @PreAuthorize("@ss.hasPermi('generator:intertable:moudlegen')") + @PreAuthorize("@hchyun.hasPermi('generator:intertable:moudlegen')") @Log(title = "生成代码(工作台)", businessType = BusinessType.GENCODE) @GetMapping("/moudlegen/{id}") public AjaxResult moudleGenerator(@PathVariable("id") Long id, HttpServletResponse response) { @@ -174,7 +174,7 @@ public class InterTableController extends HcyBaseController { /** * 修改接口信息 */ - @PreAuthorize("@ss.hasPermi('generator:intertable:edit')") + @PreAuthorize("@hchyun.hasPermi('generator:intertable:edit')") @Log(title = "接口信息", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@Validated @RequestBody InterTableDto interTableDto) { @@ -208,7 +208,7 @@ public class InterTableController extends HcyBaseController { // /** // * 导出接口信息列表 // */ -// @PreAuthorize("@ss.hasPermi('generator:intertable:export')") +// @PreAuthorize("@hchyun.hasPermi('generator:intertable:export')") // @Log(title = "接口信息", businessType = BusinessType.EXPORT) // @GetMapping("/export") // public AjaxResult export(InterTable interTable) { @@ -229,7 +229,7 @@ public class InterTableController extends HcyBaseController { // /** // * 获取接口信息详细信息 // */ -// @PreAuthorize("@ss.hasPermi('generator:intertable:query')") +// @PreAuthorize("@hchyun.hasPermi('generator:intertable:query')") // @GetMapping(value = "/{id}") // public AjaxResult Info(@PathVariable("id") Long id) { // try { @@ -248,7 +248,7 @@ public class InterTableController extends HcyBaseController { // /** // * 新增接口信息 // */ -// @PreAuthorize("@ss.hasPermi('generator:intertable:add')") +// @PreAuthorize("@hchyun.hasPermi('generator:intertable:add')") // @Log(title = "接口信息", businessType = BusinessType.INSERT) // @PostMapping // public AjaxResult add(@RequestBody InterTable interTable) { @@ -268,7 +268,7 @@ public class InterTableController extends HcyBaseController { // /** // * 删除接口信息 // */ -// @PreAuthorize("@ss.hasPermi('generator:intertable:remove')") +// @PreAuthorize("@hchyun.hasPermi('generator:intertable:remove')") // @Log(title = "接口信息", businessType = BusinessType.DELETE) // @DeleteMapping("/{ids}") // public AjaxResult remove(@PathVariable Long[] ids) { diff --git a/hchyun/hchyun-generator/src/main/java/com/hchyun/generator/controller/ModuleController.java b/hchyun/hchyun-generator/src/main/java/com/hchyun/generator/controller/ModuleController.java index 966079a..c6acf0f 100644 --- a/hchyun/hchyun-generator/src/main/java/com/hchyun/generator/controller/ModuleController.java +++ b/hchyun/hchyun-generator/src/main/java/com/hchyun/generator/controller/ModuleController.java @@ -46,7 +46,7 @@ public class ModuleController extends HcyBaseController { * * @return */ - @PreAuthorize("@ss.hasAnyPermi('tool:module:querylist')") + @PreAuthorize("@hchyun.hasAnyPermi('tool:module:querylist')") @GetMapping("querylist") public AjaxResult queryList() { try { @@ -66,7 +66,7 @@ public class ModuleController extends HcyBaseController { /** * 查询模块管理列表 */ - @PreAuthorize("@ss.hasPermi('tool:module:list')") + @PreAuthorize("@hchyun.hasPermi('tool:module:list')") @GetMapping("/list") public Serializable list(Module module) { try { @@ -86,7 +86,7 @@ public class ModuleController extends HcyBaseController { /** * 导出模块管理列表 */ - @PreAuthorize("@ss.hasPermi('tool:module:export')") + @PreAuthorize("@hchyun.hasPermi('tool:module:export')") @Log(title = "模块管理", businessType = BusinessType.EXPORT) @GetMapping("/export") public AjaxResult export(Module module) { @@ -107,7 +107,7 @@ public class ModuleController extends HcyBaseController { /** * 获取模块管理详细信息 */ - @PreAuthorize("@ss.hasPermi('tool:module:query')") + @PreAuthorize("@hchyun.hasPermi('tool:module:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { try { @@ -126,7 +126,7 @@ public class ModuleController extends HcyBaseController { /** * 新增模块管理 */ - @PreAuthorize("@ss.hasPermi('tool:module:add')") + @PreAuthorize("@hchyun.hasPermi('tool:module:add')") @Log(title = "模块管理", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody Module module) { @@ -152,7 +152,7 @@ public class ModuleController extends HcyBaseController { /** * 修改模块管理 */ - @PreAuthorize("@ss.hasPermi('tool:module:edit')") + @PreAuthorize("@hchyun.hasPermi('tool:module:edit')") @Log(title = "模块管理", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody Module module) { @@ -179,7 +179,7 @@ public class ModuleController extends HcyBaseController { /** * 删除模块管理 */ - @PreAuthorize("@ss.hasPermi('tool:module:remove')") + @PreAuthorize("@hchyun.hasPermi('tool:module:remove')") @Log(title = "模块管理", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { diff --git a/hchyun/hchyun-generator/src/main/java/com/hchyun/generator/controller/QueryController.java b/hchyun/hchyun-generator/src/main/java/com/hchyun/generator/controller/QueryController.java index 1e83ad2..0e85c47 100644 --- a/hchyun/hchyun-generator/src/main/java/com/hchyun/generator/controller/QueryController.java +++ b/hchyun/hchyun-generator/src/main/java/com/hchyun/generator/controller/QueryController.java @@ -43,7 +43,7 @@ public class QueryController extends BaseController { @ApiOperation("获取查询基本信息") - @PreAuthorize("@ss.hasPermi('query:real:list')") + @PreAuthorize("@hchyun.hasPermi('query:real:list')") @GetMapping("/real/{id}") public AjaxResult RealInfo(@PathVariable("id") Long id) { try { @@ -62,7 +62,7 @@ public class QueryController extends BaseController { } } - @PreAuthorize("@ss.hasAnyPermi('query:real:export')") + @PreAuthorize("@hchyun.hasAnyPermi('query:real:export')") @PutMapping("/real/export") public AjaxResult exportReal(@Validated @RequestBody UniQuery uniQuery) { try { @@ -79,7 +79,7 @@ public class QueryController extends BaseController { } - @PreAuthorize("@ss.hasAnyPermi('query:real:data')") + @PreAuthorize("@hchyun.hasAnyPermi('query:real:data')") @PutMapping("/real") public Serializable RealData(@Validated @RequestBody UniQuery uniQuery) { try { @@ -96,7 +96,7 @@ public class QueryController extends BaseController { } - @PreAuthorize("@ss.hasPermi('query:list')") + @PreAuthorize("@hchyun.hasPermi('query:list')") @GetMapping("/{id}") public AjaxResult Info(@PathVariable("id") Long id) { try { @@ -118,7 +118,7 @@ public class QueryController extends BaseController { } } - @PreAuthorize("@ss.hasPermi('query:edit')") + @PreAuthorize("@hchyun.hasPermi('query:edit')") @PutMapping public AjaxResult edit(@Validated @RequestBody UniQuery uniQuery) { try { @@ -134,7 +134,7 @@ public class QueryController extends BaseController { } } - @PreAuthorize("@ss.hasAnyPermi('query:export')") + @PreAuthorize("@hchyun.hasAnyPermi('query:export')") @PutMapping("export") public AjaxResult export(@Validated @RequestBody UniQuery uniQuery) { try { @@ -150,7 +150,7 @@ public class QueryController extends BaseController { } } - @PreAuthorize("@ss.hasPermi('query:preview')") + @PreAuthorize("@hchyun.hasPermi('query:preview')") @PutMapping("preview") public Serializable Preview(@Validated @RequestBody UniQuery uniQuery) { try { diff --git a/hchyun/hchyun-generator/src/main/java/com/hchyun/generator/controller/UniQueryController.java b/hchyun/hchyun-generator/src/main/java/com/hchyun/generator/controller/UniQueryController.java index b9440e0..c6afccc 100644 --- a/hchyun/hchyun-generator/src/main/java/com/hchyun/generator/controller/UniQueryController.java +++ b/hchyun/hchyun-generator/src/main/java/com/hchyun/generator/controller/UniQueryController.java @@ -57,7 +57,7 @@ public class UniQueryController extends BaseController { * 查询万能查询列表 */ @ApiOperation("查询万能查询列表") - @PreAuthorize("@ss.hasPermi('tool:query:list')") + @PreAuthorize("@hchyun.hasPermi('tool:query:list')") @GetMapping("/list") public Serializable list(UniQuery uniQuery) { try { @@ -78,7 +78,7 @@ public class UniQueryController extends BaseController { * 导出万能查询列表 */ @ApiOperation("导出万能查询列表") - @PreAuthorize("@ss.hasPermi('tool:query:export')") + @PreAuthorize("@hchyun.hasPermi('tool:query:export')") @Log(title = "万能查询", businessType = BusinessType.EXPORT) @GetMapping("/export") public AjaxResult export(UniQuery uniQuery) { @@ -101,7 +101,7 @@ public class UniQueryController extends BaseController { */ @ApiOperation("获取万能查询详细信息") @ApiImplicitParam(name = "id", value = "万能查询id", required = true, dataType = "Long", paramType = "path") - @PreAuthorize("@ss.hasPermi('tool:query:query')") + @PreAuthorize("@hchyun.hasPermi('tool:query:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { try { @@ -122,7 +122,7 @@ public class UniQueryController extends BaseController { */ @ApiOperation("新增万能查询") @ApiImplicitParam(name = "uniQuery", value = "新增万能查询信息", dataType = "UniQuery") - @PreAuthorize("@ss.hasPermi('tool:query:add')") + @PreAuthorize("@hchyun.hasPermi('tool:query:add')") @Log(title = "万能查询", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody UniQuery uniQuery) { @@ -150,7 +150,7 @@ public class UniQueryController extends BaseController { */ @ApiOperation("修改万能查询") @ApiImplicitParam(name = "uniQuery", value = "修改万能查询信息", dataType = "UniQuery") - @PreAuthorize("@ss.hasPermi('tool:query:edit')") + @PreAuthorize("@hchyun.hasPermi('tool:query:edit')") @Log(title = "万能查询", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody UniQuery uniQuery) { @@ -179,7 +179,7 @@ public class UniQueryController extends BaseController { */ @ApiOperation("删除万能查询") @ApiImplicitParam(name = "ids", value = "万能查询ids", required = true, dataType = "Long", paramType = "path") - @PreAuthorize("@ss.hasPermi('tool:query:remove')") + @PreAuthorize("@hchyun.hasPermi('tool:query:remove')") @Log(title = "万能查询", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { diff --git a/hchyun/hchyun-generator/src/main/resources/vm/java/class.java.vm b/hchyun/hchyun-generator/src/main/resources/vm/java/class.java.vm index 80ad713..e3a4a5e 100644 --- a/hchyun/hchyun-generator/src/main/resources/vm/java/class.java.vm +++ b/hchyun/hchyun-generator/src/main/resources/vm/java/class.java.vm @@ -45,7 +45,7 @@ public class ${ClassName}Controller extends BaseController{ */ @ApiOperation("${column.itDescribe}") #if($column.isPermission.equals("1")) - @PreAuthorize("@ss.hasPermi('${prefix}:${column.requrl}')") + @PreAuthorize("@hchyun.hasPermi('${prefix}:${column.requrl}')") @Log(title = "${column.itDescribe}", businessType = BusinessType.INSERT) #end @${column.method}Mapping("/${column.requrl}") diff --git a/hchyun/hchyun-generator/src/main/resources/vm/java/controller.java.vm b/hchyun/hchyun-generator/src/main/resources/vm/java/controller.java.vm index 285c3c4..983af71 100644 --- a/hchyun/hchyun-generator/src/main/resources/vm/java/controller.java.vm +++ b/hchyun/hchyun-generator/src/main/resources/vm/java/controller.java.vm @@ -56,7 +56,7 @@ public class ${ClassName}Controller extends HcyBaseController { * 查询${functionName}列表 */ @ApiOperation("查询${functionName}列表") - @PreAuthorize("@ss.hasPermi('${permissionPrefix}:list')") + @PreAuthorize("@hchyun.hasPermi('${permissionPrefix}:list')") @PutMapping("/list") public Serializable list(@Validated @RequestBody ${ClassName} ${className}) { try { @@ -81,7 +81,7 @@ public class ${ClassName}Controller extends HcyBaseController { * 导出${functionName}列表 */ @ApiOperation("导出${functionName}列表") - @PreAuthorize("@ss.hasPermi('${permissionPrefix}:export')") + @PreAuthorize("@hchyun.hasPermi('${permissionPrefix}:export')") @Log(title = "${functionName}", businessType = BusinessType.EXPORT) @PutMapping("/export") public AjaxResult export(@Validated @RequestBody ${ClassName} ${className}) { @@ -104,7 +104,7 @@ public class ${ClassName}Controller extends HcyBaseController { */ @ApiOperation("获取${functionName}详细信息") @ApiImplicitParam(name = "${pkColumn.javaField}" , value = "${functionName}${pkColumn.javaField}" , required = true, dataType = "${pkColumn.javaType}" , paramType = "path") - @PreAuthorize("@ss.hasPermi('${permissionPrefix}:query')") + @PreAuthorize("@hchyun.hasPermi('${permissionPrefix}:query')") @GetMapping(value = "/{${pkColumn.javaField}}") public AjaxResult getInfo(@PathVariable("${pkColumn.javaField}") ${pkColumn.javaType} ${pkColumn.javaField}) { try { @@ -125,7 +125,7 @@ public class ${ClassName}Controller extends HcyBaseController { */ @ApiOperation("新增${functionName}") @ApiImplicitParam(name = "${className}" , value = "新增${functionName}信息" , dataType = "${ClassName}") - @PreAuthorize("@ss.hasPermi('${permissionPrefix}:add')") + @PreAuthorize("@hchyun.hasPermi('${permissionPrefix}:add')") @Log(title = "${functionName}", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody ${ClassName} ${className}) { @@ -168,7 +168,7 @@ public class ${ClassName}Controller extends HcyBaseController { */ @ApiOperation("修改${functionName}") @ApiImplicitParam(name = "${className}" , value = "修改${functionName}信息" , dataType = "${ClassName}") - @PreAuthorize("@ss.hasPermi('${permissionPrefix}:edit')") + @PreAuthorize("@hchyun.hasPermi('${permissionPrefix}:edit')") @Log(title = "${functionName}", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody ${ClassName} ${className}) { @@ -212,7 +212,7 @@ public class ${ClassName}Controller extends HcyBaseController { */ @ApiOperation("删除${functionName}") @ApiImplicitParam(name = "${pkColumn.javaField}s" , value = "${functionName}${pkColumn.javaField}s" , required = true, dataType = "${pkColumn.javaType}" , paramType = "path") - @PreAuthorize("@ss.hasPermi('${permissionPrefix}:remove')") + @PreAuthorize("@hchyun.hasPermi('${permissionPrefix}:remove')") @Log(title = "${functionName}", businessType = BusinessType.DELETE) @DeleteMapping("/{${pkColumn.javaField}s}") public AjaxResult remove(@PathVariable ${pkColumn.javaType}[] ${pkColumn.javaField}s) { diff --git a/hchyun/hchyun-quartz/src/main/java/com/hchyun/quartz/controller/SysJobController.java b/hchyun/hchyun-quartz/src/main/java/com/hchyun/quartz/controller/SysJobController.java index 16f1404..d2f1574 100644 --- a/hchyun/hchyun-quartz/src/main/java/com/hchyun/quartz/controller/SysJobController.java +++ b/hchyun/hchyun-quartz/src/main/java/com/hchyun/quartz/controller/SysJobController.java @@ -39,7 +39,7 @@ public class SysJobController extends BaseController { /** * 查询定时任务列表 */ - @PreAuthorize("@ss.hasPermi('monitor:job:list')") + @PreAuthorize("@hchyun.hasPermi('monitor:job:list')") @GetMapping("/list") public TableDataInfo list(SysJob sysJob) { startPage(); @@ -50,7 +50,7 @@ public class SysJobController extends BaseController { /** * 导出定时任务列表 */ - @PreAuthorize("@ss.hasPermi('monitor:job:export')") + @PreAuthorize("@hchyun.hasPermi('monitor:job:export')") @Log(title = "定时任务", businessType = BusinessType.EXPORT) @GetMapping("/export") public AjaxResult export(SysJob sysJob) { @@ -62,7 +62,7 @@ public class SysJobController extends BaseController { /** * 获取定时任务详细信息 */ - @PreAuthorize("@ss.hasPermi('monitor:job:query')") + @PreAuthorize("@hchyun.hasPermi('monitor:job:query')") @GetMapping(value = "/{jobId}") public AjaxResult getInfo(@PathVariable("jobId") Long jobId) { return AjaxResult.success(jobService.selectJobById(jobId)); @@ -71,7 +71,7 @@ public class SysJobController extends BaseController { /** * 新增定时任务 */ - @PreAuthorize("@ss.hasPermi('monitor:job:add')") + @PreAuthorize("@hchyun.hasPermi('monitor:job:add')") @Log(title = "定时任务", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody SysJob sysJob) throws SchedulerException, TaskException { @@ -85,7 +85,7 @@ public class SysJobController extends BaseController { /** * 修改定时任务 */ - @PreAuthorize("@ss.hasPermi('monitor:job:edit')") + @PreAuthorize("@hchyun.hasPermi('monitor:job:edit')") @Log(title = "定时任务", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody SysJob sysJob) throws SchedulerException, TaskException { @@ -99,7 +99,7 @@ public class SysJobController extends BaseController { /** * 定时任务状态修改 */ - @PreAuthorize("@ss.hasPermi('monitor:job:changeStatus')") + @PreAuthorize("@hchyun.hasPermi('monitor:job:changeStatus')") @Log(title = "定时任务", businessType = BusinessType.UPDATE) @PutMapping("/changeStatus") public AjaxResult changeStatus(@RequestBody SysJob job) throws SchedulerException { @@ -111,7 +111,7 @@ public class SysJobController extends BaseController { /** * 定时任务立即执行一次 */ - @PreAuthorize("@ss.hasPermi('monitor:job:changeStatus')") + @PreAuthorize("@hchyun.hasPermi('monitor:job:changeStatus')") @Log(title = "定时任务", businessType = BusinessType.UPDATE) @PutMapping("/run") public AjaxResult run(@RequestBody SysJob job) throws SchedulerException { @@ -122,7 +122,7 @@ public class SysJobController extends BaseController { /** * 删除定时任务 */ - @PreAuthorize("@ss.hasPermi('monitor:job:remove')") + @PreAuthorize("@hchyun.hasPermi('monitor:job:remove')") @Log(title = "定时任务", businessType = BusinessType.DELETE) @DeleteMapping("/{jobIds}") public AjaxResult remove(@PathVariable Long[] jobIds) throws SchedulerException, TaskException { diff --git a/hchyun/hchyun-quartz/src/main/java/com/hchyun/quartz/controller/SysJobLogController.java b/hchyun/hchyun-quartz/src/main/java/com/hchyun/quartz/controller/SysJobLogController.java index 0cccc10..ef1c781 100644 --- a/hchyun/hchyun-quartz/src/main/java/com/hchyun/quartz/controller/SysJobLogController.java +++ b/hchyun/hchyun-quartz/src/main/java/com/hchyun/quartz/controller/SysJobLogController.java @@ -32,7 +32,7 @@ public class SysJobLogController extends BaseController { /** * 查询定时任务调度日志列表 */ - @PreAuthorize("@ss.hasPermi('monitor:job:list')") + @PreAuthorize("@hchyun.hasPermi('monitor:job:list')") @GetMapping("/list") public TableDataInfo list(SysJobLog sysJobLog) { startPage(); @@ -43,7 +43,7 @@ public class SysJobLogController extends BaseController { /** * 导出定时任务调度日志列表 */ - @PreAuthorize("@ss.hasPermi('monitor:job:export')") + @PreAuthorize("@hchyun.hasPermi('monitor:job:export')") @Log(title = "任务调度日志", businessType = BusinessType.EXPORT) @GetMapping("/export") public AjaxResult export(SysJobLog sysJobLog) { @@ -55,7 +55,7 @@ public class SysJobLogController extends BaseController { /** * 根据调度编号获取详细信息 */ - @PreAuthorize("@ss.hasPermi('monitor:job:query')") + @PreAuthorize("@hchyun.hasPermi('monitor:job:query')") @GetMapping(value = "/{configId}") public AjaxResult getInfo(@PathVariable Long jobLogId) { return AjaxResult.success(jobLogService.selectJobLogById(jobLogId)); @@ -65,7 +65,7 @@ public class SysJobLogController extends BaseController { /** * 删除定时任务调度日志 */ - @PreAuthorize("@ss.hasPermi('monitor:job:remove')") + @PreAuthorize("@hchyun.hasPermi('monitor:job:remove')") @Log(title = "定时任务调度日志", businessType = BusinessType.DELETE) @DeleteMapping("/{jobLogIds}") public AjaxResult remove(@PathVariable Long[] jobLogIds) { @@ -75,7 +75,7 @@ public class SysJobLogController extends BaseController { /** * 清空定时任务调度日志 */ - @PreAuthorize("@ss.hasPermi('monitor:job:remove')") + @PreAuthorize("@hchyun.hasPermi('monitor:job:remove')") @Log(title = "调度日志", businessType = BusinessType.CLEAN) @DeleteMapping("/clean") public AjaxResult clean() { diff --git a/hchyun/hchyun-system/pom.xml b/hchyun/hchyun-system/pom.xml index 974bfca..560ad58 100644 --- a/hchyun/hchyun-system/pom.xml +++ b/hchyun/hchyun-system/pom.xml @@ -22,11 +22,6 @@ com.hchyun hchyun-common - - commons-net - commons-net - 3.7 - diff --git a/hchyun/hchyun-system/src/main/java/com/hchyun/system/service/FileService.java b/hchyun/hchyun-system/src/main/java/com/hchyun/system/service/FileService.java index cb61650..0ec03bd 100644 --- a/hchyun/hchyun-system/src/main/java/com/hchyun/system/service/FileService.java +++ b/hchyun/hchyun-system/src/main/java/com/hchyun/system/service/FileService.java @@ -2,9 +2,12 @@ package com.hchyun.system.service; import java.util.List; +import com.hchyun.common.core.entity.model.LoginUser; import com.hchyun.common.utils.ServerResult; import com.hchyun.system.entity.SysFile; +import javax.servlet.http.HttpServletRequest; + /** * 文件信息Service接口 * @@ -64,8 +67,9 @@ public interface FileService { * 下载指定文件 * * @param fileId + * @param loginUser * @return */ - ServerResult downloadFile(Long fileId); + ServerResult downloadFile(Long fileId, LoginUser loginUser); } diff --git a/hchyun/hchyun-system/src/main/java/com/hchyun/system/service/impl/FileServiceImpl.java b/hchyun/hchyun-system/src/main/java/com/hchyun/system/service/impl/FileServiceImpl.java index 6dc56de..2f3b8c6 100644 --- a/hchyun/hchyun-system/src/main/java/com/hchyun/system/service/impl/FileServiceImpl.java +++ b/hchyun/hchyun-system/src/main/java/com/hchyun/system/service/impl/FileServiceImpl.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.List; import com.hchyun.common.constant.ReturnConstants; +import com.hchyun.common.core.entity.model.LoginUser; import com.hchyun.common.utils.SecurityUtils; import com.hchyun.common.utils.ServerResult; import com.hchyun.system.entity.SysFile; @@ -28,6 +29,7 @@ public class FileServiceImpl implements FileService { @Autowired private FileDao fileDao; + /** * 查询文件信息 * @@ -149,7 +151,7 @@ public class FileServiceImpl implements FileService { } @Override - public ServerResult downloadFile(Long fileId) { + public ServerResult downloadFile(Long fileId, LoginUser loginUser) { try { SysFile sysFile = fileDao.selectFileById(fileId); String fileName = FtpUtils.downloadFile(sysFile); diff --git a/hchyun/hchyun-test/src/main/java/com/hchyun/test/controller/AssFatherController.java b/hchyun/hchyun-test/src/main/java/com/hchyun/test/controller/AssFatherController.java index c18c9f1..cf4b630 100644 --- a/hchyun/hchyun-test/src/main/java/com/hchyun/test/controller/AssFatherController.java +++ b/hchyun/hchyun-test/src/main/java/com/hchyun/test/controller/AssFatherController.java @@ -51,7 +51,7 @@ public class AssFatherController extends HcyBaseController { * 查询关联查询父列表 */ @ApiOperation("查询关联查询父列表") - @PreAuthorize("@ss.hasPermi('test:father:list')") + @PreAuthorize("@hchyun.hasPermi('test:father:list')") @PutMapping("/list") public Serializable list(@Validated @RequestBody AssFather assFather) { try { @@ -72,7 +72,7 @@ public class AssFatherController extends HcyBaseController { * 导出关联查询父列表 */ @ApiOperation("导出关联查询父列表") - @PreAuthorize("@ss.hasPermi('test:father:export')") + @PreAuthorize("@hchyun.hasPermi('test:father:export')") @Log(title = "关联查询父", businessType = BusinessType.EXPORT) @PutMapping("/export") public AjaxResult export(@Validated @RequestBody AssFather assFather) { @@ -95,7 +95,7 @@ public class AssFatherController extends HcyBaseController { */ @ApiOperation("获取关联查询父详细信息") @ApiImplicitParam(name = "id", value = "关联查询父id", required = true, dataType = "Long", paramType = "path") - @PreAuthorize("@ss.hasPermi('test:father:query')") + @PreAuthorize("@hchyun.hasPermi('test:father:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { try { @@ -116,7 +116,7 @@ public class AssFatherController extends HcyBaseController { */ @ApiOperation("新增关联查询父") @ApiImplicitParam(name = "assFather", value = "新增关联查询父信息", dataType = "AssFather") - @PreAuthorize("@ss.hasPermi('test:father:add')") + @PreAuthorize("@hchyun.hasPermi('test:father:add')") @Log(title = "关联查询父", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody AssFather assFather) { @@ -144,7 +144,7 @@ public class AssFatherController extends HcyBaseController { */ @ApiOperation("修改关联查询父") @ApiImplicitParam(name = "assFather", value = "修改关联查询父信息", dataType = "AssFather") - @PreAuthorize("@ss.hasPermi('test:father:edit')") + @PreAuthorize("@hchyun.hasPermi('test:father:edit')") @Log(title = "关联查询父", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody AssFather assFather) { @@ -173,7 +173,7 @@ public class AssFatherController extends HcyBaseController { */ @ApiOperation("删除关联查询父") @ApiImplicitParam(name = "ids", value = "关联查询父ids", required = true, dataType = "Long", paramType = "path") - @PreAuthorize("@ss.hasPermi('test:father:remove')") + @PreAuthorize("@hchyun.hasPermi('test:father:remove')") @Log(title = "关联查询父", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { diff --git a/hchyun/hchyun-test/src/main/java/com/hchyun/test/controller/ResultsController.java b/hchyun/hchyun-test/src/main/java/com/hchyun/test/controller/ResultsController.java index aa6c666..80bcdaf 100644 --- a/hchyun/hchyun-test/src/main/java/com/hchyun/test/controller/ResultsController.java +++ b/hchyun/hchyun-test/src/main/java/com/hchyun/test/controller/ResultsController.java @@ -48,7 +48,7 @@ public class ResultsController extends HcyBaseController { * 查询成绩列表 */ @ApiOperation("查询成绩列表") - @PreAuthorize("@ss.hasPermi('test:results:list')") + @PreAuthorize("@hchyun.hasPermi('test:results:list')") @GetMapping("/list") public Serializable list(Results results) { try { @@ -69,7 +69,7 @@ public class ResultsController extends HcyBaseController { * 导出成绩列表 */ @ApiOperation("导出成绩列表") - @PreAuthorize("@ss.hasPermi('test:results:export')") + @PreAuthorize("@hchyun.hasPermi('test:results:export')") @Log(title = "成绩", businessType = BusinessType.EXPORT) @GetMapping("/export") public AjaxResult export(Results results) { @@ -93,7 +93,7 @@ public class ResultsController extends HcyBaseController { */ @ApiOperation("获取成绩详细信息") @ApiImplicitParam(name = "id", value = "成绩id", required = true, dataType = "Long", paramType = "path") - @PreAuthorize("@ss.hasPermi('test:results:query')") + @PreAuthorize("@hchyun.hasPermi('test:results:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { try { @@ -114,7 +114,7 @@ public class ResultsController extends HcyBaseController { */ @ApiOperation("新增成绩") @ApiImplicitParam(name = "results", value = "新增成绩信息", dataType = "Results") - @PreAuthorize("@ss.hasPermi('test:results:add')") + @PreAuthorize("@hchyun.hasPermi('test:results:add')") @Log(title = "成绩", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody Results results) { @@ -145,7 +145,7 @@ public class ResultsController extends HcyBaseController { */ @ApiOperation("修改成绩") @ApiImplicitParam(name = "results", value = "修改成绩信息", dataType = "Results") - @PreAuthorize("@ss.hasPermi('test:results:edit')") + @PreAuthorize("@hchyun.hasPermi('test:results:edit')") @Log(title = "成绩", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody Results results) { @@ -178,7 +178,7 @@ public class ResultsController extends HcyBaseController { */ @ApiOperation("删除成绩") @ApiImplicitParam(name = "ids", value = "成绩ids", required = true, dataType = "Long", paramType = "path") - @PreAuthorize("@ss.hasPermi('test:results:remove')") + @PreAuthorize("@hchyun.hasPermi('test:results:remove')") @Log(title = "成绩", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { diff --git a/hchyun/hchyun-test/src/main/java/com/hchyun/test/controller/StuController.java b/hchyun/hchyun-test/src/main/java/com/hchyun/test/controller/StuController.java index b5122a5..306414b 100644 --- a/hchyun/hchyun-test/src/main/java/com/hchyun/test/controller/StuController.java +++ b/hchyun/hchyun-test/src/main/java/com/hchyun/test/controller/StuController.java @@ -45,7 +45,7 @@ public class StuController extends HcyBaseController { /** * 查询学生列表 */ - @PreAuthorize("@ss.hasPermi('test:stu:list')") + @PreAuthorize("@hchyun.hasPermi('test:stu:list')") @GetMapping("/list") public Serializable list(Stu stu) { try { @@ -65,7 +65,7 @@ public class StuController extends HcyBaseController { /** * 导出学生列表 */ - @PreAuthorize("@ss.hasPermi('test:stu:export')") + @PreAuthorize("@hchyun.hasPermi('test:stu:export')") @Log(title = "学生", businessType = BusinessType.EXPORT) @GetMapping("/export") public AjaxResult export(Stu stu) { @@ -86,7 +86,7 @@ public class StuController extends HcyBaseController { /** * 获取学生详细信息 */ - @PreAuthorize("@ss.hasPermi('test:stu:query')") + @PreAuthorize("@hchyun.hasPermi('test:stu:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { try { @@ -105,7 +105,7 @@ public class StuController extends HcyBaseController { /** * 新增学生 */ - @PreAuthorize("@ss.hasPermi('test:stu:add')") + @PreAuthorize("@hchyun.hasPermi('test:stu:add')") @Log(title = "学生", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody Stu stu) { @@ -140,7 +140,7 @@ public class StuController extends HcyBaseController { /** * 修改学生 */ - @PreAuthorize("@ss.hasPermi('test:stu:edit')") + @PreAuthorize("@hchyun.hasPermi('test:stu:edit')") @Log(title = "学生", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody Stu stu) { @@ -176,7 +176,7 @@ public class StuController extends HcyBaseController { /** * 删除学生 */ - @PreAuthorize("@ss.hasPermi('test:stu:remove')") + @PreAuthorize("@hchyun.hasPermi('test:stu:remove')") @Log(title = "学生", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { diff --git a/hchyun/hchyun-test/src/main/java/com/hchyun/test/controller/TestTreeController.java b/hchyun/hchyun-test/src/main/java/com/hchyun/test/controller/TestTreeController.java index fe2c72c..e169a9a 100644 --- a/hchyun/hchyun-test/src/main/java/com/hchyun/test/controller/TestTreeController.java +++ b/hchyun/hchyun-test/src/main/java/com/hchyun/test/controller/TestTreeController.java @@ -44,7 +44,7 @@ public class TestTreeController extends HcyBaseController { /** * 查询树测试列表 */ - @PreAuthorize("@ss.hasPermi('test:tree:list')") + @PreAuthorize("@hchyun.hasPermi('test:tree:list')") @GetMapping("/list") public AjaxResult list(TestTree testTree) { ServerResult> serverResult = testTreeService.selectTestTreeList(testTree); @@ -54,7 +54,7 @@ public class TestTreeController extends HcyBaseController { /** * 导出树测试列表 */ - @PreAuthorize("@ss.hasPermi('test:tree:export')") + @PreAuthorize("@hchyun.hasPermi('test:tree:export')") @Log(title = "树测试", businessType = BusinessType.EXPORT) @GetMapping("/export") public AjaxResult export(TestTree testTree) { @@ -75,7 +75,7 @@ public class TestTreeController extends HcyBaseController { /** * 获取树测试详细信息 */ - @PreAuthorize("@ss.hasPermi('test:tree:query')") + @PreAuthorize("@hchyun.hasPermi('test:tree:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { try { @@ -94,7 +94,7 @@ public class TestTreeController extends HcyBaseController { /** * 新增树测试 */ - @PreAuthorize("@ss.hasPermi('test:tree:add')") + @PreAuthorize("@hchyun.hasPermi('test:tree:add')") @Log(title = "树测试", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody TestTree testTree) { @@ -117,7 +117,7 @@ public class TestTreeController extends HcyBaseController { /** * 修改树测试 */ - @PreAuthorize("@ss.hasPermi('test:tree:edit')") + @PreAuthorize("@hchyun.hasPermi('test:tree:edit')") @Log(title = "树测试", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody TestTree testTree) { @@ -141,7 +141,7 @@ public class TestTreeController extends HcyBaseController { /** * 删除树测试 */ - @PreAuthorize("@ss.hasPermi('test:tree:remove')") + @PreAuthorize("@hchyun.hasPermi('test:tree:remove')") @Log(title = "树测试", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) {