16 changed files with 310 additions and 75 deletions
-
12client/src/main/java/com/inscloudtech/alog/client/task/Monitor.java
-
37common/src/main/java/com/inscloudtech/alog/common/model/ActionLogMessage.java
-
7common/src/main/java/com/inscloudtech/alog/common/utils/IdWorker.java
-
5example/pom.xml
-
23example/src/main/java/com/inscloudtech/alog/clientdemo/aspectj/ActionLogAspect.java
-
23worker/pom.xml
-
5worker/src/main/java/com/inscloudtech/alog/worker/Starter.java
-
6worker/src/main/java/com/inscloudtech/alog/worker/disruptor/DisruptorStarter.java
-
33worker/src/main/java/com/inscloudtech/alog/worker/disruptor/TracerConsumer.java
-
119worker/src/main/java/com/inscloudtech/alog/worker/domain/ActionLog.java
-
12worker/src/main/java/com/inscloudtech/alog/worker/mapper/ActionLogMapper.java
-
10worker/src/main/java/com/inscloudtech/alog/worker/service/ActionLogService.java
-
13worker/src/main/java/com/inscloudtech/alog/worker/service/impl/ActionLogServiceImpl.java
-
35worker/src/main/java/com/inscloudtech/alog/worker/store/ActionLogToDbStore.java
-
6worker/src/main/resources/alog.sql
-
39worker/src/main/resources/application.yml
@ -0,0 +1,119 @@ |
|||||
|
package com.inscloudtech.alog.worker.domain; |
||||
|
|
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 示例用户 stock |
||||
|
* @author inscloudtech |
||||
|
* @date 2023-07-27 |
||||
|
*/ |
||||
|
@Data |
||||
|
@TableName(autoResultMap = true) |
||||
|
public class ActionLog { |
||||
|
|
||||
|
private static final long serialVersionUID=1L; |
||||
|
|
||||
|
/** |
||||
|
* 时间创建时间 |
||||
|
*/ |
||||
|
private Date createTime; |
||||
|
|
||||
|
/** |
||||
|
* 日志主键 |
||||
|
*/ |
||||
|
@TableId |
||||
|
private long logId; |
||||
|
|
||||
|
private long appId; |
||||
|
/** |
||||
|
* 操作模块 |
||||
|
*/ |
||||
|
private String businessName; |
||||
|
/** |
||||
|
* 业务类型(0其它 1新增 2修改 3删除) |
||||
|
*/ |
||||
|
private Integer businessType; |
||||
|
|
||||
|
/** |
||||
|
* 请求方法 |
||||
|
*/ |
||||
|
private String method; |
||||
|
/** |
||||
|
* 请求方式 |
||||
|
*/ |
||||
|
private String requestMethod; |
||||
|
/** |
||||
|
* 操作人员(0用户 1系统自动) |
||||
|
*/ |
||||
|
private Integer operatorType; |
||||
|
/** |
||||
|
* 操作人员Id |
||||
|
*/ |
||||
|
private String operUid; |
||||
|
|
||||
|
/** |
||||
|
* 操作人员 |
||||
|
*/ |
||||
|
private String operUserName; |
||||
|
/** |
||||
|
* 部门名称 |
||||
|
*/ |
||||
|
private String deptName; |
||||
|
/** |
||||
|
* 请求url |
||||
|
*/ |
||||
|
private String operUrl; |
||||
|
/** |
||||
|
* 操作地址 |
||||
|
*/ |
||||
|
private String operIp; |
||||
|
/** |
||||
|
* 操作地点 |
||||
|
*/ |
||||
|
private String operLocation; |
||||
|
/** |
||||
|
* 请求参数 |
||||
|
*/ |
||||
|
private String operParam; |
||||
|
/** |
||||
|
* 返回参数 |
||||
|
*/ |
||||
|
private String jsonResult; |
||||
|
/** |
||||
|
* 操作状态(0正常 1异常) |
||||
|
*/ |
||||
|
private Integer status; |
||||
|
/** |
||||
|
* 错误消息 |
||||
|
*/ |
||||
|
private String errorMsg; |
||||
|
/** |
||||
|
* 操作时间 |
||||
|
*/ |
||||
|
private Date operTime; |
||||
|
/** |
||||
|
* 更新前值 |
||||
|
*/ |
||||
|
private String beforeValue; |
||||
|
|
||||
|
/** |
||||
|
* 更新新后 |
||||
|
*/ |
||||
|
private String afterValue; |
||||
|
|
||||
|
/** |
||||
|
* 业务数据id |
||||
|
*/ |
||||
|
private Long businessId; |
||||
|
|
||||
|
/** |
||||
|
* 响应时间 |
||||
|
*/ |
||||
|
private long responseTime; |
||||
|
} |
@ -0,0 +1,12 @@ |
|||||
|
package com.inscloudtech.alog.worker.mapper; |
||||
|
|
||||
|
|
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.inscloudtech.alog.worker.domain.ActionLog; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
|
||||
|
@Mapper |
||||
|
public interface ActionLogMapper extends BaseMapper<ActionLog> { |
||||
|
|
||||
|
} |
@ -0,0 +1,10 @@ |
|||||
|
package com.inscloudtech.alog.worker.service; |
||||
|
|
||||
|
|
||||
|
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
import com.inscloudtech.alog.worker.domain.ActionLog; |
||||
|
|
||||
|
|
||||
|
public interface ActionLogService extends IService<ActionLog> { |
||||
|
|
||||
|
} |
@ -0,0 +1,13 @@ |
|||||
|
package com.inscloudtech.alog.worker.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
|
||||
|
import com.inscloudtech.alog.worker.domain.ActionLog; |
||||
|
import com.inscloudtech.alog.worker.mapper.ActionLogMapper; |
||||
|
import com.inscloudtech.alog.worker.service.ActionLogService; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
@Service |
||||
|
public class ActionLogServiceImpl extends ServiceImpl<ActionLogMapper, ActionLog> implements ActionLogService { |
||||
|
|
||||
|
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue