Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Kwan的解忧杂货铺@新空间代码工作室
design
提交
815d0a00
D
design
项目概览
Kwan的解忧杂货铺@新空间代码工作室
/
design
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
design
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
815d0a00
编写于
7月 30, 2023
作者:
Kwan的解忧杂货铺@新空间代码工作室
🐭
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:日志模块
上级
f6fa2d8d
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
76 addition
and
7 deletion
+76
-7
src/main/java/com/study/design/auditlog/AbstractAuditLogProcessor.java
.../com/study/design/auditlog/AbstractAuditLogProcessor.java
+23
-2
src/main/java/com/study/design/auditlog/LoginLogProcessor.java
...ain/java/com/study/design/auditlog/LoginLogProcessor.java
+9
-1
src/main/java/com/study/design/auditlog/OrderLogProcessor.java
...ain/java/com/study/design/auditlog/OrderLogProcessor.java
+9
-1
src/main/java/com/study/design/auditlog/PayLogProcessor.java
src/main/java/com/study/design/auditlog/PayLogProcessor.java
+9
-1
src/main/java/com/study/design/auditlog/pojo/AuditLog.java
src/main/java/com/study/design/auditlog/pojo/AuditLog.java
+26
-2
未找到文件。
src/main/java/com/study/design/auditlog/AbstractAuditLogProcessor.java
浏览文件 @
815d0a00
...
@@ -4,9 +4,24 @@ import com.study.design.auditlog.pojo.AuditLog;
...
@@ -4,9 +4,24 @@ import com.study.design.auditlog.pojo.AuditLog;
import
java.util.Date
;
import
java.util.Date
;
/**
* 抽象审计日志处理器
*
* @author : qinyingjie
* @version : 2.2.0
* @date : 2023/7/30 13:10
*/
public
abstract
class
AbstractAuditLogProcessor
{
public
abstract
class
AbstractAuditLogProcessor
{
// 创建我们的 AuditLog (基础部分)
/**
public
final
AuditLog
buildAuditLog
(
String
account
,
String
action
,
String
orderId
){
* 创建我们的 AuditLog (基础部分)
*
* @param account
* @param action
* @param orderId
* @return
*/
public
final
AuditLog
buildAuditLog
(
String
account
,
String
action
,
String
orderId
)
{
AuditLog
auditLog
=
new
AuditLog
();
AuditLog
auditLog
=
new
AuditLog
();
auditLog
.
setAccount
(
account
);
auditLog
.
setAccount
(
account
);
auditLog
.
setAction
(
action
);
auditLog
.
setAction
(
action
);
...
@@ -15,6 +30,12 @@ public abstract class AbstractAuditLogProcessor {
...
@@ -15,6 +30,12 @@ public abstract class AbstractAuditLogProcessor {
return
auditLog
;
return
auditLog
;
}
}
/**
* 不同的子类复写
*
* @param auditLog
* @return
*/
protected
abstract
AuditLog
buildDetails
(
AuditLog
auditLog
);
protected
abstract
AuditLog
buildDetails
(
AuditLog
auditLog
);
public
final
void
sendToQueue
(
AuditLog
auditLog
)
{
public
final
void
sendToQueue
(
AuditLog
auditLog
)
{
...
...
src/main/java/com/study/design/auditlog/LoginLogProcessor.java
浏览文件 @
815d0a00
...
@@ -3,8 +3,16 @@ package com.study.design.auditlog;
...
@@ -3,8 +3,16 @@ package com.study.design.auditlog;
import
com.study.design.auditlog.pojo.AuditLog
;
import
com.study.design.auditlog.pojo.AuditLog
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
/**
* 登录日志处理器
*
* @author : qinyingjie
* @version : 2.2.0
* @date : 2023/7/30 13:11
*/
@Component
@Component
public
class
LoginLogProcessor
extends
AbstractAuditLogProcessor
{
public
class
LoginLogProcessor
extends
AbstractAuditLogProcessor
{
@Override
@Override
protected
AuditLog
buildDetails
(
AuditLog
auditLog
)
{
protected
AuditLog
buildDetails
(
AuditLog
auditLog
)
{
return
auditLog
;
return
auditLog
;
...
...
src/main/java/com/study/design/auditlog/OrderLogProcessor.java
浏览文件 @
815d0a00
...
@@ -3,8 +3,16 @@ package com.study.design.auditlog;
...
@@ -3,8 +3,16 @@ package com.study.design.auditlog;
import
com.study.design.auditlog.pojo.AuditLog
;
import
com.study.design.auditlog.pojo.AuditLog
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
/**
* 订单日志处理器
*
* @author : qinyingjie
* @version : 2.2.0
* @date : 2023/7/30 13:11
*/
@Component
@Component
public
class
OrderLogProcessor
extends
AbstractAuditLogProcessor
{
public
class
OrderLogProcessor
extends
AbstractAuditLogProcessor
{
@Override
@Override
protected
AuditLog
buildDetails
(
AuditLog
auditLog
)
{
protected
AuditLog
buildDetails
(
AuditLog
auditLog
)
{
String
orderId
=
auditLog
.
getOrderId
();
String
orderId
=
auditLog
.
getOrderId
();
...
...
src/main/java/com/study/design/auditlog/PayLogProcessor.java
浏览文件 @
815d0a00
...
@@ -3,8 +3,16 @@ package com.study.design.auditlog;
...
@@ -3,8 +3,16 @@ package com.study.design.auditlog;
import
com.study.design.auditlog.pojo.AuditLog
;
import
com.study.design.auditlog.pojo.AuditLog
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
/**
* 支付日志处理器
*
* @author : qinyingjie
* @version : 2.2.0
* @date : 2023/7/30 13:12
*/
@Component
@Component
public
class
PayLogProcessor
extends
AbstractAuditLogProcessor
{
public
class
PayLogProcessor
extends
AbstractAuditLogProcessor
{
@Override
@Override
protected
AuditLog
buildDetails
(
AuditLog
auditLog
)
{
protected
AuditLog
buildDetails
(
AuditLog
auditLog
)
{
String
orderId
=
auditLog
.
getOrderId
();
String
orderId
=
auditLog
.
getOrderId
();
...
...
src/main/java/com/study/design/auditlog/pojo/AuditLog.java
浏览文件 @
815d0a00
...
@@ -2,13 +2,37 @@ package com.study.design.auditlog.pojo;
...
@@ -2,13 +2,37 @@ package com.study.design.auditlog.pojo;
import
java.util.Date
;
import
java.util.Date
;
/**
* 日志通用类
*
* @author : qinyingjie
* @version : 2.2.0
* @date : 2023/7/30 13:10
*/
public
class
AuditLog
{
public
class
AuditLog
{
/**
* 账户
*/
private
String
account
;
private
String
account
;
/**
* 动作
*/
private
String
action
;
private
String
action
;
/**
* 日期
*/
private
Date
date
;
private
Date
date
;
/**
* 订单id
*/
private
String
orderId
;
private
String
orderId
;
private
Object
details
;
//订单创建需要有相关产品信息;
/**
// 订单支付需要有相关产品信息以及支付方式和支付金额。
* 订单创建需要有相关产品信息;
* 订单支付需要有相关产品信息以及支付方式和支付金额。
*/
private
Object
details
;
public
String
getAccount
()
{
public
String
getAccount
()
{
return
account
;
return
account
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录