Skip to content

Commit 82d8dc3

Browse files
committed
build: continew-starter 2.10.0 => 2.11.0
1.SaToken 升级适配 2.DictField 注解 => DictModel 3.BaseIdResp => IdResp 4.CRUD 删除接口由 URL 传参重构为请求体传参 5.访问日志打印问题修复等
1 parent 240d6fc commit 82d8dc3

File tree

15 files changed

+47
-54
lines changed

15 files changed

+47
-54
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<img src="https://img.shields.io/badge/SNAPSHOT-v3.6.0-%23ff3f59.svg" alt="Release" />
55
</a>
66
<a href="https://github.com/continew-org/continew-starter" title="ContiNew Starter" target="_blank">
7-
<img src="https://img.shields.io/badge/ContiNew Starter-2.10.0-%236CB52D.svg" alt="ContiNew Starter" />
7+
<img src="https://img.shields.io/badge/ContiNew Starter-2.11.0-%236CB52D.svg" alt="ContiNew Starter" />
88
</a>
99
<a href="https://spring.io/projects/spring-boot" title="Spring Boot" target="_blank">
1010
<img src="https://img.shields.io/badge/Spring Boot-3.3.9-%236CB52D.svg?logo=Spring-Boot" alt="Spring Boot" />
@@ -225,16 +225,16 @@ public class DeptController extends BaseController<DeptService, DeptResp, DeptDe
225225

226226
## 核心技术栈
227227

228-
| 名称 | 版本 | 简介 |
229-
| :----------------------------------------------------------- | :----------- | :----------------------------------------------------------- |
228+
| 名称 | 版本 | 简介 |
229+
| :----------------------------------------------------------- |:-------------| :----------------------------------------------------------- |
230230
| <a href="https://vuejs.org/" target="_blank">Vue</a> | 3.5.4 | 渐进式 JavaScript 框架,易学易用,性能出色,适用场景丰富的 Web 前端框架。 |
231231
| <a href="https://arco.design/vue/docs/start" target="_blank">Arco Design</a> | 2.57.0 | 字节跳动推出的前端 UI 框架,年轻化的色彩和组件设计。 |
232232
| <a href="https://www.typescriptlang.org/zh/" target="_blank">TypeScript</a> | 5.0.4 | TypeScript 是微软开发的一个开源的编程语言,通过在 JavaScript 的基础上添加静态类型定义构建而成。 |
233233
| <a href="https://vite.dev/" target="_blank">Vite</a> | 5.1.5 | 下一代的前端工具链,为开发提供极速响应。 |
234-
| [ContiNew Starter](https://github.com/continew-org/continew-starter) | 2.10.0 | ContiNew Starter 包含了一系列经过企业实践优化的依赖包(如 MyBatis-Plus、SaToken),可轻松集成到应用中,为开发人员减少手动引入依赖及配置的麻烦,为 Spring Boot Web 项目的灵活快速构建提供支持。 |
234+
| [ContiNew Starter](https://github.com/continew-org/continew-starter) | 2.11.0 | ContiNew Starter 包含了一系列经过企业实践优化的依赖包(如 MyBatis-Plus、SaToken),可轻松集成到应用中,为开发人员减少手动引入依赖及配置的麻烦,为 Spring Boot Web 项目的灵活快速构建提供支持。 |
235235
| <a href="https://spring.io/projects/spring-boot" target="_blank">Spring Boot</a> | 3.3.9 | 简化 Spring 应用的初始搭建和开发过程,基于“约定优于配置”的理念,使开发人员不再需要定义样板化的配置。(Spring Boot 3.0 开始,要求 Java 17 作为最低版本) |
236236
| <a href="https://undertow.io/" target="_blank">Undertow</a> | 2.3.18.Final | 采用 Java 开发的灵活的高性能 Web 服务器,提供包括阻塞和基于 NIO 的非堵塞机制。 |
237-
| <a href="https://sa-token.dev33.cn/" target="_blank">Sa-Token + JWT</a> | 1.40.0 | 轻量级 Java 权限认证框架,让鉴权变得简单、优雅。 |
237+
| <a href="https://sa-token.dev33.cn/" target="_blank">Sa-Token + JWT</a> | 1.41.0 | 轻量级 Java 权限认证框架,让鉴权变得简单、优雅。 |
238238
| <a href="https://baomidou.com/" target="_blank">MyBatis Plus</a> | 3.5.8 | MyBatis 的增强工具,在 MyBatis 的基础上只做增强不做改变,简化开发、提高效率。 |
239239
| <a href="https://www.kancloud.cn/tracy5546/dynamic-datasource/2264611" target="_blank">dynamic-datasource-spring-boot-starter</a> | 4.3.1 | 基于 Spring Boot 的快速集成多数据源的启动器。 |
240240
| Hikari | 5.1.0 | JDBC 连接池,号称 “史上最快连接池”,SpringBoot 在 2.0 之后,采用的默认数据库连接池就是 Hikari。 |

continew-module-system/src/main/java/top/continew/admin/auth/AbstractLoginHandler.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
package top.continew.admin.auth;
1818

19-
import cn.dev33.satoken.stp.SaLoginModel;
2019
import cn.dev33.satoken.stp.StpUtil;
20+
import cn.dev33.satoken.stp.parameter.SaLoginParameter;
2121
import cn.hutool.core.bean.BeanUtil;
2222
import jakarta.annotation.Resource;
2323
import jakarta.servlet.http.HttpServletRequest;
@@ -38,7 +38,7 @@
3838
import top.continew.admin.system.service.UserService;
3939
import top.continew.starter.core.validation.CheckUtils;
4040
import top.continew.starter.core.validation.Validator;
41-
import top.continew.starter.web.util.SpringWebUtils;
41+
import top.continew.starter.web.util.ServletUtils;
4242

4343
import java.util.Set;
4444
import java.util.concurrent.CompletableFuture;
@@ -101,16 +101,16 @@ protected String authenticate(UserDO user, ClientResp client) {
101101
.join(), passwordExpirationDaysFuture.join());
102102
BeanUtil.copyProperties(user, userContext);
103103
// 设置登录配置参数
104-
SaLoginModel model = new SaLoginModel();
105-
model.setActiveTimeout(client.getActiveTimeout());
106-
model.setTimeout(client.getTimeout());
107-
model.setDevice(client.getClientType());
104+
SaLoginParameter loginParameter = new SaLoginParameter();
105+
loginParameter.setActiveTimeout(client.getActiveTimeout());
106+
loginParameter.setTimeout(client.getTimeout());
107+
loginParameter.setDeviceType(client.getClientType());
108108
userContext.setClientType(client.getClientType());
109-
model.setExtra(CLIENT_ID, client.getClientId());
109+
loginParameter.setExtra(CLIENT_ID, client.getClientId());
110110
userContext.setClientId(client.getClientId());
111111
// 登录并缓存用户信息
112-
StpUtil.login(userContext.getId(), model.setExtraData(BeanUtil.beanToMap(new UserExtraContext(SpringWebUtils
113-
.getRequest()))));
112+
StpUtil.login(userContext.getId(), loginParameter.setExtraData(BeanUtil
113+
.beanToMap(new UserExtraContext(ServletUtils.getRequest()))));
114114
UserContextHolder.setContext(userContext);
115115
return StpUtil.getTokenValue();
116116
}

continew-module-system/src/main/java/top/continew/admin/auth/handler/SocialLoginHandler.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import cn.hutool.core.util.RandomUtil;
2424
import cn.hutool.core.util.ReUtil;
2525
import cn.hutool.json.JSONUtil;
26-
import com.xkcoding.justauth.AuthRequestFactory;
2726
import com.xkcoding.justauth.autoconfigure.JustAuthProperties;
2827

2928
import jakarta.servlet.http.HttpServletRequest;
@@ -108,7 +107,7 @@ public LoginResp login(SocialLoginReq req, ClientResp client, HttpServletRequest
108107
user = new UserDO();
109108
user.setUsername(username);
110109
user.setNickname(nickname);
111-
if(Objects.nonNull(authUser.getGender())) {
110+
if (Objects.nonNull(authUser.getGender())) {
112111
user.setGender(GenderEnum.valueOf(authUser.getGender().name()));
113112
}
114113
user.setAvatar(authUser.getAvatar());
@@ -157,11 +156,7 @@ public AuthTypeEnum getAuthType() {
157156
private AuthRequest getAuthRequest(String source) {
158157
try {
159158
AuthConfig authConfig = authProperties.getType().get(source.toUpperCase());
160-
return AuthRequestBuilder
161-
.builder()
162-
.source(source)
163-
.authConfig(authConfig)
164-
.build();
159+
return AuthRequestBuilder.builder().source(source).authConfig(authConfig).build();
165160
} catch (Exception e) {
166161
throw new BadRequestException("暂不支持 [%s] 平台账号登录".formatted(source));
167162
}

continew-module-system/src/main/java/top/continew/admin/system/config/file/FileRecorderImpl.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ public class FileRecorderImpl implements FileRecorder {
5656

5757
/**
5858
* 文件信息存储
59+
*
5960
* @param fileInfo 文件信息对象
6061
* @return 是否保存成功
6162
*/
@@ -67,8 +68,8 @@ public boolean save(FileInfo fileInfo) {
6768
fileInfo.setId(String.valueOf(id.longValue()));
6869
String originalFilename = EscapeUtil.unescape(fileInfo.getOriginalFilename());
6970
file.setName(StrUtil.contains(originalFilename, StringConstants.DOT)
70-
? StrUtil.subBefore(originalFilename, StringConstants.DOT, true)
71-
: originalFilename);
71+
? StrUtil.subBefore(originalFilename, StringConstants.DOT, true)
72+
: originalFilename);
7273
StorageDO storage = (StorageDO)fileInfo.getAttr().get(ClassUtil.getClassName(StorageDO.class, false));
7374
String domain = StrUtil.appendIfMissing(storage.getDomain(), StringConstants.SLASH);
7475
// 处理fileInfo中存储的地址

continew-module-system/src/main/java/top/continew/admin/system/model/entity/DictDO.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import com.baomidou.mybatisplus.annotation.TableName;
2020
import lombok.Data;
21-
import top.continew.starter.extension.crud.annotation.DictField;
21+
import top.continew.starter.extension.crud.annotation.DictModel;
2222
import top.continew.admin.common.model.entity.BaseDO;
2323

2424
import java.io.Serial;
@@ -30,7 +30,7 @@
3030
* @since 2023/9/11 21:29
3131
*/
3232
@Data
33-
@DictField(valueKey = "code")
33+
@DictModel(valueKey = "code")
3434
@TableName("sys_dict")
3535
public class DictDO extends BaseDO {
3636

continew-module-system/src/main/java/top/continew/admin/system/model/entity/RoleDO.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
import com.baomidou.mybatisplus.annotation.TableName;
2020
import lombok.Data;
2121
import top.continew.admin.common.enums.DataScopeEnum;
22-
import top.continew.starter.extension.crud.annotation.DictField;
2322
import top.continew.admin.common.model.entity.BaseDO;
23+
import top.continew.starter.extension.crud.annotation.DictModel;
2424

2525
import java.io.Serial;
2626

@@ -31,7 +31,7 @@
3131
* @since 2023/2/8 22:54
3232
*/
3333
@Data
34-
@DictField
34+
@DictModel
3535
@TableName("sys_role")
3636
public class RoleDO extends BaseDO {
3737

continew-module-system/src/main/java/top/continew/admin/system/model/entity/user/UserDO.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import top.continew.admin.common.config.mybatis.BCryptEncryptor;
2424
import top.continew.admin.common.enums.DisEnableStatusEnum;
2525
import top.continew.admin.common.enums.GenderEnum;
26-
import top.continew.starter.extension.crud.annotation.DictField;
26+
import top.continew.starter.extension.crud.annotation.DictModel;
2727
import top.continew.admin.common.model.entity.BaseDO;
2828
import top.continew.starter.security.crypto.annotation.FieldEncrypt;
2929

@@ -37,7 +37,7 @@
3737
* @since 2022/12/21 20:42
3838
*/
3939
@Data
40-
@DictField(labelKey = "nickname", extraKeys = {"username"})
40+
@DictModel(labelKey = "nickname", extraKeys = {"username"})
4141
@TableName("sys_user")
4242
public class UserDO extends BaseDO {
4343

continew-module-system/src/main/java/top/continew/admin/system/service/impl/MessageUserServiceImpl.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,6 @@ public void add(Long messageId, List<Long> userIdList) {
8080

8181
@Override
8282
public void readMessage(List<Long> ids) {
83-
if (CollUtil.isEmpty(ids)) {
84-
return;
85-
}
8683
baseMapper.lambdaUpdate()
8784
.set(MessageUserDO::getIsRead, true)
8885
.set(MessageUserDO::getReadTime, LocalDateTime.now())

continew-plugin/continew-plugin-generator/src/main/resources/templates/frontend/api.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export function update${classNamePrefix}(data: any, id: string) {
5757

5858
/** @desc 删除${businessName} */
5959
export function delete${classNamePrefix}(id: string) {
60-
return http.del(`${'$'}{BASE_URL}/${'$'}{id}`)
60+
return http.del(`${'$'}{BASE_URL}/`, { ids: [id] })
6161
}
6262

6363
/** @desc 导出${businessName} */

continew-plugin/continew-plugin-open/src/main/java/top/continew/admin/open/sign/OpenApiSignTemplate.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package top.continew.admin.open.sign;
1818

19+
import cn.dev33.satoken.secure.SaSecureUtil;
1920
import cn.dev33.satoken.sign.SaSignTemplate;
2021
import lombok.RequiredArgsConstructor;
2122
import org.springframework.stereotype.Component;
@@ -71,6 +72,6 @@ public String createSign(Map<String, ?> paramMap) {
7172
// 移除 sign 参数
7273
paramMap.remove(sign);
7374
// 计算签名
74-
return super.abstractStr(super.joinParamsDictSort(paramMap));
75+
return SaSecureUtil.md5(super.joinParamsDictSort(paramMap));
7576
}
7677
}

0 commit comments

Comments
 (0)