【修改】 用户日志

This commit is contained in:
bupengxiang
2023-08-01 15:13:13 +08:00
parent 81779422bb
commit 4e5bf36da4
2 changed files with 38 additions and 26 deletions
@@ -1,6 +1,7 @@
package com.jero.common.aspect;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.PropertyFilter;
import com.jero.common.api.dto.LogDTO;
import com.jero.common.api.vo.Results;
@@ -81,6 +82,30 @@ public class AutoLogAspect {
}
//注解上的描述,操作日志内容
dto.setLogType(syslog.logType());
if ("user".equals(content)){
if (syslog.operateType() == 2){
Object result = ((Results) obj).getResult();
String s = JSONObject.toJSONString(result);
JSONObject jsonObject = JSON.parseObject(s);
String id =(String)jsonObject.get("id");
content = "新增用户,id"+id;
}else if (syslog.operateType() == 3){
Object result = ((Results) obj).getResult();
String s = JSONObject.toJSONString(result);
JSONObject jsonObject = JSON.parseObject(s);
String id =(String)jsonObject.get("id");
content = "修改,id"+id;
}else if (syslog.operateType() == 4){
String message = ((Results) obj).getMessage();
String result = (String)((Results) obj).getResult();
if ("删除用户成功".equals(message)){
content = "删除用户,id"+result;
}else {
content = "批量删除用户,ids"+result;
}
}
}
dto.setLogContent(content);
}