From d7c2a0800b433e11aad571ec8bef3eaa0623f9d9 Mon Sep 17 00:00:00 2001 From: lzh Date: Wed, 28 Jan 2026 18:01:03 +0800 Subject: [PATCH] =?UTF-8?q?fix(ops):=20=E4=BF=AE=E5=A4=8D=E5=B7=A5?= =?UTF-8?q?=E5=8D=95=E4=B8=9A=E5=8A=A1=E6=97=A5=E5=BF=97id=E7=94=9F?= =?UTF-8?q?=E6=88=90=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ops/dal/dataobject/log/OpsBusinessEventLogDO.java | 7 +++---- .../infrastructure/log/recorder/EventLogRecorderImpl.java | 4 ++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/viewsh-module-ops/viewsh-module-ops-biz/src/main/java/com/viewsh/module/ops/dal/dataobject/log/OpsBusinessEventLogDO.java b/viewsh-module-ops/viewsh-module-ops-biz/src/main/java/com/viewsh/module/ops/dal/dataobject/log/OpsBusinessEventLogDO.java index 5b9028f..25ed761 100644 --- a/viewsh-module-ops/viewsh-module-ops-biz/src/main/java/com/viewsh/module/ops/dal/dataobject/log/OpsBusinessEventLogDO.java +++ b/viewsh-module-ops/viewsh-module-ops-biz/src/main/java/com/viewsh/module/ops/dal/dataobject/log/OpsBusinessEventLogDO.java @@ -1,7 +1,7 @@ package com.viewsh.module.ops.dal.dataobject.log; +import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.KeySequence; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; @@ -20,7 +20,6 @@ import java.util.Map; * @author lzh */ @TableName(value = "ops_business_event_log", autoResultMap = true) -@KeySequence("ops_business_event_log_seq") @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) @@ -32,9 +31,9 @@ public class OpsBusinessEventLogDO extends BaseDO { // ==================== 主键 ==================== /** - * 主键ID + * 主键ID(使用雪花算法生成) */ - @TableId + @TableId(type = IdType.ASSIGN_ID) private Long id; // ==================== 时间与级别 ==================== diff --git a/viewsh-module-ops/viewsh-module-ops-biz/src/main/java/com/viewsh/module/ops/infrastructure/log/recorder/EventLogRecorderImpl.java b/viewsh-module-ops/viewsh-module-ops-biz/src/main/java/com/viewsh/module/ops/infrastructure/log/recorder/EventLogRecorderImpl.java index 25c3b10..c5e4fd5 100644 --- a/viewsh-module-ops/viewsh-module-ops-biz/src/main/java/com/viewsh/module/ops/infrastructure/log/recorder/EventLogRecorderImpl.java +++ b/viewsh-module-ops/viewsh-module-ops-biz/src/main/java/com/viewsh/module/ops/infrastructure/log/recorder/EventLogRecorderImpl.java @@ -1,6 +1,7 @@ package com.viewsh.module.ops.infrastructure.log.recorder; import com.viewsh.module.ops.dal.dataobject.log.OpsBusinessEventLogDO; +import com.viewsh.module.ops.infrastructure.id.OrderIdGenerator; import com.viewsh.module.ops.infrastructure.log.enumeration.EventDomain; import com.viewsh.module.ops.infrastructure.log.enumeration.EventLevel; import jakarta.annotation.Resource; @@ -31,6 +32,9 @@ public class EventLogRecorderImpl implements EventLogRecorder { @Resource private EventLogPersister persister; + @Resource + private OrderIdGenerator orderIdGenerator; + /** * 异步记录日志(默认方式) *