1、mybatis-flex.ext 版本升级
2、系统日志参数写入大小控制 3、覆盖插件时,删除原因插件包
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -19,7 +19,7 @@
|
||||
<java.version>17</java.version>
|
||||
<lombok.version>1.18.34</lombok.version>
|
||||
<mybatis-flex.version>1.9.3</mybatis-flex.version>
|
||||
<mybatis-flex.ext.version>1.9.3.021-beta</mybatis-flex.ext.version>
|
||||
<mybatis-flex.ext.version>1.9.3.030-beta</mybatis-flex.ext.version>
|
||||
<hutool.version>5.8.26</hutool.version>
|
||||
<ognl.version>3.3.2</ognl.version>
|
||||
<fastjson2.version>2.0.51</fastjson2.version>
|
||||
|
||||
@@ -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<T extends Model<T>> extends Model<T> 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;
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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<BaseSysLogMapper, Bas
|
||||
|
||||
private final IPUtils ipUtils;
|
||||
|
||||
@Value("${cool.log.maxJsonLength:1024}")
|
||||
private int maxJsonLength;
|
||||
|
||||
@Override
|
||||
public Object page(
|
||||
JSONObject requestParams, Page<BaseSysLogEntity> page, QueryWrapper queryWrapper) {
|
||||
@@ -76,7 +80,10 @@ public class BaseSysLogServiceImpl extends BaseServiceImpl<BaseSysLogMapper, Bas
|
||||
newJSONObject.remove("tokenInfo");
|
||||
newJSONObject.remove("refreshToken");
|
||||
newJSONObject.remove("body");
|
||||
|
||||
if (newJSONObject.toString().getBytes().length > maxJsonLength) {
|
||||
// 超过指定
|
||||
newJSONObject.clear();
|
||||
}
|
||||
recordAsync(requestURI, ipAddr, userId, newJSONObject);
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user