Skip to content

Commit 3fc25bd

Browse files
colorful3towelongdependabot[bot]华钦dengliming
authored
Dev (#314)
* Refactor/replace deprecated usage (#236) * chore: 修正README锚点不跳转的问题 * fix:#190 * fix:#184 * chore(deps-dev): bump freemarker from 2.3.30 to 2.3.31 Bumps freemarker from 2.3.30 to 2.3.31. Signed-off-by: dependabot[bot] <[email protected]> * chore(deps): bump lin-cms-spring-boot-starter Bumps [lin-cms-spring-boot-starter](https://github.com/TaleLin/lin-cms-java-core) from 0.2.0-RC2 to 0.2.0-RELEASE. - [Release notes](https://github.com/TaleLin/lin-cms-java-core/releases) - [Commits](https://github.com/TaleLin/lin-cms-java-core/commits) Signed-off-by: dependabot[bot] <[email protected]> * Chore/upgrade version (#200) * chore: 修正README锚点不跳转的问题 * fix:#190 * fix:#184 * chore: 升级主工程以及核心库版本号 Co-authored-by: ToWeLong <[email protected]> * chore(deps): bump spring-boot-starter-parent from 2.4.3 to 2.5.0 Bumps [spring-boot-starter-parent](https://github.com/spring-projects/spring-boot) from 2.4.3 to 2.5.0. - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](spring-projects/spring-boot@v2.4.3...v2.5.0) Signed-off-by: dependabot[bot] <[email protected]> * Dev (#226) * chore(deps): bump spring-boot-starter-parent from 2.5.0 to 2.5.2 (#220) Bumps [spring-boot-starter-parent](https://github.com/spring-projects/spring-boot) from 2.5.0 to 2.5.2. - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](spring-projects/spring-boot@v2.5.0...v2.5.2) --- updated-dependencies: - dependency-name: org.springframework.boot:spring-boot-starter-parent dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * refactor: optimize ci action config * Update maven.yml * Update maven.yml * fix issue #131 * chore(deps): bump qiniu-java-sdk from 7.4.0 to 7.8.0 Bumps [qiniu-java-sdk](https://github.com/qiniu/java-sdk) from 7.4.0 to 7.8.0. - [Release notes](https://github.com/qiniu/java-sdk/releases) - [Changelog](https://github.com/qiniu/java-sdk/blob/master/CHANGELOG.md) - [Commits](qiniu/java-sdk@v7.4.0...v7.8.0) --- updated-dependencies: - dependency-name: com.qiniu:qiniu-java-sdk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * Chore/replace expired configurations (#222) * chore: 修正README锚点不跳转的问题 * fix:#190 * fix:#184 * chore: 替换过期的配置项 * test: 临时解决 CI 单元测试异常(原因未明) Co-authored-by: ToWeLong <[email protected]> Co-authored-by: 华钦 <[email protected]> * Docs/upgrade readme (#225) * chore: 修正README锚点不跳转的问题 * fix:#190 * fix:#184 * docs: 更新 readme 中 springboot 版本号 Co-authored-by: ToWeLong <[email protected]> Co-authored-by: 华钦 <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dengliming <[email protected]> Co-authored-by: fuhao <[email protected]> Co-authored-by: ToWeLong <[email protected]> Co-authored-by: 华钦 <[email protected]> * refactor: 替换jackson已过期的配置引用 Co-authored-by: ToWeLong <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: 华钦 <[email protected]> Co-authored-by: dengliming <[email protected]> Co-authored-by: fuhao <[email protected]> * chore(pom.xml): 升级框架版本为0.2.1-RELEASE * fix #223 & test去除deprecated api等问题修复 * fix: #247 * fix: 反代后IP获取错误 * feat: 登录验证码 * fix: 无用字段 * fix: 不开启验证码时要求header的错误 * fix: sout clean * fix: aes192 to 256 * fix: 修复错误修改的配置 * fix: 增加aes配置校验,避免输入参数不合法 * fix: 部分情况下fileMap.size()不可靠&校验信息不需要${} * fix: 属性前缀 * fix: fix #264 配置文件中未配置字段时,spring不会调用set方法 * chore(application-dev.yml): 默认关闭验证码 * refactor: 数据库新增 is_deleted 字段,作为删除标识 * refactor: non null copy (#300) * Refactor/code specification (#312) * refactor: 数据库新增 is_deleted 字段,作为删除标识 * refactor: 整理代码规范 * refactor: 整理代码规范 Co-authored-by: ToWeLong <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: 华钦 <[email protected]> Co-authored-by: dengliming <[email protected]> Co-authored-by: fuhao <[email protected]> Co-authored-by: Gadfly <[email protected]>
1 parent 417a3e4 commit 3fc25bd

File tree

103 files changed

+533
-202
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+533
-202
lines changed

src/main/java/io/github/talelin/latticy/LatticyApplication.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
/**
1010
* @author pedro@TaleLin
11+
* 启动入口类
1112
*/
1213
@RestController
1314
@MapperScan(basePackages = {"io.github.talelin.latticy.mapper"})

src/main/java/io/github/talelin/latticy/bo/GroupPermissionBO.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* @author pedro@TaleLin
1414
* @author Juzi@TaleLin
1515
* @author colorful@TaleLin
16+
* 分组权限业务对象
1617
*/
1718
@Data
1819
@NoArgsConstructor

src/main/java/io/github/talelin/latticy/bo/LoginCaptchaBO.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
/**
88
* @author Gadfly
99
* @since 2021-11-19 15:20
10+
* 登录验证码业务对象
1011
*/
1112
@Data
1213
@NoArgsConstructor

src/main/java/io/github/talelin/latticy/common/LocalUser.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,25 @@
33
import io.github.talelin.latticy.model.UserDO;
44

55
/**
6-
* 线程安全的当前登录用户,如果用户为登录,则得到 null
6+
* 线程安全的当前登录用户,如果用户未登录,则得到 null
77
*
88
* @author pedro@TaleLin
99
*/
1010
public class LocalUser {
1111

12-
private static ThreadLocal<UserDO> local = new ThreadLocal<>();
12+
private LocalUser() {
13+
throw new IllegalStateException("Utility class");
14+
}
15+
16+
private static final ThreadLocal<UserDO> LOCAL = new ThreadLocal<>();
1317

1418
/**
1519
* 得到当前登录用户
1620
*
1721
* @return user | null
1822
*/
1923
public static UserDO getLocalUser() {
20-
return LocalUser.local.get();
24+
return LocalUser.LOCAL.get();
2125
}
2226

2327
/**
@@ -26,17 +30,17 @@ public static UserDO getLocalUser() {
2630
* @param user user
2731
*/
2832
public static void setLocalUser(UserDO user) {
29-
LocalUser.local.set(user);
33+
LocalUser.LOCAL.set(user);
3034
}
3135

3236
public static <T> T getLocalUser(Class<T> clazz) {
33-
return (T) local.get();
37+
return (T) LOCAL.get();
3438
}
3539

3640
/**
3741
* 清理当前用户
3842
*/
3943
public static void clearLocalUser() {
40-
LocalUser.local.remove();
44+
LOCAL.remove();
4145
}
4246
}

src/main/java/io/github/talelin/latticy/common/aop/ResultAspect.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import org.springframework.util.StringUtils;
99

1010
/**
11-
* 处理返回结果为 UnifyResponseVO 的 Controller
11+
* 处理返回结果为 UnifyResponseVO 的控制器层方法
1212
* message 默认为 null,在此处通过 code 设置为对应消息
1313
*
1414
* @author pedro@TaleLin

src/main/java/io/github/talelin/latticy/common/configuration/CodeMessageConfiguration.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
/**
1111
* @author pedro@TaleLin
12+
*
13+
* 消息码配置类
1214
*/
1315
@SuppressWarnings("ConfigurationProperties")
1416
@Component

src/main/java/io/github/talelin/latticy/common/configuration/CommonConfiguration.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
/**
1919
* @author pedro@TaleLin
2020
* @author colorful@TaleLin
21+
*
22+
* 公共配置
2123
*/
2224
@Configuration(proxyBeanMethods = false)
2325
public class CommonConfiguration {
@@ -29,8 +31,6 @@ public RequestLogInterceptor requestLogInterceptor() {
2931

3032
/**
3133
* 新的分页插件,一缓和二缓遵循mybatis的规则
32-
* 需要设置 MybatisConfiguration#useDeprecatedExecutor = false 避免缓存出现问题(该属性会在旧插件移除后一同移除)
33-
* 参考链接:https://mp.baomidou.com/guide/interceptor.html
3434
*/
3535
@Bean
3636
public MybatisPlusInterceptor mybatisPlusInterceptor() {
@@ -39,9 +39,6 @@ public MybatisPlusInterceptor mybatisPlusInterceptor() {
3939
return interceptor;
4040
}
4141

42-
/**
43-
* 参考链接:https://mp.baomidou.com/guide/interceptor.html
44-
*/
4542
@Bean
4643
@SuppressWarnings("deprecation")
4744
public ConfigurationCustomizer configurationCustomizer() {
@@ -70,7 +67,6 @@ public PermissionMetaCollector postProcessBeans() {
7067
@Bean
7168
public Jackson2ObjectMapperBuilderCustomizer customJackson() {
7269
return jacksonObjectMapperBuilder -> {
73-
// jacksonObjectMapperBuilder.serializationInclusion(JsonInclude.Include.NON_NULL);
7470
jacksonObjectMapperBuilder.failOnUnknownProperties(false);
7571
jacksonObjectMapperBuilder.propertyNamingStrategy(PropertyNamingStrategies.SNAKE_CASE);
7672
};

src/main/java/io/github/talelin/latticy/common/configuration/CustomServletModelAttributeMethodProcessor.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010

1111
/**
1212
* @author Gadfly
13+
*
14+
* A customizing Servlet-specific ModelAttributeMethodProcessor that applies data binding through
15+
* a WebDataBinder of type CustomServletModelAttributeMethodProcessor.
1316
*/
14-
1517
public class CustomServletModelAttributeMethodProcessor extends ServletModelAttributeMethodProcessor {
1618

1719
public CustomServletModelAttributeMethodProcessor(final boolean annotationNotRequired) {

src/main/java/io/github/talelin/latticy/common/configuration/CustomServletRequestDataBinder.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
/**
1313
* @author Gadfly
14+
*
15+
* 自定义servlet请求参数绑定类
1416
*/
1517

1618
public class CustomServletRequestDataBinder extends ServletRequestDataBinder {

src/main/java/io/github/talelin/latticy/common/configuration/LoginCaptchaProperties.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010

1111
/**
1212
* @author Gadfly
13+
*
14+
* 登录图形验证码配置类
15+
*
1316
*/
1417
@Slf4j
1518
@Getter
@@ -31,9 +34,12 @@ public class LoginCaptchaProperties {
3134
private Boolean enabled = Boolean.FALSE;
3235

3336
public void setSecret(String secret) {
37+
final long ivLen1 = 16;
38+
final long ivLen2 = 24;
39+
final long ivLen3 = 32;
3440
if (StringUtils.hasText(secret)) {
3541
byte[] bytes = secret.getBytes();
36-
if (bytes.length == 16 || bytes.length == 24 || bytes.length == 32) {
42+
if (bytes.length == ivLen1 || bytes.length == ivLen2 || bytes.length == ivLen3) {
3743
this.secret = secret;
3844
} else {
3945
log.warn("AES密钥必须为128/192/256bit,输入的密钥为{}bit,已启用随机密钥{}", bytes.length * 8, this.secret);
@@ -42,9 +48,10 @@ public void setSecret(String secret) {
4248
}
4349

4450
public void setIv(String iv) {
51+
final long ivLen = 16;
4552
if (StringUtils.hasText(iv)) {
4653
byte[] bytes = iv.getBytes();
47-
if (bytes.length == 16) {
54+
if (bytes.length == ivLen) {
4855
this.iv = iv;
4956
} else {
5057
log.warn("AES初始向量必须为128bit,输入的密钥为{}bit,已启用随机向量{}", bytes.length * 8, this.iv);

0 commit comments

Comments
 (0)