Compare commits

...

7 Commits

Author SHA1 Message Date
曾文豪
2d8208e4dc publish 2.0.27
All checks were successful
/ local-deploy (push) Successful in 8m4s
2025-04-24 11:39:20 +08:00
曾文豪
c4ba637de7 build(springboot-util & springboot-web): 升级依赖版本 2025-04-24 11:38:56 +08:00
曾文豪
7b0b9e0925 feat(core-log): 添加操作日志时指定创建时间 2025-04-24 10:14:29 +08:00
曾文豪
463ddf1b1e publish 2.0.26
All checks were successful
/ local-deploy (push) Successful in 18s
2025-04-22 13:41:17 +08:00
曾文豪
6fdc69fc2d publish 2.0.25
All checks were successful
/ local-deploy (push) Successful in 19s
2025-04-22 13:33:29 +08:00
曾文豪
fde73e57b9 feat(cache): 添加重复操作检查功能 2025-04-22 13:32:58 +08:00
曾文豪
8a517b09fd fix(web): 修复 CoreConfigService 中的空值问题 2025-04-09 15:05:20 +08:00
14 changed files with 78 additions and 26 deletions

18
pom.xml
View File

@@ -6,7 +6,7 @@
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>2.0.24</version>
<version>2.0.27</version>
<packaging>pom</packaging>
<name>springboot-parent</name>
<description>杭州铁晟科技有限公司基础依赖</description>
@@ -58,49 +58,49 @@
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-database</artifactId>
<version>2.0.24</version>
<version>2.0.27</version>
</dependency>
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-login</artifactId>
<version>2.0.24</version>
<version>2.0.27</version>
</dependency>
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-web</artifactId>
<version>2.0.24</version>
<version>2.0.27</version>
</dependency>
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-util</artifactId>
<version>2.0.24</version>
<version>2.0.27</version>
</dependency>
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-platform</artifactId>
<version>2.0.24</version>
<version>2.0.27</version>
</dependency>
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-message</artifactId>
<version>2.0.24</version>
<version>2.0.27</version>
</dependency>
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-role</artifactId>
<version>2.0.24</version>
<version>2.0.27</version>
</dependency>
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-annotation</artifactId>
<version>2.0.24</version>
<version>2.0.27</version>
</dependency>
<dependency>

View File

@@ -6,11 +6,11 @@
<parent>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>2.0.24</version>
<version>2.0.27</version>
</parent>
<artifactId>springboot-ademo</artifactId>
<version>2.0.24</version>
<version>2.0.27</version>
<properties>
<maven.compiler.source>8</maven.compiler.source>

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>2.0.24</version>
<version>2.0.27</version>
</parent>
<artifactId>springboot-annotation</artifactId>

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>2.0.24</version>
<version>2.0.27</version>
</parent>
<artifactId>springboot-database</artifactId>

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>2.0.24</version>
<version>2.0.27</version>
</parent>
<artifactId>springboot-login</artifactId>

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>2.0.24</version>
<version>2.0.27</version>
</parent>
<artifactId>springboot-message</artifactId>

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>2.0.24</version>
<version>2.0.27</version>
</parent>
<artifactId>springboot-platform</artifactId>

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>2.0.24</version>
<version>2.0.27</version>
</parent>
<artifactId>springboot-role</artifactId>

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>2.0.24</version>
<version>2.0.27</version>
</parent>
<artifactId>springboot-util</artifactId>
@@ -82,7 +82,7 @@
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.30</version>
<version>8.0.33</version>
</dependency>
<dependency>
@@ -107,7 +107,7 @@
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15to18</artifactId>
<version>1.68</version>
<version>1.80</version>
</dependency>
<dependency>

View File

@@ -1,7 +1,6 @@
package com.tiesheng.util.service;
import cn.hutool.core.util.StrUtil;
import cn.hutool.extra.servlet.ServletUtil;
import cn.hutool.extra.spring.SpringUtil;
import com.alibaba.fastjson.JSON;
import com.tiesheng.util.ServletKit;
@@ -10,6 +9,7 @@ import com.tiesheng.util.service.cache.TsCacheHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Objects;
import java.util.Set;
@Service
@@ -92,4 +92,20 @@ public class TsCacheService {
remove(captchaKey);
}
/**
* 验证是否重复操作
*
* @param key
* @param value
* @param seconds
*/
public void checkRepeat(String key, String value, int seconds) {
String s = get(key);
if (StrUtil.isNotEmpty(s) && Objects.equals(s, value)) {
throw new ApiException("操作频繁,请稍后再试");
}
put(key, value, seconds);
}
}

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>2.0.24</version>
<version>2.0.27</version>
</parent>
<artifactId>springboot-web</artifactId>
@@ -30,9 +30,39 @@
<artifactId>spring-boot-starter-json</artifactId>
<groupId>org.springframework.boot</groupId>
</exclusion>
<exclusion>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-el</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-websocket</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>9.0.104</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-el</artifactId>
<version>9.0.104</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-websocket</artifactId>
<version>9.0.104</version>
</dependency>
<!-- aspect -->
<dependency>
<groupId>org.springframework.boot</groupId>

View File

@@ -1,6 +1,8 @@
package com.tiesheng.web.config.operation;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.StrUtil;
@@ -56,6 +58,8 @@ public class OperationAspect {
@Around("methodArgs()")
public Object around(ProceedingJoinPoint joinPoint) throws Throwable {
DateTime crateTime = DateUtil.date();
HttpServletRequest request = ServletKit.getRequest();
if (request == null) {
return joinPoint.proceed();
@@ -115,7 +119,7 @@ public class OperationAspect {
}
}
coreLogService.addOperationLog(
coreLogService.addOperationLog(crateTime,
tsTokenConfig.validToken(request, false), title, subject, reqMaps);
return response;

View File

@@ -1,5 +1,6 @@
package com.tiesheng.web.service;
import cn.hutool.core.util.StrUtil;
import com.tiesheng.util.exception.ApiException;
import com.tiesheng.util.service.TsCacheService;
import com.tiesheng.util.service.TsServiceBase;
@@ -41,7 +42,7 @@ public class CoreConfigService extends TsServiceBase<CoreConfigSystemMapper, Cor
CoreConfigSystem oneByColumn = tsCacheService.getObj(CONFIG_SYSTEM_PREFIX + configKey,
CoreConfigSystem.class, -1);
if (oneByColumn != null) {
if (oneByColumn != null && StrUtil.isNotEmpty(oneByColumn.getConfigVal())) {
return oneByColumn;
}

View File

@@ -23,6 +23,7 @@ import com.tiesheng.web.util.ProcessSyncConsumer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
@@ -154,7 +155,7 @@ public class CoreLogService extends TsServiceBase<CoreLogOperationMapper, CoreLo
/**
* 添加操作日志
*/
public void addOperationLog(TokenBean tokenBean, String title, String subject, Object params) {
public void addOperationLog(Date createTime, TokenBean tokenBean, String title, String subject, Object params) {
if (tokenBean == null || StrUtil.isEmpty(tokenBean.getId())) {
return;
@@ -165,7 +166,7 @@ public class CoreLogService extends TsServiceBase<CoreLogOperationMapper, CoreLo
}
CoreLogOperation operation = new CoreLogOperation();
operation.setCreateTime(DateUtil.date());
operation.setCreateTime(createTime);
operation.setUpdateTime(DateUtil.date());
operation.setUserId(requestUserInfo.getId());
operation.setUserName(requestUserInfo.getName());