This commit is contained in:
2023-09-07 23:28:19 +08:00
parent 34ab1400fb
commit 28f31015fb
6 changed files with 18 additions and 17 deletions

View File

@@ -30,7 +30,7 @@ import java.util.Arrays;
public class ControllerAop {
@Pointcut("execution (* cn.lihongjie.coal.controller.*.*(..))")
@Pointcut("execution (* cn.lihongjie.coal.*.controller.*.*(..))")
public void controllerMethods() {
}
@@ -87,7 +87,7 @@ public class ControllerAop {
private static void updateSysLog(Throwable e, SysLogEntity sysLogEntity) {
if (sysLogEntity != null) {
sysLogEntity.setStatus("1");
sysLogEntity.setOptStatus("1");
sysLogEntity.setStacktrace(ExceptionUtils.getStackTrace(e));
}
@@ -118,7 +118,7 @@ public class ControllerAop {
sysLogEntity.setIp(RequestUtils.getIp(request));
sysLogEntity.setIpLocation(RequestUtils.getIp(request));
sysLogEntity.setUrl(request.getRequestURI());
sysLogEntity.setStatus("0");
sysLogEntity.setOptStatus("0");
sysLogEntity.setTimeCost(0);
sysLogEntity.setUserAgent(RequestUtils.getUa(request));

View File

@@ -26,7 +26,7 @@ public class BaseEntity {
private String createUserId;
@Formula("(select name from t_user where id = create_user_id)")
@Formula("(select tu.name from t_user tu where tu.id = create_user_id)")
private String createUserName;
@Comment("创建时间")
@@ -36,7 +36,7 @@ public class BaseEntity {
@Comment("更新用户ID")
private String updateUserId;
@Formula("((select name from t_user where id = create_user_id))")
@Formula("((select tu.name from t_user tu where tu.id = create_user_id))")
private String updateUserName;
@Comment("更新时间")

View File

@@ -10,7 +10,6 @@ public class CreateSysLogDto extends OrgCommonDto
@Comment("ip")
private String ip;
private String statusName;
@Comment("模块")
private String module;
@Comment("操作")
@@ -34,9 +33,11 @@ public class CreateSysLogDto extends OrgCommonDto
private String url;
@Comment("操作状态 0 成功 1 失败")
private Integer status;
@Comment("错误堆栈")
private String stacktrace;
private String optStatus;
private String optStatusName;
}

View File

@@ -8,6 +8,8 @@ import org.hibernate.annotations.Comment;
public class SysLogDto extends OrgCommonDto
{
private String optStatus;
private String optStatusName;
@Comment("ip")
private String ip;
@@ -34,12 +36,9 @@ public class SysLogDto extends OrgCommonDto
private String url;
@Comment("操作状态 0 成功 1 失败")
private Integer status;
@Comment("错误堆栈")
private String stacktrace;
private String statusName;
}

View File

@@ -11,7 +11,6 @@ public class UpdateSysLogDto extends OrgCommonDto
@Comment("ip")
private String ip;
private String statusName;
@Comment("模块")
private String module;
@Comment("操作")
@@ -35,10 +34,12 @@ public class UpdateSysLogDto extends OrgCommonDto
private String url;
@Comment("操作状态 0 成功 1 失败")
private Integer status;
@Comment("错误堆栈")
private String stacktrace;
private String optStatus;
private String optStatusName;
}

View File

@@ -38,15 +38,15 @@ public class SysLogEntity extends OrgBaseEntity {
@Comment("操作状态 0 成功 1 失败")
private String status;
private String optStatus;
@Formula("(select i.name\n" +
"from t_dictionary d,\n" +
" t_dictionary_item i\n" +
"where d.id = i.dictionary_id\n" +
" and d.code = 'syslog.status'\n" +
" and i.code = status)")
private String statusName;
" and i.code = opt_status)")
private String optStatusName;
@Comment("错误堆栈")