diff --git a/pom.xml b/pom.xml index f480991..5f8cc0f 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ 17 1.18.34 1.9.3 - 1.9.3.021-beta + 1.9.3.030-beta 5.8.26 3.3.2 2.0.51 diff --git a/src/main/java/com/cool/core/base/BaseEntity.java b/src/main/java/com/cool/core/base/BaseEntity.java index 978b74e..72366a3 100644 --- a/src/main/java/com/cool/core/base/BaseEntity.java +++ b/src/main/java/com/cool/core/base/BaseEntity.java @@ -1,5 +1,6 @@ package com.cool.core.base; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.mybatisflex.annotation.Column; import com.mybatisflex.annotation.Id; import com.mybatisflex.annotation.KeyType; @@ -20,17 +21,18 @@ import lombok.Setter; public abstract class BaseEntity> extends Model implements Serializable { @Id(keyType = KeyType.Auto, comment = "ID") - private Long id; + protected Long id; @Column(onInsertValue = "now()") @ColumnDefine(comment = "创建时间") - private Date createTime; + protected Date createTime; @Column(onInsertValue = "now()", onUpdateValue = "now()") @ColumnDefine(comment = "更新时间") - private Date updateTime; + protected Date updateTime; @Ignore @Column(ignore = true) + @JsonIgnore private QueryWrapper queryWrapper; } \ No newline at end of file diff --git a/src/main/java/com/cool/core/plugin/service/CoolPluginService.java b/src/main/java/com/cool/core/plugin/service/CoolPluginService.java index a0e4de4..8b1fe0c 100644 --- a/src/main/java/com/cool/core/plugin/service/CoolPluginService.java +++ b/src/main/java/com/cool/core/plugin/service/CoolPluginService.java @@ -184,6 +184,7 @@ public class CoolPluginService { // 通过key 找到id PluginInfoEntity one = pluginInfoService.getByKeyNoJarFile(pluginJson.getKey()); if (ObjUtil.isNotEmpty(one)) { + String oldJarPath = one.getPluginJson().getJarPath(); // 重新加载配置不更新 pluginInfo.setConfig(one.getConfig()); pluginInfo.getPluginJson().setConfig(one.getConfig()); @@ -191,7 +192,10 @@ public class CoolPluginService { // 忽略无变更,无需更新的字段 ignoreNoChange(pluginInfo, one); BeanUtil.copyProperties(pluginInfo, one, options); - one.updateById(); + if (one.updateById()) { + // 覆盖时删除旧版本插件 + FileUtil.del(oldJarPath); + } } } diff --git a/src/main/java/com/cool/modules/base/service/sys/impl/BaseSysLogServiceImpl.java b/src/main/java/com/cool/modules/base/service/sys/impl/BaseSysLogServiceImpl.java index 9e4796c..4979c20 100644 --- a/src/main/java/com/cool/modules/base/service/sys/impl/BaseSysLogServiceImpl.java +++ b/src/main/java/com/cool/modules/base/service/sys/impl/BaseSysLogServiceImpl.java @@ -19,6 +19,7 @@ import com.mybatisflex.core.query.QueryWrapper; import jakarta.servlet.http.HttpServletRequest; import java.util.Date; import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Value; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; @@ -36,6 +37,9 @@ public class BaseSysLogServiceImpl extends BaseServiceImpl page, QueryWrapper queryWrapper) { @@ -76,7 +80,10 @@ public class BaseSysLogServiceImpl extends BaseServiceImpl maxJsonLength) { + // 超过指定 + newJSONObject.clear(); + } recordAsync(requestURI, ipAddr, userId, newJSONObject); } diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index ef0ec9b..f63156a 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -127,7 +127,9 @@ cool: local: # 文件访问地址 base-url: http://127.0.0.1:${server.port}/upload - + # 系统日志请求参数超过1024字节 就不记录,避免日志过大 + log: + maxJsonLength: 1024 # AutoTable配置,根据实体类自动生成表 auto-table: show-banner: false