From 4a69bb4a523f08a2be5a4bc96ef4bfbe5cfe8095 Mon Sep 17 00:00:00 2001 From: ZhengJie <201507802@qq.com> Date: Sun, 11 Oct 2020 15:09:19 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96](v2.6)?= =?UTF-8?q?=EF=BC=9A=E6=97=A5=E5=BF=97=E8=AF=B7=E6=B1=82=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E4=BC=98=E5=8C=96=EF=BC=8C=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/me/zhengjie/config/RedisConfig.java | 3 +- .../main/java/me/zhengjie/annotation/Log.java | 11 ---- .../annotation/type/LogActionType.java | 45 ---------------- .../zhengjie/service/impl/LogServiceImpl.java | 51 +++++++++++++------ .../modules/mnt/rest/AppController.java | 2 - .../modules/mnt/rest/DatabaseController.java | 2 - .../modules/mnt/rest/DeployController.java | 2 - .../mnt/rest/DeployHistoryController.java | 2 - .../mnt/rest/ServerDeployController.java | 2 - .../quartz/rest/QuartzJobController.java | 3 -- .../rest/AuthorizationController.java | 1 - .../security/rest/OnlineController.java | 2 - .../security/service/dto/AuthUserDto.java | 6 --- .../modules/system/rest/DeptController.java | 3 -- .../modules/system/rest/DictController.java | 3 -- .../system/rest/DictDetailController.java | 2 - .../modules/system/rest/JobController.java | 2 - .../modules/system/rest/MenuController.java | 5 +- .../modules/system/rest/RoleController.java | 2 - .../modules/system/rest/UserController.java | 2 - .../zhengjie/rest/LocalStorageController.java | 7 +-- .../me/zhengjie/rest/QiniuController.java | 2 - 22 files changed, 40 insertions(+), 120 deletions(-) delete mode 100644 eladmin-logging/src/main/java/me/zhengjie/annotation/type/LogActionType.java diff --git a/eladmin-common/src/main/java/me/zhengjie/config/RedisConfig.java b/eladmin-common/src/main/java/me/zhengjie/config/RedisConfig.java index e9ed0750..df7aeb33 100644 --- a/eladmin-common/src/main/java/me/zhengjie/config/RedisConfig.java +++ b/eladmin-common/src/main/java/me/zhengjie/config/RedisConfig.java @@ -64,7 +64,8 @@ public class RedisConfig extends CachingConfigurerSupport { public RedisCacheConfiguration redisCacheConfiguration(){ FastJsonRedisSerializer fastJsonRedisSerializer = new FastJsonRedisSerializer<>(Object.class); RedisCacheConfiguration configuration = RedisCacheConfiguration.defaultCacheConfig(); - configuration = configuration.serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(fastJsonRedisSerializer)).entryTtl(Duration.ofHours(2)); + configuration = configuration.serializeValuesWith(RedisSerializationContext. + SerializationPair.fromSerializer(fastJsonRedisSerializer)).entryTtl(Duration.ofHours(6)); return configuration; } diff --git a/eladmin-logging/src/main/java/me/zhengjie/annotation/Log.java b/eladmin-logging/src/main/java/me/zhengjie/annotation/Log.java index a050187d..6c001cd3 100644 --- a/eladmin-logging/src/main/java/me/zhengjie/annotation/Log.java +++ b/eladmin-logging/src/main/java/me/zhengjie/annotation/Log.java @@ -15,8 +15,6 @@ */ package me.zhengjie.annotation; -import me.zhengjie.annotation.type.LogActionType; - import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @@ -30,13 +28,4 @@ import java.lang.annotation.Target; @Retention(RetentionPolicy.RUNTIME) public @interface Log { String value() default ""; - - /** - * 是否启用 - * - * @return - */ - boolean enable() default true; - - LogActionType type() default LogActionType.SELECT; } diff --git a/eladmin-logging/src/main/java/me/zhengjie/annotation/type/LogActionType.java b/eladmin-logging/src/main/java/me/zhengjie/annotation/type/LogActionType.java deleted file mode 100644 index 26549177..00000000 --- a/eladmin-logging/src/main/java/me/zhengjie/annotation/type/LogActionType.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2019-2020 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package me.zhengjie.annotation.type; - -/** - * @author: liaojinlong - * @date: 2020/6/11 19:47 - * @apiNote: 日志类型 - */ - -public enum LogActionType { - /** - * 增删改查 - */ - ADD("新增"), - SELECT("查询"), - UPDATE("更新"), - DELETE("删除"); - private String value; - - LogActionType(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } -} diff --git a/eladmin-logging/src/main/java/me/zhengjie/service/impl/LogServiceImpl.java b/eladmin-logging/src/main/java/me/zhengjie/service/impl/LogServiceImpl.java index e30f4237..b0c2554c 100644 --- a/eladmin-logging/src/main/java/me/zhengjie/service/impl/LogServiceImpl.java +++ b/eladmin-logging/src/main/java/me/zhengjie/service/impl/LogServiceImpl.java @@ -18,6 +18,7 @@ package me.zhengjie.service.impl; import cn.hutool.core.lang.Dict; import cn.hutool.core.util.ObjectUtil; import cn.hutool.json.JSONObject; +import cn.hutool.json.JSONUtil; import lombok.RequiredArgsConstructor; import me.zhengjie.domain.Log; import me.zhengjie.repository.LogRepository; @@ -34,10 +35,13 @@ import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.lang.reflect.Method; +import java.lang.reflect.Parameter; import java.util.*; /** @@ -84,13 +88,6 @@ public class LogServiceImpl implements LogService { // 方法路径 String methodName = joinPoint.getTarget().getClass().getName() + "." + signature.getName() + "()"; - StringBuilder params = new StringBuilder("{"); - //参数值 - List argValues = new ArrayList<>(Arrays.asList(joinPoint.getArgs())); - //参数名称 - for (Object argValue : argValues) { - params.append(argValue).append(" "); - } // 描述 if (log != null) { log.setDescription(aopLog.value()); @@ -98,22 +95,44 @@ public class LogServiceImpl implements LogService { assert log != null; log.setRequestIp(ip); - String loginPath = "login"; - if (loginPath.equals(signature.getName())) { - try { - username = new JSONObject(argValues.get(0)).get("username").toString(); - } catch (Exception e) { - LogServiceImpl.log.error(e.getMessage(), e); - } - } log.setAddress(StringUtils.getCityInfo(log.getRequestIp())); log.setMethod(methodName); log.setUsername(username); - log.setParams(params.toString() + " }"); + log.setParams(getParameter(method, joinPoint.getArgs())); log.setBrowser(browser); logRepository.save(log); } + /** + * 根据方法和传入的参数获取请求参数 + */ + private String getParameter(Method method, Object[] args) { + List argList = new ArrayList<>(); + Parameter[] parameters = method.getParameters(); + for (int i = 0; i < parameters.length; i++) { + //将RequestBody注解修饰的参数作为请求参数 + RequestBody requestBody = parameters[i].getAnnotation(RequestBody.class); + if (requestBody != null) { + argList.add(args[i]); + } + //将RequestParam注解修饰的参数作为请求参数 + RequestParam requestParam = parameters[i].getAnnotation(RequestParam.class); + if (requestParam != null) { + Map map = new HashMap<>(); + String key = parameters[i].getName(); + if (!StringUtils.isEmpty(requestParam.value())) { + key = requestParam.value(); + } + map.put(key, args[i]); + argList.add(map); + } + } + if (argList.size() == 0) { + return ""; + } + return argList.size() == 1 ? JSONUtil.toJsonStr(argList.get(0)) : JSONUtil.toJsonStr(argList); + } + @Override public Object findByErrDetail(Long id) { Log log = logRepository.findById(id).orElseGet(Log::new); diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/AppController.java b/eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/AppController.java index 77d23311..9b5b08fa 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/AppController.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/AppController.java @@ -44,7 +44,6 @@ public class AppController { private final AppService appService; - @Log("导出应用数据") @ApiOperation("导出应用数据") @GetMapping(value = "/download") @PreAuthorize("@el.check('app:list')") @@ -52,7 +51,6 @@ public class AppController { appService.download(appService.queryAll(criteria), response); } - @Log("查询应用") @ApiOperation(value = "查询应用") @GetMapping @PreAuthorize("@el.check('app:list')") diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/DatabaseController.java b/eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/DatabaseController.java index ff844e31..9dfb43cc 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/DatabaseController.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/DatabaseController.java @@ -52,7 +52,6 @@ public class DatabaseController { private final String fileSavePath = FileUtil.getTmpDirPath()+"/"; private final DatabaseService databaseService; - @Log("导出数据库数据") @ApiOperation("导出数据库数据") @GetMapping(value = "/download") @PreAuthorize("@el.check('database:list')") @@ -60,7 +59,6 @@ public class DatabaseController { databaseService.download(databaseService.queryAll(criteria), response); } - @Log("查询数据库") @ApiOperation(value = "查询数据库") @GetMapping @PreAuthorize("@el.check('database:list')") diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/DeployController.java b/eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/DeployController.java index 5ea3bf26..72b7b3e1 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/DeployController.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/DeployController.java @@ -54,7 +54,6 @@ public class DeployController { private final DeployService deployService; - @Log("导出部署数据") @ApiOperation("导出部署数据") @GetMapping(value = "/download") @PreAuthorize("@el.check('database:list')") @@ -62,7 +61,6 @@ public class DeployController { deployService.download(deployService.queryAll(criteria), response); } - @Log("查询部署") @ApiOperation(value = "查询部署") @GetMapping @PreAuthorize("@el.check('deploy:list')") diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/DeployHistoryController.java b/eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/DeployHistoryController.java index e771259c..49fb6946 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/DeployHistoryController.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/DeployHistoryController.java @@ -42,7 +42,6 @@ public class DeployHistoryController { private final DeployHistoryService deployhistoryService; - @Log("导出部署历史数据") @ApiOperation("导出部署历史数据") @GetMapping(value = "/download") @PreAuthorize("@el.check('deployHistory:list')") @@ -50,7 +49,6 @@ public class DeployHistoryController { deployhistoryService.download(deployhistoryService.queryAll(criteria), response); } - @Log("查询部署历史") @ApiOperation(value = "查询部署历史") @GetMapping @PreAuthorize("@el.check('deployHistory:list')") diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/ServerDeployController.java b/eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/ServerDeployController.java index 5bdcb342..d4a135bf 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/ServerDeployController.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/mnt/rest/ServerDeployController.java @@ -44,7 +44,6 @@ public class ServerDeployController { private final ServerDeployService serverDeployService; - @Log("导出服务器数据") @ApiOperation("导出服务器数据") @GetMapping(value = "/download") @PreAuthorize("@el.check('serverDeploy:list')") @@ -52,7 +51,6 @@ public class ServerDeployController { serverDeployService.download(serverDeployService.queryAll(criteria), response); } - @Log("查询服务器") @ApiOperation(value = "查询服务器") @GetMapping @PreAuthorize("@el.check('serverDeploy:list')") diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/quartz/rest/QuartzJobController.java b/eladmin-system/src/main/java/me/zhengjie/modules/quartz/rest/QuartzJobController.java index 021a4349..b4cb1cd4 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/quartz/rest/QuartzJobController.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/quartz/rest/QuartzJobController.java @@ -48,7 +48,6 @@ public class QuartzJobController { private static final String ENTITY_NAME = "quartzJob"; private final QuartzJobService quartzJobService; - @Log("查询定时任务") @ApiOperation("查询定时任务") @GetMapping @PreAuthorize("@el.check('timing:list')") @@ -56,7 +55,6 @@ public class QuartzJobController { return new ResponseEntity<>(quartzJobService.queryAll(criteria,pageable), HttpStatus.OK); } - @Log("导出任务数据") @ApiOperation("导出任务数据") @GetMapping(value = "/download") @PreAuthorize("@el.check('timing:list')") @@ -64,7 +62,6 @@ public class QuartzJobController { quartzJobService.download(quartzJobService.queryAll(criteria), response); } - @Log("导出日志数据") @ApiOperation("导出日志数据") @GetMapping(value = "/logs/download") @PreAuthorize("@el.check('timing:list')") diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/security/rest/AuthorizationController.java b/eladmin-system/src/main/java/me/zhengjie/modules/security/rest/AuthorizationController.java index 575880cb..3040d045 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/security/rest/AuthorizationController.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/security/rest/AuthorizationController.java @@ -71,7 +71,6 @@ public class AuthorizationController { @Resource private LoginProperties loginProperties; - @Log("用户登录") @ApiOperation("登录授权") @AnonymousPostMapping(value = "/login") public ResponseEntity login(@Validated @RequestBody AuthUserDto authUser, HttpServletRequest request) throws Exception { diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/security/rest/OnlineController.java b/eladmin-system/src/main/java/me/zhengjie/modules/security/rest/OnlineController.java index 7182e8ec..4b545d31 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/security/rest/OnlineController.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/security/rest/OnlineController.java @@ -18,7 +18,6 @@ package me.zhengjie.modules.security.rest; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; -import me.zhengjie.annotation.Log; import me.zhengjie.modules.security.service.OnlineUserService; import me.zhengjie.utils.EncryptUtils; import org.springframework.data.domain.Pageable; @@ -48,7 +47,6 @@ public class OnlineController { return new ResponseEntity<>(onlineUserService.getAll(filter, pageable),HttpStatus.OK); } - @Log("导出数据") @ApiOperation("导出数据") @GetMapping(value = "/download") @PreAuthorize("@el.check()") diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/security/service/dto/AuthUserDto.java b/eladmin-system/src/main/java/me/zhengjie/modules/security/service/dto/AuthUserDto.java index 2f3b6087..5219fc53 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/security/service/dto/AuthUserDto.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/security/service/dto/AuthUserDto.java @@ -17,7 +17,6 @@ package me.zhengjie.modules.security.service.dto; import lombok.Getter; import lombok.Setter; - import javax.validation.constraints.NotBlank; /** @@ -37,9 +36,4 @@ public class AuthUserDto { private String code; private String uuid = ""; - - @Override - public String toString() { - return "{username=" + username + ", password= ******}"; - } } diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/DeptController.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/DeptController.java index 26ada083..3100bf0d 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/DeptController.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/DeptController.java @@ -48,7 +48,6 @@ public class DeptController { private final DeptService deptService; private static final String ENTITY_NAME = "dept"; - @Log("导出部门数据") @ApiOperation("导出部门数据") @GetMapping(value = "/download") @PreAuthorize("@el.check('dept:list')") @@ -56,7 +55,6 @@ public class DeptController { deptService.download(deptService.queryAll(criteria, false), response); } - @Log("查询部门") @ApiOperation("查询部门") @GetMapping @PreAuthorize("@el.check('user:list','dept:list')") @@ -65,7 +63,6 @@ public class DeptController { return new ResponseEntity<>(PageUtil.toPage(deptDtos, deptDtos.size()),HttpStatus.OK); } - @Log("查询部门") @ApiOperation("查询部门:根据ID获取同级与上级数据") @PostMapping("/superior") @PreAuthorize("@el.check('user:list','dept:list')") diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/DictController.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/DictController.java index aaf985e9..f1e4d58c 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/DictController.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/DictController.java @@ -46,7 +46,6 @@ public class DictController { private final DictService dictService; private static final String ENTITY_NAME = "dict"; - @Log("导出字典数据") @ApiOperation("导出字典数据") @GetMapping(value = "/download") @PreAuthorize("@el.check('dict:list')") @@ -54,7 +53,6 @@ public class DictController { dictService.download(dictService.queryAll(criteria), response); } - @Log("查询字典") @ApiOperation("查询字典") @GetMapping(value = "/all") @PreAuthorize("@el.check('dict:list')") @@ -62,7 +60,6 @@ public class DictController { return new ResponseEntity<>(dictService.queryAll(new DictQueryCriteria()),HttpStatus.OK); } - @Log("查询字典") @ApiOperation("查询字典") @GetMapping @PreAuthorize("@el.check('dict:list')") diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/DictDetailController.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/DictDetailController.java index 3a2ec2ae..15e8e7ff 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/DictDetailController.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/DictDetailController.java @@ -50,7 +50,6 @@ public class DictDetailController { private final DictDetailService dictDetailService; private static final String ENTITY_NAME = "dictDetail"; - @Log("查询字典详情") @ApiOperation("查询字典详情") @GetMapping public ResponseEntity query(DictDetailQueryCriteria criteria, @@ -58,7 +57,6 @@ public class DictDetailController { return new ResponseEntity<>(dictDetailService.queryAll(criteria,pageable),HttpStatus.OK); } - @Log("查询多个字典详情") @ApiOperation("查询多个字典详情") @GetMapping(value = "/map") public ResponseEntity getDictDetailMaps(@RequestParam String dictName){ diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/JobController.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/JobController.java index 7257f8e8..4e1a9b23 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/JobController.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/JobController.java @@ -47,7 +47,6 @@ public class JobController { private final JobService jobService; private static final String ENTITY_NAME = "job"; - @Log("导出岗位数据") @ApiOperation("导出岗位数据") @GetMapping(value = "/download") @PreAuthorize("@el.check('job:list')") @@ -55,7 +54,6 @@ public class JobController { jobService.download(jobService.queryAll(criteria), response); } - @Log("查询岗位") @ApiOperation("查询岗位") @GetMapping @PreAuthorize("@el.check('job:list','user:list')") diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/MenuController.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/MenuController.java index 3eccc114..ede4822b 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/MenuController.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/MenuController.java @@ -51,7 +51,6 @@ public class MenuController { private final MenuMapper menuMapper; private static final String ENTITY_NAME = "menu"; - @Log("导出菜单数据") @ApiOperation("导出菜单数据") @GetMapping(value = "/download") @PreAuthorize("@el.check('menu:list')") @@ -74,16 +73,14 @@ public class MenuController { return new ResponseEntity<>(menuService.getMenus(pid),HttpStatus.OK); } - @Log("查询菜单") - @ApiOperation("查询菜单") @GetMapping + @ApiOperation("查询菜单") @PreAuthorize("@el.check('menu:list')") public ResponseEntity query(MenuQueryCriteria criteria) throws Exception { List menuDtoList = menuService.queryAll(criteria, true); return new ResponseEntity<>(PageUtil.toPage(menuDtoList, menuDtoList.size()),HttpStatus.OK); } - @Log("查询菜单") @ApiOperation("查询菜单:根据ID获取同级与上级数据") @PostMapping("/superior") @PreAuthorize("@el.check('menu:list')") diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/RoleController.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/RoleController.java index f723e3d2..a1edc931 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/RoleController.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/RoleController.java @@ -61,7 +61,6 @@ public class RoleController { return new ResponseEntity<>(roleService.findById(id), HttpStatus.OK); } - @Log("导出角色数据") @ApiOperation("导出角色数据") @GetMapping(value = "/download") @PreAuthorize("@el.check('role:list')") @@ -76,7 +75,6 @@ public class RoleController { return new ResponseEntity<>(roleService.queryAll(),HttpStatus.OK); } - @Log("查询角色") @ApiOperation("查询角色") @GetMapping @PreAuthorize("@el.check('roles:list')") diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/UserController.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/UserController.java index f84e7611..c79b2245 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/UserController.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/UserController.java @@ -66,7 +66,6 @@ public class UserController { private final RoleService roleService; private final VerifyService verificationCodeService; - @Log("导出用户数据") @ApiOperation("导出用户数据") @GetMapping(value = "/download") @PreAuthorize("@el.check('user:list')") @@ -74,7 +73,6 @@ public class UserController { userService.download(userService.queryAll(criteria), response); } - @Log("查询用户") @ApiOperation("查询用户") @GetMapping @PreAuthorize("@el.check('user:list')") diff --git a/eladmin-tools/src/main/java/me/zhengjie/rest/LocalStorageController.java b/eladmin-tools/src/main/java/me/zhengjie/rest/LocalStorageController.java index 24ecb400..6d7083de 100644 --- a/eladmin-tools/src/main/java/me/zhengjie/rest/LocalStorageController.java +++ b/eladmin-tools/src/main/java/me/zhengjie/rest/LocalStorageController.java @@ -22,7 +22,6 @@ import me.zhengjie.exception.BadRequestException; import me.zhengjie.service.LocalStorageService; import me.zhengjie.service.dto.LocalStorageQueryCriteria; import me.zhengjie.utils.FileUtil; -import me.zhengjie.utils.SecurityUtils; import org.springframework.data.domain.Pageable; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; @@ -31,7 +30,6 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import io.swagger.annotations.*; import org.springframework.web.multipart.MultipartFile; - import javax.servlet.http.HttpServletResponse; import java.io.IOException; @@ -54,7 +52,6 @@ public class LocalStorageController { return new ResponseEntity<>(localStorageService.queryAll(criteria,pageable),HttpStatus.OK); } - @Log("导出数据") @ApiOperation("导出数据") @GetMapping(value = "/download") @PreAuthorize("@el.check('storage:list')") @@ -70,7 +67,6 @@ public class LocalStorageController { return new ResponseEntity<>(HttpStatus.CREATED); } - @Log("上传图片") @PostMapping("/pictures") @ApiOperation("上传图片") public ResponseEntity upload(@RequestParam MultipartFile file){ @@ -83,6 +79,7 @@ public class LocalStorageController { return new ResponseEntity<>(localStorage, HttpStatus.OK); } + @Log("修改文件") @ApiOperation("修改文件") @PutMapping @PreAuthorize("@el.check('storage:edit')") @@ -91,7 +88,7 @@ public class LocalStorageController { return new ResponseEntity<>(HttpStatus.NO_CONTENT); } - @Log("多选删除") + @Log("删除文件") @DeleteMapping @ApiOperation("多选删除") public ResponseEntity delete(@RequestBody Long[] ids) { diff --git a/eladmin-tools/src/main/java/me/zhengjie/rest/QiniuController.java b/eladmin-tools/src/main/java/me/zhengjie/rest/QiniuController.java index 593c6d1f..1bb32d71 100644 --- a/eladmin-tools/src/main/java/me/zhengjie/rest/QiniuController.java +++ b/eladmin-tools/src/main/java/me/zhengjie/rest/QiniuController.java @@ -63,14 +63,12 @@ public class QiniuController { return new ResponseEntity<>(HttpStatus.OK); } - @Log("导出数据") @ApiOperation("导出数据") @GetMapping(value = "/download") public void download(HttpServletResponse response, QiniuQueryCriteria criteria) throws IOException { qiNiuService.downloadList(qiNiuService.queryAll(criteria), response); } - @Log("查询文件") @ApiOperation("查询文件") @GetMapping public ResponseEntity query(QiniuQueryCriteria criteria, Pageable pageable){