diff --git a/sql/ry_20180808.sql b/sql/ry_20180818.sql similarity index 97% rename from sql/ry_20180808.sql rename to sql/ry_20180818.sql index 2f17a922..fa300a4a 100644 --- a/sql/ry_20180808.sql +++ b/sql/ry_20180818.sql @@ -374,16 +374,16 @@ drop table if exists sys_oper_log; create table sys_oper_log ( oper_id int(11) not null auto_increment comment '日志主键', title varchar(50) default '' comment '模块标题', - action varchar(100) default '' comment '功能请求', + business_type int(2) default 0 comment '业务类型(0其它 1新增 2修改 3删除)', method varchar(100) default '' comment '方法名称', - channel varchar(20) default '' comment '来源渠道(manage后台用户 mobile手机端用户 other其它)', + operator_type int(1) default 0 comment '操作类别(0其它 1后台用户 2手机端用户)', oper_name varchar(50) default '' comment '操作人员', dept_name varchar(50) default '' comment '部门名称', oper_url varchar(255) default '' comment '请求URL', oper_ip varchar(30) default '' comment '主机地址', oper_location varchar(255) default '' comment '操作地点', oper_param varchar(255) default '' comment '请求参数', - status char(1) default '0' comment '操作状态(0正常 1异常)', + status int(1) default 0 comment '操作状态(0正常 1异常)', error_msg varchar(2000) default '' comment '错误消息', oper_time datetime comment '操作时间', primary key (oper_id) diff --git a/src/main/java/com/ruoyi/framework/aspectj/DsAspect.java b/src/main/java/com/ruoyi/framework/aspectj/DsAspect.java index bfc64db3..6b3611c1 100644 --- a/src/main/java/com/ruoyi/framework/aspectj/DsAspect.java +++ b/src/main/java/com/ruoyi/framework/aspectj/DsAspect.java @@ -39,13 +39,11 @@ public class DsAspect Method method = signature.getMethod(); - if (method.isAnnotationPresent(Ds.class)) + Ds dataSource = method.getAnnotation(Ds.class); + + if (StringUtils.isNotNull(dataSource)) { - Ds dataSource = method.getAnnotation(Ds.class); - if (StringUtils.isNotNull(dataSource) && StringUtils.isNotEmpty(dataSource.name())) - { - DynamicDataSourceContextHolder.setDB(dataSource.name()); - } + DynamicDataSourceContextHolder.setDateSoureType(dataSource.value().name()); } try @@ -54,7 +52,8 @@ public class DsAspect } finally { - DynamicDataSourceContextHolder.clearDB(); + // 销毁数据源 在执行方法之后 + DynamicDataSourceContextHolder.clearDateSoureType(); } } } diff --git a/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java b/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java index fa0aa80a..677f40b9 100644 --- a/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java +++ b/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java @@ -19,7 +19,7 @@ import com.ruoyi.common.utils.ServletUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.security.ShiroUtils; import com.ruoyi.framework.aspectj.lang.annotation.Log; -import com.ruoyi.framework.aspectj.lang.constant.BusinessStatus; +import com.ruoyi.framework.aspectj.lang.enums.BusinessStatus; import com.ruoyi.framework.manager.AsyncManager; import com.ruoyi.framework.manager.factory.AsyncFactory; import com.ruoyi.project.monitor.operlog.domain.OperLog; @@ -83,7 +83,7 @@ public class LogAspect // *========数据库日志=========*// OperLog operLog = new OperLog(); - operLog.setStatus(BusinessStatus.SUCCESS); + operLog.setStatus(BusinessStatus.SUCCESS.ordinal()); // 请求的地址 String ip = ShiroUtils.getIp(); operLog.setOperIp(ip); @@ -101,7 +101,7 @@ public class LogAspect if (e != null) { - operLog.setStatus(BusinessStatus.FAIL); + operLog.setStatus(BusinessStatus.FAIL.ordinal()); operLog.setErrorMsg(StringUtils.substring(e.getMessage(), 0, 2000)); } // 设置方法名称 @@ -132,11 +132,11 @@ public class LogAspect public void getControllerMethodDescription(Log log, OperLog operLog) throws Exception { // 设置action动作 - operLog.setAction(log.action()); + operLog.setBusinessType(log.businessType().ordinal()); // 设置标题 operLog.setTitle(log.title()); - // 设置channel - operLog.setChannel(log.channel()); + // 设置操作人类别 + operLog.setOperatorType(log.operatorType().ordinal()); // 是否需要保存request,参数和值 if (log.isSaveRequestData()) { diff --git a/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Ds.java b/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Ds.java index 784f27a2..5dd04439 100644 --- a/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Ds.java +++ b/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Ds.java @@ -4,7 +4,8 @@ import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import com.ruoyi.framework.aspectj.lang.constant.DataSourceName; + +import com.ruoyi.framework.aspectj.lang.enums.DataSourceType; /** * 自定义多数据源切换注解 @@ -16,7 +17,7 @@ import com.ruoyi.framework.aspectj.lang.constant.DataSourceName; public @interface Ds { /** - * 切换数据源值 + * 切换数据源名称 */ - String name() default DataSourceName.MASTER; + public DataSourceType value() default DataSourceType.MASTER; } diff --git a/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Log.java b/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Log.java index 70337d4d..4437affd 100644 --- a/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Log.java +++ b/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/Log.java @@ -5,7 +5,8 @@ import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import com.ruoyi.framework.aspectj.lang.constant.OperatorType; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.aspectj.lang.enums.OperatorType; /** * 自定义操作日志记录注解 @@ -22,10 +23,10 @@ public @interface Log String title() default ""; /** 功能 */ - String action() default ""; + BusinessType businessType() default BusinessType.OTHER; - /** 渠道 */ - String channel() default OperatorType.MANAGE; + /** 操作人类别 */ + OperatorType operatorType() default OperatorType.MANAGE; /** 是否保存请求的参数 */ boolean isSaveRequestData() default true; diff --git a/src/main/java/com/ruoyi/framework/aspectj/lang/constant/BusinessStatus.java b/src/main/java/com/ruoyi/framework/aspectj/lang/constant/BusinessStatus.java deleted file mode 100644 index 6f9b8b15..00000000 --- a/src/main/java/com/ruoyi/framework/aspectj/lang/constant/BusinessStatus.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.ruoyi.framework.aspectj.lang.constant; - -/** - * 操作状态 - * - * @author ruoyi - * - */ -public class BusinessStatus -{ - /** 其它 */ - public static final String OTHER = "-1"; - - /** 成功 */ - public static final String SUCCESS = "0"; - - /** 失败 */ - public static final String FAIL = "1"; -} diff --git a/src/main/java/com/ruoyi/framework/aspectj/lang/constant/BusinessType.java b/src/main/java/com/ruoyi/framework/aspectj/lang/constant/BusinessType.java deleted file mode 100644 index 2990630d..00000000 --- a/src/main/java/com/ruoyi/framework/aspectj/lang/constant/BusinessType.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.ruoyi.framework.aspectj.lang.constant; - -/** - * 业务操作类型 - * - * @author ruoyi - * - */ -public class BusinessType -{ - /** 其它 */ - public static final String OTHER = "0"; - /** 新增 */ - public static final String INSERT = "1"; - /** 修改 */ - public static final String UPDATE = "2"; - /** 删除 */ - public static final String DELETE = "3"; - /** 授权 */ - public static final String GRANT = "4"; - /** 导出 */ - public static final String EXPORT = "5"; - /** 导入 */ - public static final String IMPORT = "6"; - /** 强退 */ - public static final String FORCE = "7"; - /** 生成代码 */ - public static final String GENCODE = "8"; -} diff --git a/src/main/java/com/ruoyi/framework/aspectj/lang/constant/DataSourceName.java b/src/main/java/com/ruoyi/framework/aspectj/lang/constant/DataSourceName.java deleted file mode 100644 index cffeb1e0..00000000 --- a/src/main/java/com/ruoyi/framework/aspectj/lang/constant/DataSourceName.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.ruoyi.framework.aspectj.lang.constant; - -/** - * 多数据源别名 - * - * @author ruoyi - * - */ -public class DataSourceName -{ - /** 主库 */ - public static final String MASTER = "master"; - - /** 从库 */ - public static final String SLAVE = "slave"; -} diff --git a/src/main/java/com/ruoyi/framework/aspectj/lang/constant/OperatorType.java b/src/main/java/com/ruoyi/framework/aspectj/lang/constant/OperatorType.java deleted file mode 100644 index 8e470258..00000000 --- a/src/main/java/com/ruoyi/framework/aspectj/lang/constant/OperatorType.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.ruoyi.framework.aspectj.lang.constant; - -/** - * 操作人类别 - * - * @author ruoyi - * - */ -public class OperatorType -{ - /** 其它 */ - public static final String OTHER = "0"; - - /** 后台用户 */ - public static final String MANAGE = "1"; - - /** 渠道用户 */ - public static final String CHANNEL = "2"; - - /** 手机端用户 */ - public static final String MOBILE = "3"; -} diff --git a/src/main/java/com/ruoyi/framework/aspectj/lang/enums/BusinessStatus.java b/src/main/java/com/ruoyi/framework/aspectj/lang/enums/BusinessStatus.java new file mode 100644 index 00000000..2e1c7af9 --- /dev/null +++ b/src/main/java/com/ruoyi/framework/aspectj/lang/enums/BusinessStatus.java @@ -0,0 +1,20 @@ +package com.ruoyi.framework.aspectj.lang.enums; + +/** + * 操作状态 + * + * @author ruoyi + * + */ +public enum BusinessStatus +{ + /** + * 成功 + */ + SUCCESS, + + /** + * 失败 + */ + FAIL, +} diff --git a/src/main/java/com/ruoyi/framework/aspectj/lang/enums/BusinessType.java b/src/main/java/com/ruoyi/framework/aspectj/lang/enums/BusinessType.java new file mode 100644 index 00000000..dbc027ed --- /dev/null +++ b/src/main/java/com/ruoyi/framework/aspectj/lang/enums/BusinessType.java @@ -0,0 +1,55 @@ +package com.ruoyi.framework.aspectj.lang.enums; + +/** + * 业务操作类型 + * + * @author ruoyi + * + */ +public enum BusinessType +{ + /** + * 其它 + */ + OTHER, + + /** + * 新增 + */ + INSERT, + + /** + * 修改 + */ + UPDATE, + + /** + * 删除 + */ + DELETE, + + /** + * 授权 + */ + GRANT, + + /** + * 导出 + */ + EXPORT, + + /** + * 导入 + */ + IMPORT, + + /** + * 强退 + */ + FORCE, + + /** + * 生成代码 + */ + GENCODE, +} diff --git a/src/main/java/com/ruoyi/framework/aspectj/lang/enums/DataSourceType.java b/src/main/java/com/ruoyi/framework/aspectj/lang/enums/DataSourceType.java new file mode 100644 index 00000000..103cd806 --- /dev/null +++ b/src/main/java/com/ruoyi/framework/aspectj/lang/enums/DataSourceType.java @@ -0,0 +1,19 @@ +package com.ruoyi.framework.aspectj.lang.enums; + +/** + * 数据源 + * + * @author ruoyi + */ +public enum DataSourceType +{ + /** + * 主库 + */ + MASTER, + + /** + * 从库 + */ + SLAVE +} diff --git a/src/main/java/com/ruoyi/framework/aspectj/lang/enums/OperatorType.java b/src/main/java/com/ruoyi/framework/aspectj/lang/enums/OperatorType.java new file mode 100644 index 00000000..a325d688 --- /dev/null +++ b/src/main/java/com/ruoyi/framework/aspectj/lang/enums/OperatorType.java @@ -0,0 +1,26 @@ +package com.ruoyi.framework.aspectj.lang.enums; + +/** + * 操作人类别 + * + * @author ruoyi + * + */ +public enum OperatorType +{ + /** + * 其它 + */ + OTHER, + + /** + * 后台用户 + */ + + MANAGE, + + /** + * 手机端用户 + */ + MOBILE +} diff --git a/src/main/java/com/ruoyi/framework/config/DruidConfig.java b/src/main/java/com/ruoyi/framework/config/DruidConfig.java index 86f2eab1..1fac0617 100644 --- a/src/main/java/com/ruoyi/framework/config/DruidConfig.java +++ b/src/main/java/com/ruoyi/framework/config/DruidConfig.java @@ -9,7 +9,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Primary; import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder; -import com.ruoyi.framework.aspectj.lang.constant.DataSourceName; +import com.ruoyi.framework.aspectj.lang.enums.DataSourceType; import com.ruoyi.framework.datasource.DynamicDataSource; /** @@ -29,7 +29,7 @@ public class DruidConfig @Bean @ConfigurationProperties("spring.datasource.druid.slave") - @ConditionalOnProperty(prefix = "spring.datasource.druid.slave", name = "open", havingValue = "true") + @ConditionalOnProperty(prefix = "spring.datasource.druid.slave", name = "enabled", havingValue = "true") public DataSource slaveDataSource() { return DruidDataSourceBuilder.create().build(); @@ -40,8 +40,8 @@ public class DruidConfig public DynamicDataSource dataSource(DataSource masterDataSource, DataSource slaveDataSource) { Map targetDataSources = new HashMap<>(); - targetDataSources.put(DataSourceName.MASTER, masterDataSource); - targetDataSources.put(DataSourceName.SLAVE, slaveDataSource); + targetDataSources.put(DataSourceType.MASTER.name(), masterDataSource); + targetDataSources.put(DataSourceType.SLAVE.name(), slaveDataSource); return new DynamicDataSource(masterDataSource, targetDataSources); } } diff --git a/src/main/java/com/ruoyi/framework/datasource/DynamicDataSource.java b/src/main/java/com/ruoyi/framework/datasource/DynamicDataSource.java index f1c97cf0..29d9578c 100644 --- a/src/main/java/com/ruoyi/framework/datasource/DynamicDataSource.java +++ b/src/main/java/com/ruoyi/framework/datasource/DynamicDataSource.java @@ -21,7 +21,7 @@ public class DynamicDataSource extends AbstractRoutingDataSource @Override protected Object determineCurrentLookupKey() { - return DynamicDataSourceContextHolder.getDB(); + return DynamicDataSourceContextHolder.getDateSoureType(); } } \ No newline at end of file diff --git a/src/main/java/com/ruoyi/framework/datasource/DynamicDataSourceContextHolder.java b/src/main/java/com/ruoyi/framework/datasource/DynamicDataSourceContextHolder.java index 0d6d7e88..6f701202 100644 --- a/src/main/java/com/ruoyi/framework/datasource/DynamicDataSourceContextHolder.java +++ b/src/main/java/com/ruoyi/framework/datasource/DynamicDataSourceContextHolder.java @@ -4,7 +4,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** - * 当前线程数据源 + * 数据源切换处理 * * @author ruoyi */ @@ -12,29 +12,33 @@ public class DynamicDataSourceContextHolder { public static final Logger log = LoggerFactory.getLogger(DynamicDataSourceContextHolder.class); + /** + * 使用ThreadLocal维护变量,ThreadLocal为每个使用该变量的线程提供独立的变量副本, + * 所以每一个线程都可以独立地改变自己的副本,而不会影响其它线程所对应的副本。 + */ private static final ThreadLocal CONTEXT_HOLDER = new ThreadLocal<>(); /** - * 设置数据源名 + * 设置数据源的变量 */ - public static void setDB(String dbType) + public static void setDateSoureType(String dsType) { - log.info("切换到{}数据源", dbType); - CONTEXT_HOLDER.set(dbType); + log.info("切换到{}数据源", dsType); + CONTEXT_HOLDER.set(dsType); } /** - * 获取数据源名 + * 获得数据源的变量 */ - public static String getDB() + public static String getDateSoureType() { return CONTEXT_HOLDER.get(); } /** - * 清理数据源名 + * 清空数据源变量 */ - public static void clearDB() + public static void clearDateSoureType() { CONTEXT_HOLDER.remove(); } diff --git a/src/main/java/com/ruoyi/project/monitor/job/controller/JobController.java b/src/main/java/com/ruoyi/project/monitor/job/controller/JobController.java index 6a9d6ee1..c75e78b0 100644 --- a/src/main/java/com/ruoyi/project/monitor/job/controller/JobController.java +++ b/src/main/java/com/ruoyi/project/monitor/job/controller/JobController.java @@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.framework.aspectj.lang.annotation.Log; -import com.ruoyi.framework.aspectj.lang.constant.BusinessType; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; import com.ruoyi.framework.web.controller.BaseController; import com.ruoyi.framework.web.domain.AjaxResult; import com.ruoyi.framework.web.page.TableDataInfo; @@ -50,7 +50,7 @@ public class JobController extends BaseController return getDataTable(list); } - @Log(title = "定时任务", action = BusinessType.EXPORT) + @Log(title = "定时任务", businessType = BusinessType.EXPORT) @RequiresPermissions("monitor:job:export") @PostMapping("/export") @ResponseBody @@ -68,7 +68,7 @@ public class JobController extends BaseController } } - @Log(title = "定时任务", action = BusinessType.DELETE) + @Log(title = "定时任务", businessType = BusinessType.DELETE) @RequiresPermissions("monitor:job:remove") @PostMapping("/remove") @ResponseBody @@ -89,7 +89,7 @@ public class JobController extends BaseController /** * 任务调度状态修改 */ - @Log(title = "定时任务", action = BusinessType.UPDATE) + @Log(title = "定时任务", businessType = BusinessType.UPDATE) @RequiresPermissions("monitor:job:changeStatus") @PostMapping("/changeStatus") @ResponseBody @@ -101,7 +101,7 @@ public class JobController extends BaseController /** * 任务调度立即执行一次 */ - @Log(title = "定时任务", action = BusinessType.UPDATE) + @Log(title = "定时任务", businessType = BusinessType.UPDATE) @RequiresPermissions("monitor:job:changeStatus") @PostMapping("/run") @ResponseBody @@ -122,7 +122,7 @@ public class JobController extends BaseController /** * 新增保存调度 */ - @Log(title = "定时任务", action = BusinessType.INSERT) + @Log(title = "定时任务", businessType = BusinessType.INSERT) @RequiresPermissions("monitor:job:add") @PostMapping("/add") @ResponseBody @@ -144,7 +144,7 @@ public class JobController extends BaseController /** * 修改保存调度 */ - @Log(title = "定时任务", action = BusinessType.UPDATE) + @Log(title = "定时任务", businessType = BusinessType.UPDATE) @RequiresPermissions("monitor:job:edit") @PostMapping("/edit") @ResponseBody diff --git a/src/main/java/com/ruoyi/project/monitor/job/controller/JobLogController.java b/src/main/java/com/ruoyi/project/monitor/job/controller/JobLogController.java index 562ff7e8..60c72462 100644 --- a/src/main/java/com/ruoyi/project/monitor/job/controller/JobLogController.java +++ b/src/main/java/com/ruoyi/project/monitor/job/controller/JobLogController.java @@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.framework.aspectj.lang.annotation.Log; -import com.ruoyi.framework.aspectj.lang.constant.BusinessType; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; import com.ruoyi.framework.web.controller.BaseController; import com.ruoyi.framework.web.domain.AjaxResult; import com.ruoyi.framework.web.page.TableDataInfo; @@ -48,7 +48,7 @@ public class JobLogController extends BaseController return getDataTable(list); } - @Log(title = "调度日志", action = BusinessType.EXPORT) + @Log(title = "调度日志", businessType = BusinessType.EXPORT) @RequiresPermissions("monitor:job:export") @PostMapping("/export") @ResponseBody @@ -66,7 +66,7 @@ public class JobLogController extends BaseController } } - @Log(title = "调度日志", action = BusinessType.DELETE) + @Log(title = "调度日志", businessType = BusinessType.DELETE) @RequiresPermissions("monitor:job:remove") @PostMapping("/remove") @ResponseBody diff --git a/src/main/java/com/ruoyi/project/monitor/logininfor/controller/LogininforController.java b/src/main/java/com/ruoyi/project/monitor/logininfor/controller/LogininforController.java index b6bd5268..d3debdc4 100644 --- a/src/main/java/com/ruoyi/project/monitor/logininfor/controller/LogininforController.java +++ b/src/main/java/com/ruoyi/project/monitor/logininfor/controller/LogininforController.java @@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.framework.aspectj.lang.annotation.Log; -import com.ruoyi.framework.aspectj.lang.constant.BusinessType; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; import com.ruoyi.framework.web.controller.BaseController; import com.ruoyi.framework.web.domain.AjaxResult; import com.ruoyi.framework.web.page.TableDataInfo; @@ -48,7 +48,7 @@ public class LogininforController extends BaseController return getDataTable(list); } - @Log(title = "登陆日志", action = BusinessType.EXPORT) + @Log(title = "登陆日志", businessType = BusinessType.EXPORT) @RequiresPermissions("monitor:logininfor:export") @PostMapping("/export") @ResponseBody @@ -67,7 +67,7 @@ public class LogininforController extends BaseController } @RequiresPermissions("monitor:logininfor:remove") - @Log(title = "登陆日志", action = BusinessType.DELETE) + @Log(title = "登陆日志", businessType = BusinessType.DELETE) @PostMapping("/remove") @ResponseBody public AjaxResult remove(String ids) diff --git a/src/main/java/com/ruoyi/project/monitor/online/controller/UserOnlineController.java b/src/main/java/com/ruoyi/project/monitor/online/controller/UserOnlineController.java index 40455699..c31c530c 100644 --- a/src/main/java/com/ruoyi/project/monitor/online/controller/UserOnlineController.java +++ b/src/main/java/com/ruoyi/project/monitor/online/controller/UserOnlineController.java @@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import com.ruoyi.common.utils.security.ShiroUtils; import com.ruoyi.framework.aspectj.lang.annotation.Log; -import com.ruoyi.framework.aspectj.lang.constant.BusinessType; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; import com.ruoyi.framework.shiro.session.OnlineSessionDAO; import com.ruoyi.framework.web.controller.BaseController; import com.ruoyi.framework.web.domain.AjaxResult; @@ -55,7 +55,7 @@ public class UserOnlineController extends BaseController } @RequiresPermissions("monitor:online:batchForceLogout") - @Log(title = "在线用户", action = BusinessType.FORCE) + @Log(title = "在线用户", businessType = BusinessType.FORCE) @PostMapping("/batchForceLogout") @ResponseBody public AjaxResult batchForceLogout(@RequestParam("ids[]") String[] ids) @@ -84,7 +84,7 @@ public class UserOnlineController extends BaseController } @RequiresPermissions("monitor:online:forceLogout") - @Log(title = "在线用户", action = BusinessType.FORCE) + @Log(title = "在线用户", businessType = BusinessType.FORCE) @PostMapping("/forceLogout") @ResponseBody public AjaxResult forceLogout(String sessionId) diff --git a/src/main/java/com/ruoyi/project/monitor/operlog/controller/OperlogController.java b/src/main/java/com/ruoyi/project/monitor/operlog/controller/OperlogController.java index 6e292925..62bc47ab 100644 --- a/src/main/java/com/ruoyi/project/monitor/operlog/controller/OperlogController.java +++ b/src/main/java/com/ruoyi/project/monitor/operlog/controller/OperlogController.java @@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.framework.aspectj.lang.annotation.Log; -import com.ruoyi.framework.aspectj.lang.constant.BusinessType; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; import com.ruoyi.framework.web.controller.BaseController; import com.ruoyi.framework.web.domain.AjaxResult; import com.ruoyi.framework.web.page.TableDataInfo; @@ -50,7 +50,7 @@ public class OperlogController extends BaseController return getDataTable(list); } - @Log(title = "操作日志", action = BusinessType.EXPORT) + @Log(title = "操作日志", businessType = BusinessType.EXPORT) @RequiresPermissions("monitor:operlog:export") @PostMapping("/export") @ResponseBody diff --git a/src/main/java/com/ruoyi/project/monitor/operlog/domain/OperLog.java b/src/main/java/com/ruoyi/project/monitor/operlog/domain/OperLog.java index 6bba8a09..16485848 100644 --- a/src/main/java/com/ruoyi/project/monitor/operlog/domain/OperLog.java +++ b/src/main/java/com/ruoyi/project/monitor/operlog/domain/OperLog.java @@ -21,17 +21,17 @@ public class OperLog extends BaseEntity @Excel(name = "操作模块") private String title; - /** 操作类型 */ - @Excel(name = "操作类型") - private String action; + /** 操作业务类型 */ + @Excel(name = "业务类型") + private Integer businessType; /** 请求方法 */ @Excel(name = "请求方法") private String method; - /** 来源渠道 */ - @Excel(name = "来源渠道") - private String channel; + /** 操作人类别 */ + @Excel(name = "操作类别") + private Integer operatorType; /** 操作人员 */ @Excel(name = "操作人员") @@ -59,7 +59,7 @@ public class OperLog extends BaseEntity /** 状态0正常 1异常 */ @Excel(name = "状态") - private String status; + private Integer status; /** 错误消息 */ @Excel(name = "错误消息") @@ -89,14 +89,14 @@ public class OperLog extends BaseEntity this.title = title; } - public String getAction() + public Integer getBusinessType() { - return action; + return businessType; } - public void setAction(String action) + public void setBusinessType(Integer businessType) { - this.action = action; + this.businessType = businessType; } public String getMethod() @@ -109,14 +109,14 @@ public class OperLog extends BaseEntity this.method = method; } - public String getChannel() + public Integer getOperatorType() { - return channel; + return operatorType; } - public void setChannel(String channel) + public void setOperatorType(Integer operatorType) { - this.channel = channel; + this.operatorType = operatorType; } public String getOperName() @@ -179,12 +179,12 @@ public class OperLog extends BaseEntity this.operParam = operParam; } - public String getStatus() + public Integer getStatus() { return status; } - public void setStatus(String status) + public void setStatus(Integer status) { this.status = status; } @@ -212,10 +212,10 @@ public class OperLog extends BaseEntity @Override public String toString() { - return "OperLog [operId=" + operId + ", title=" + title + ", action=" + action + ", method=" + method - + ", channel=" + channel + ", operName=" + operName + ", deptName=" + deptName + ", operUrl=" + operUrl - + ", operIp=" + operIp + ", operLocation=" + operLocation + ", operParam=" + operParam + ", status=" - + status + ", errorMsg=" + errorMsg + ", operTime=" + operTime + "]"; + return "OperLog [operId=" + operId + ", title=" + title + ", businessType=" + businessType + ", method=" + + method + ", operatorType=" + operatorType + ", operName=" + operName + ", deptName=" + deptName + + ", operUrl=" + operUrl + ", operIp=" + operIp + ", operLocation=" + operLocation + ", operParam=" + + operParam + ", status=" + status + ", errorMsg=" + errorMsg + ", operTime=" + operTime + "]"; } } diff --git a/src/main/java/com/ruoyi/project/system/config/controller/ConfigController.java b/src/main/java/com/ruoyi/project/system/config/controller/ConfigController.java index 000bbdde..3c55fda3 100644 --- a/src/main/java/com/ruoyi/project/system/config/controller/ConfigController.java +++ b/src/main/java/com/ruoyi/project/system/config/controller/ConfigController.java @@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.ResponseBody; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.framework.aspectj.lang.annotation.Log; -import com.ruoyi.framework.aspectj.lang.constant.BusinessType; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; import com.ruoyi.framework.web.controller.BaseController; import com.ruoyi.framework.web.domain.AjaxResult; import com.ruoyi.framework.web.page.TableDataInfo; @@ -54,7 +54,7 @@ public class ConfigController extends BaseController return getDataTable(list); } - @Log(title = "参数管理", action = BusinessType.EXPORT) + @Log(title = "参数管理", businessType = BusinessType.EXPORT) @RequiresPermissions("system:config:export") @PostMapping("/export") @ResponseBody @@ -85,7 +85,7 @@ public class ConfigController extends BaseController * 新增保存参数配置 */ @RequiresPermissions("system:config:add") - @Log(title = "参数管理", action = BusinessType.INSERT) + @Log(title = "参数管理", businessType = BusinessType.INSERT) @PostMapping("/add") @ResponseBody public AjaxResult addSave(Config config) @@ -107,7 +107,7 @@ public class ConfigController extends BaseController * 修改保存参数配置 */ @RequiresPermissions("system:config:edit") - @Log(title = "参数管理", action = BusinessType.UPDATE) + @Log(title = "参数管理", businessType = BusinessType.UPDATE) @PostMapping("/edit") @ResponseBody public AjaxResult editSave(Config config) @@ -119,7 +119,7 @@ public class ConfigController extends BaseController * 删除参数配置 */ @RequiresPermissions("system:config:remove") - @Log(title = "参数管理", action = BusinessType.DELETE) + @Log(title = "参数管理", businessType = BusinessType.DELETE) @PostMapping("/remove") @ResponseBody public AjaxResult remove(String ids) diff --git a/src/main/java/com/ruoyi/project/system/dept/controller/DeptController.java b/src/main/java/com/ruoyi/project/system/dept/controller/DeptController.java index 83c1cad8..dce03273 100644 --- a/src/main/java/com/ruoyi/project/system/dept/controller/DeptController.java +++ b/src/main/java/com/ruoyi/project/system/dept/controller/DeptController.java @@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.framework.aspectj.lang.annotation.Log; -import com.ruoyi.framework.aspectj.lang.constant.BusinessType; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; import com.ruoyi.framework.web.controller.BaseController; import com.ruoyi.framework.web.domain.AjaxResult; import com.ruoyi.project.system.dept.domain.Dept; @@ -62,7 +62,7 @@ public class DeptController extends BaseController /** * 新增保存部门 */ - @Log(title = "部门管理", action = BusinessType.INSERT) + @Log(title = "部门管理", businessType = BusinessType.INSERT) @RequiresPermissions("system:dept:add") @PostMapping("/add") @ResponseBody @@ -84,7 +84,7 @@ public class DeptController extends BaseController /** * 保存 */ - @Log(title = "部门管理", action = BusinessType.UPDATE) + @Log(title = "部门管理", businessType = BusinessType.UPDATE) @RequiresPermissions("system:dept:edit") @PostMapping("/edit") @ResponseBody @@ -96,7 +96,7 @@ public class DeptController extends BaseController /** * 删除 */ - @Log(title = "部门管理", action = BusinessType.DELETE) + @Log(title = "部门管理", businessType = BusinessType.DELETE) @RequiresPermissions("system:dept:remove") @PostMapping("/remove/{deptId}") @ResponseBody diff --git a/src/main/java/com/ruoyi/project/system/dict/controller/DictDataController.java b/src/main/java/com/ruoyi/project/system/dict/controller/DictDataController.java index 4bf7c5bc..5d0c3747 100644 --- a/src/main/java/com/ruoyi/project/system/dict/controller/DictDataController.java +++ b/src/main/java/com/ruoyi/project/system/dict/controller/DictDataController.java @@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.framework.aspectj.lang.annotation.Log; -import com.ruoyi.framework.aspectj.lang.constant.BusinessType; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; import com.ruoyi.framework.web.controller.BaseController; import com.ruoyi.framework.web.domain.AjaxResult; import com.ruoyi.framework.web.page.TableDataInfo; @@ -50,7 +50,7 @@ public class DictDataController extends BaseController return getDataTable(list); } - @Log(title = "字典数据", action = BusinessType.EXPORT) + @Log(title = "字典数据", businessType = BusinessType.EXPORT) @RequiresPermissions("system:dict:export") @PostMapping("/export") @ResponseBody @@ -81,7 +81,7 @@ public class DictDataController extends BaseController /** * 新增保存字典类型 */ - @Log(title = "字典数据", action = BusinessType.INSERT) + @Log(title = "字典数据", businessType = BusinessType.INSERT) @RequiresPermissions("system:dict:add") @PostMapping("/add") @ResponseBody @@ -103,7 +103,7 @@ public class DictDataController extends BaseController /** * 修改保存字典类型 */ - @Log(title = "字典数据", action = BusinessType.UPDATE) + @Log(title = "字典数据", businessType = BusinessType.UPDATE) @RequiresPermissions("system:dict:edit") @PostMapping("/edit") @ResponseBody @@ -112,7 +112,7 @@ public class DictDataController extends BaseController return toAjax(dictDataService.updateDictData(dict)); } - @Log(title = "字典数据", action = BusinessType.DELETE) + @Log(title = "字典数据", businessType = BusinessType.DELETE) @RequiresPermissions("system:dict:remove") @PostMapping("/remove") @ResponseBody diff --git a/src/main/java/com/ruoyi/project/system/dict/controller/DictTypeController.java b/src/main/java/com/ruoyi/project/system/dict/controller/DictTypeController.java index 4be5be02..4bfd9813 100644 --- a/src/main/java/com/ruoyi/project/system/dict/controller/DictTypeController.java +++ b/src/main/java/com/ruoyi/project/system/dict/controller/DictTypeController.java @@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.ResponseBody; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.framework.aspectj.lang.annotation.Log; -import com.ruoyi.framework.aspectj.lang.constant.BusinessType; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; import com.ruoyi.framework.web.controller.BaseController; import com.ruoyi.framework.web.domain.AjaxResult; import com.ruoyi.framework.web.page.TableDataInfo; @@ -51,7 +51,7 @@ public class DictTypeController extends BaseController return getDataTable(list); } - @Log(title = "字典类型", action = BusinessType.EXPORT) + @Log(title = "字典类型", businessType = BusinessType.EXPORT) @RequiresPermissions("system:dict:export") @PostMapping("/export") @ResponseBody @@ -81,7 +81,7 @@ public class DictTypeController extends BaseController /** * 新增保存字典类型 */ - @Log(title = "字典类型", action = BusinessType.INSERT) + @Log(title = "字典类型", businessType = BusinessType.INSERT) @RequiresPermissions("system:dict:add") @PostMapping("/add") @ResponseBody @@ -103,7 +103,7 @@ public class DictTypeController extends BaseController /** * 修改保存字典类型 */ - @Log(title = "字典类型", action = BusinessType.UPDATE) + @Log(title = "字典类型", businessType = BusinessType.UPDATE) @RequiresPermissions("system:dict:edit") @PostMapping("/edit") @ResponseBody @@ -112,7 +112,7 @@ public class DictTypeController extends BaseController return toAjax(dictTypeService.updateDictType(dict)); } - @Log(title = "字典类型", action = BusinessType.DELETE) + @Log(title = "字典类型", businessType = BusinessType.DELETE) @RequiresPermissions("system:dict:remove") @PostMapping("/remove") @ResponseBody diff --git a/src/main/java/com/ruoyi/project/system/menu/controller/MenuController.java b/src/main/java/com/ruoyi/project/system/menu/controller/MenuController.java index 44e36800..5f9c4878 100644 --- a/src/main/java/com/ruoyi/project/system/menu/controller/MenuController.java +++ b/src/main/java/com/ruoyi/project/system/menu/controller/MenuController.java @@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.framework.aspectj.lang.annotation.Log; -import com.ruoyi.framework.aspectj.lang.constant.BusinessType; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; import com.ruoyi.framework.web.controller.BaseController; import com.ruoyi.framework.web.domain.AjaxResult; import com.ruoyi.project.system.menu.domain.Menu; @@ -54,7 +54,7 @@ public class MenuController extends BaseController /** * 删除菜单 */ - @Log(title = "菜单管理", action = BusinessType.DELETE) + @Log(title = "菜单管理", businessType = BusinessType.DELETE) @RequiresPermissions("system:menu:remove") @PostMapping("/remove/{menuId}") @ResponseBody @@ -95,7 +95,7 @@ public class MenuController extends BaseController /** * 新增保存菜单 */ - @Log(title = "菜单管理", action = BusinessType.INSERT) + @Log(title = "菜单管理", businessType = BusinessType.INSERT) @RequiresPermissions("system:menu:add") @PostMapping("/add") @ResponseBody @@ -117,7 +117,7 @@ public class MenuController extends BaseController /** * 修改保存菜单 */ - @Log(title = "菜单管理", action = BusinessType.UPDATE) + @Log(title = "菜单管理", businessType = BusinessType.UPDATE) @RequiresPermissions("system:menu:edit") @PostMapping("/edit") @ResponseBody diff --git a/src/main/java/com/ruoyi/project/system/notice/controller/NoticeController.java b/src/main/java/com/ruoyi/project/system/notice/controller/NoticeController.java index bbda522c..987f5a8d 100644 --- a/src/main/java/com/ruoyi/project/system/notice/controller/NoticeController.java +++ b/src/main/java/com/ruoyi/project/system/notice/controller/NoticeController.java @@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import com.ruoyi.framework.aspectj.lang.annotation.Log; -import com.ruoyi.framework.aspectj.lang.constant.BusinessType; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; import com.ruoyi.framework.web.controller.BaseController; import com.ruoyi.framework.web.domain.AjaxResult; import com.ruoyi.framework.web.page.TableDataInfo; @@ -65,7 +65,7 @@ public class NoticeController extends BaseController * 新增保存公告 */ @RequiresPermissions("system:notice:add") - @Log(title = "通知公告", action = BusinessType.INSERT) + @Log(title = "通知公告", businessType = BusinessType.INSERT) @PostMapping("/add") @ResponseBody public AjaxResult addSave(Notice notice) @@ -87,7 +87,7 @@ public class NoticeController extends BaseController * 修改保存公告 */ @RequiresPermissions("system:notice:edit") - @Log(title = "通知公告", action = BusinessType.UPDATE) + @Log(title = "通知公告", businessType = BusinessType.UPDATE) @PostMapping("/edit") @ResponseBody public AjaxResult editSave(Notice notice) @@ -99,7 +99,7 @@ public class NoticeController extends BaseController * 删除公告 */ @RequiresPermissions("system:notice:remove") - @Log(title = "通知公告", action = BusinessType.DELETE) + @Log(title = "通知公告", businessType = BusinessType.DELETE) @PostMapping("/remove") @ResponseBody public AjaxResult remove(String ids) diff --git a/src/main/java/com/ruoyi/project/system/post/controller/PostController.java b/src/main/java/com/ruoyi/project/system/post/controller/PostController.java index f2bbb617..71a084d9 100644 --- a/src/main/java/com/ruoyi/project/system/post/controller/PostController.java +++ b/src/main/java/com/ruoyi/project/system/post/controller/PostController.java @@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.ResponseBody; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.framework.aspectj.lang.annotation.Log; -import com.ruoyi.framework.aspectj.lang.constant.BusinessType; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; import com.ruoyi.framework.web.controller.BaseController; import com.ruoyi.framework.web.domain.AjaxResult; import com.ruoyi.framework.web.page.TableDataInfo; @@ -51,7 +51,7 @@ public class PostController extends BaseController return getDataTable(list); } - @Log(title = "岗位管理", action = BusinessType.EXPORT) + @Log(title = "岗位管理", businessType = BusinessType.EXPORT) @RequiresPermissions("system:post:export") @PostMapping("/export") @ResponseBody @@ -70,7 +70,7 @@ public class PostController extends BaseController } @RequiresPermissions("system:post:remove") - @Log(title = "岗位管理", action = BusinessType.DELETE) + @Log(title = "岗位管理", businessType = BusinessType.DELETE) @PostMapping("/remove") @ResponseBody public AjaxResult remove(String ids) @@ -98,7 +98,7 @@ public class PostController extends BaseController * 新增保存岗位 */ @RequiresPermissions("system:post:add") - @Log(title = "岗位管理", action = BusinessType.INSERT) + @Log(title = "岗位管理", businessType = BusinessType.INSERT) @PostMapping("/add") @ResponseBody public AjaxResult addSave(Post post) @@ -120,7 +120,7 @@ public class PostController extends BaseController * 修改保存岗位 */ @RequiresPermissions("system:post:edit") - @Log(title = "岗位管理", action = BusinessType.UPDATE) + @Log(title = "岗位管理", businessType = BusinessType.UPDATE) @PostMapping("/edit") @ResponseBody public AjaxResult editSave(Post post) diff --git a/src/main/java/com/ruoyi/project/system/role/controller/RoleController.java b/src/main/java/com/ruoyi/project/system/role/controller/RoleController.java index dee0e7cc..6bab38ce 100644 --- a/src/main/java/com/ruoyi/project/system/role/controller/RoleController.java +++ b/src/main/java/com/ruoyi/project/system/role/controller/RoleController.java @@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.ResponseBody; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.framework.aspectj.lang.annotation.Log; -import com.ruoyi.framework.aspectj.lang.constant.BusinessType; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; import com.ruoyi.framework.web.controller.BaseController; import com.ruoyi.framework.web.domain.AjaxResult; import com.ruoyi.framework.web.page.TableDataInfo; @@ -53,7 +53,7 @@ public class RoleController extends BaseController return getDataTable(list); } - @Log(title = "角色管理", action = BusinessType.EXPORT) + @Log(title = "角色管理", businessType = BusinessType.EXPORT) @RequiresPermissions("system:role:export") @PostMapping("/export") @ResponseBody @@ -84,7 +84,7 @@ public class RoleController extends BaseController * 新增保存角色 */ @RequiresPermissions("system:role:add") - @Log(title = "角色管理", action = BusinessType.INSERT) + @Log(title = "角色管理", businessType = BusinessType.INSERT) @PostMapping("/add") @Transactional(rollbackFor = Exception.class) @ResponseBody @@ -108,7 +108,7 @@ public class RoleController extends BaseController * 修改保存角色 */ @RequiresPermissions("system:role:edit") - @Log(title = "角色管理", action = BusinessType.UPDATE) + @Log(title = "角色管理", businessType = BusinessType.UPDATE) @PostMapping("/edit") @Transactional(rollbackFor = Exception.class) @ResponseBody @@ -118,7 +118,7 @@ public class RoleController extends BaseController } @RequiresPermissions("system:role:remove") - @Log(title = "角色管理", action = BusinessType.DELETE) + @Log(title = "角色管理", businessType = BusinessType.DELETE) @PostMapping("/remove") @ResponseBody public AjaxResult remove(String ids) diff --git a/src/main/java/com/ruoyi/project/system/user/controller/ProfileController.java b/src/main/java/com/ruoyi/project/system/user/controller/ProfileController.java index 2aa0b781..47746014 100644 --- a/src/main/java/com/ruoyi/project/system/user/controller/ProfileController.java +++ b/src/main/java/com/ruoyi/project/system/user/controller/ProfileController.java @@ -15,7 +15,7 @@ import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.multipart.MultipartFile; import com.ruoyi.common.utils.file.FileUploadUtils; import com.ruoyi.framework.aspectj.lang.annotation.Log; -import com.ruoyi.framework.aspectj.lang.constant.BusinessType; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; import com.ruoyi.framework.web.controller.BaseController; import com.ruoyi.framework.web.domain.AjaxResult; import com.ruoyi.framework.web.service.DictService; @@ -75,7 +75,7 @@ public class ProfileController extends BaseController return prefix + "/resetPwd"; } - @Log(title = "重置密码", action = BusinessType.UPDATE) + @Log(title = "重置密码", businessType = BusinessType.UPDATE) @PostMapping("/resetPwd") @ResponseBody public AjaxResult resetPwd(User user) @@ -112,7 +112,7 @@ public class ProfileController extends BaseController /** * 修改用户 */ - @Log(title = "个人信息", action = BusinessType.UPDATE) + @Log(title = "个人信息", businessType = BusinessType.UPDATE) @PostMapping("/update") @ResponseBody public AjaxResult update(User user) @@ -128,7 +128,7 @@ public class ProfileController extends BaseController /** * 保存头像 */ - @Log(title = "个人信息", action = BusinessType.UPDATE) + @Log(title = "个人信息", businessType = BusinessType.UPDATE) @PostMapping("/updateAvatar") @ResponseBody public AjaxResult updateAvatar(User user, @RequestParam("avatarfile") MultipartFile file) diff --git a/src/main/java/com/ruoyi/project/system/user/controller/UserController.java b/src/main/java/com/ruoyi/project/system/user/controller/UserController.java index 0aecd2e4..d8013ebf 100644 --- a/src/main/java/com/ruoyi/project/system/user/controller/UserController.java +++ b/src/main/java/com/ruoyi/project/system/user/controller/UserController.java @@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.ResponseBody; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.framework.aspectj.lang.annotation.Log; -import com.ruoyi.framework.aspectj.lang.constant.BusinessType; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; import com.ruoyi.framework.web.controller.BaseController; import com.ruoyi.framework.web.domain.AjaxResult; import com.ruoyi.framework.web.page.TableDataInfo; @@ -60,7 +60,7 @@ public class UserController extends BaseController return getDataTable(list); } - @Log(title = "用户管理", action = BusinessType.EXPORT) + @Log(title = "用户管理", businessType = BusinessType.EXPORT) @RequiresPermissions("system:user:export") @PostMapping("/export") @ResponseBody @@ -93,7 +93,7 @@ public class UserController extends BaseController * 新增保存用户 */ @RequiresPermissions("system:user:add") - @Log(title = "用户管理", action = BusinessType.INSERT) + @Log(title = "用户管理", businessType = BusinessType.INSERT) @PostMapping("/add") @Transactional(rollbackFor = Exception.class) @ResponseBody @@ -122,7 +122,7 @@ public class UserController extends BaseController * 修改保存用户 */ @RequiresPermissions("system:user:edit") - @Log(title = "用户管理", action = BusinessType.UPDATE) + @Log(title = "用户管理", businessType = BusinessType.UPDATE) @PostMapping("/edit") @Transactional(rollbackFor = Exception.class) @ResponseBody @@ -136,7 +136,7 @@ public class UserController extends BaseController } @RequiresPermissions("system:user:resetPwd") - @Log(title = "重置密码", action = BusinessType.UPDATE) + @Log(title = "重置密码", businessType = BusinessType.UPDATE) @GetMapping("/resetPwd/{userId}") public String resetPwd(@PathVariable("userId") Long userId, ModelMap mmap) { @@ -145,7 +145,7 @@ public class UserController extends BaseController } @RequiresPermissions("system:user:resetPwd") - @Log(title = "重置密码", action = BusinessType.UPDATE) + @Log(title = "重置密码", businessType = BusinessType.UPDATE) @PostMapping("/resetPwd") @ResponseBody public AjaxResult resetPwd(User user) @@ -154,7 +154,7 @@ public class UserController extends BaseController } @RequiresPermissions("system:user:remove") - @Log(title = "用户管理", action = BusinessType.DELETE) + @Log(title = "用户管理", businessType = BusinessType.DELETE) @PostMapping("/remove") @ResponseBody public AjaxResult remove(String ids) diff --git a/src/main/java/com/ruoyi/project/tool/gen/controller/GenController.java b/src/main/java/com/ruoyi/project/tool/gen/controller/GenController.java index d9f2090d..2bd42380 100644 --- a/src/main/java/com/ruoyi/project/tool/gen/controller/GenController.java +++ b/src/main/java/com/ruoyi/project/tool/gen/controller/GenController.java @@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import com.ruoyi.common.support.Convert; import com.ruoyi.framework.aspectj.lang.annotation.Log; -import com.ruoyi.framework.aspectj.lang.constant.BusinessType; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; import com.ruoyi.framework.web.controller.BaseController; import com.ruoyi.framework.web.page.TableDataInfo; import com.ruoyi.project.tool.gen.domain.TableInfo; @@ -55,7 +55,7 @@ public class GenController extends BaseController * 生成代码 */ @RequiresPermissions("tool:gen:code") - @Log(title = "代码生成", action = BusinessType.GENCODE) + @Log(title = "代码生成", businessType = BusinessType.GENCODE) @GetMapping("/genCode/{tableName}") public void genCode(HttpServletResponse response, @PathVariable("tableName") String tableName) throws IOException { @@ -72,7 +72,7 @@ public class GenController extends BaseController * 批量生成代码 */ @RequiresPermissions("tool:gen:code") - @Log(title = "代码生成", action = BusinessType.GENCODE) + @Log(title = "代码生成", businessType = BusinessType.GENCODE) @GetMapping("/batchGenCode") @ResponseBody public void batchGenCode(HttpServletResponse response, String tables) throws IOException diff --git a/src/main/resources/application-druid.yml b/src/main/resources/application-druid.yml index f5dda0f4..da7a23d5 100644 --- a/src/main/resources/application-druid.yml +++ b/src/main/resources/application-druid.yml @@ -1,18 +1,21 @@ -#数据源配置 +# 数据源配置 spring: datasource: type: com.alibaba.druid.pool.DruidDataSource driverClassName: com.mysql.jdbc.Driver druid: - master: #主库 + # 主库数据源 + master: url: jdbc:mysql://localhost:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true username: root password: password - #slave: #从库 - # open: true - # url: jdbc:mysql://localhost:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true - # username: root - # password: password + # 从库数据源 + slave: + # 从数据源开关/默认关闭 + enabled: false + url: + username: + password: # 初始连接数 initial-size: 10 # 最大连接池数量 diff --git a/src/main/resources/mybatis/monitor/OperLogMapper.xml b/src/main/resources/mybatis/monitor/OperLogMapper.xml index a4639894..16970e3f 100644 --- a/src/main/resources/mybatis/monitor/OperLogMapper.xml +++ b/src/main/resources/mybatis/monitor/OperLogMapper.xml @@ -7,10 +7,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + - - + + @@ -23,14 +23,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select - oper_id, title, action, method, channel, oper_name, dept_name, oper_url, oper_ip,oper_location,oper_param,status,error_msg,oper_time + oper_id, title, business_type, method, operator_type, oper_name, dept_name, oper_url, oper_ip,oper_location,oper_param,status,error_msg,oper_time from sys_oper_log - insert into sys_oper_log(title, action, method, channel, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, status, error_msg, oper_time) - values (#{title}, #{action}, #{method}, #{channel}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{status}, #{errorMsg}, sysdate()) + insert into sys_oper_log(title, business_type, method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, status, error_msg, oper_time) + values (#{title}, #{businessType}, #{method}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{status}, #{errorMsg}, sysdate())
  • - @@ -77,7 +77,7 @@ title: '系统模块' }, { - field: 'action', + field: 'businessType', title: '操作类型', align: 'center', formatter: function(value, row, index) {