Skip to content

Commit 417a3e4

Browse files
colorful3towelongdependabot[bot]华钦dengliming
authored
Dev (#303)
* 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 字段,作为删除标识 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 faccb4b commit 417a3e4

File tree

15 files changed

+64
-37
lines changed

15 files changed

+64
-37
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,17 @@ public class LoginCaptchaProperties {
2020
/**
2121
* aes 密钥
2222
*/
23-
private String secret;
23+
private String secret = CaptchaUtil.getRandomString(32);
2424
/**
2525
* aes 偏移量
2626
*/
27-
private String iv;
27+
private String iv = CaptchaUtil.getRandomString(16);
2828
/**
2929
* 启用验证码
3030
*/
3131
private Boolean enabled = Boolean.FALSE;
3232

3333
public void setSecret(String secret) {
34-
this.secret = CaptchaUtil.getRandomString(32);
3534
if (StringUtils.hasText(secret)) {
3635
byte[] bytes = secret.getBytes();
3736
if (bytes.length == 16 || bytes.length == 24 || bytes.length == 32) {
@@ -43,7 +42,6 @@ public void setSecret(String secret) {
4342
}
4443

4544
public void setIv(String iv) {
46-
this.iv = CaptchaUtil.getRandomString(16);
4745
if (StringUtils.hasText(iv)) {
4846
byte[] bytes = iv.getBytes();
4947
if (bytes.length == 16) {

src/main/java/io/github/talelin/latticy/model/BaseModel.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ public class BaseModel {
2222
@JsonIgnore
2323
private Date updateTime;
2424

25-
@TableLogic
2625
@JsonIgnore
2726
private Date deleteTime;
27+
28+
@TableLogic
29+
@JsonIgnore
30+
private Boolean isDeleted;
2831
}

src/main/java/io/github/talelin/latticy/module/file/AbstractUploader.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import java.util.ArrayList;
88
import java.util.List;
99
import java.util.UUID;
10+
import java.util.concurrent.atomic.AtomicInteger;
1011

1112
/**
1213
* 文件上传类的基类
@@ -128,7 +129,13 @@ protected void checkFileMap(MultiValueMap<String, MultipartFile> fileMap) {
128129
throw new NotFoundException(10026);
129130
}
130131
int nums = getFileProperties().getNums();
131-
if (fileMap.size() > nums) {
132+
AtomicInteger sizes = new AtomicInteger();
133+
fileMap.keySet().forEach(key -> fileMap.get(key).forEach(file -> {
134+
if (!file.isEmpty()) {
135+
sizes.getAndIncrement();
136+
}
137+
}));
138+
if (sizes.get() > nums) {
132139
throw new FileTooManyException(10121);
133140
}
134141
}

src/main/resources/ValidationMessages.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# \u901A\u7528\u5F02\u5E38\u4FE1\u606F
22
id.positive=id\u5FC5\u987B\u4E3A\u6B63\u6574\u6570
33
page.count.min=\u5206\u9875\u6570\u91CF\u5FC5\u987B\u4E3A\u6B63\u6574\u6570
4-
page.count.max=\u5206\u9875\u6570\u91CF\u5FC5\u987B\u5C0F\u4E8E${value}
4+
page.count.max=\u5206\u9875\u6570\u91CF\u5FC5\u987B\u5C0F\u4E8E{value}
55
page.number.min=\u5206\u9875\u9875\u7801\u5FC5\u987B\u4E3A\u6B63\u6574\u6570
66
# \u5206\u7EC4\u5F02\u5E38\u4FE1\u606F
77
group.id.positive=\u5206\u7EC4id\u5FC5\u987B\u4E3A\u6B63\u6574\u6570

src/main/resources/application-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ auth:
2020

2121
# 开启登录要求验证码
2222
login-captcha:
23-
enabled: true
23+
enabled: false
2424
secret: "m49CPM5ak@MDXTzbbT_ZEyMM3KBsBn!h"
2525

2626
# 开启http请求日志记录

src/main/resources/application.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ mybatis-plus:
2525
banner: false
2626
db-config:
2727
# 逻辑删除(软删除)
28-
logic-delete-value: NOW()
29-
logic-not-delete-value: 'NULL'
28+
logic-delete-value: 1
29+
logic-not-delete-value: 0
3030
# mapper路径位置
3131
mapper-locations: classpath:mapper/*.xml
3232

src/main/resources/code-message.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ code-message[10080]=\u8BF7\u6C42\u65B9\u6CD5\u4E0D\u5141\u8BB8
5555
code-message[10100]=\u5237\u65B0\u4EE4\u724C\u83B7\u53D6\u5931\u8D25
5656
code-message[10110]=\u6587\u4EF6\u4F53\u79EF\u8FC7\u5927
5757
code-message[10120]=\u6587\u4EF6\u6570\u91CF\u8FC7\u591A
58-
code-message[10121]=\u6587\u4EF6\u592A\u591A\uFF0C\u6587\u4EF6\u603B\u6570\u4E0D\u53EF\u8D85\u8FC7${file.nums}
58+
code-message[10121]=\u6587\u4EF6\u592A\u591A\uFF0C\u6587\u4EF6\u603B\u6570\u4E0D\u53EF\u8D85\u8FC7${lin.file.nums}
5959
code-message[10130]=\u6587\u4EF6\u6269\u5C55\u540D\u4E0D\u7B26\u5408\u89C4\u8303
6060
code-message[10140]=\u8BF7\u6C42\u8FC7\u4E8E\u9891\u7E41\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5
6161
code-message[10150]=\u4E22\u5931\u53C2\u6570

src/main/resources/mapper/BookMapper.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
1212
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
1313
<result column="delete_time" jdbcType="TIMESTAMP" property="deleteTime"/>
14+
<result column="is_deleted" property="isDeleted"/>
1415
</resultMap>
1516

1617
<!--CONCAT("%",#{q},"%")-->
@@ -20,14 +21,14 @@
2021
WHERE
2122
b.title LIKE #{q}
2223
AND
23-
b.delete_time IS NULL
24+
b.is_deleted = 0
2425
</select>
2526

2627
<select id="selectByTitle" resultMap="BaseResultMap">
2728
SELECT *
2829
FROM book b
2930
WHERE b.title=#{title}
3031
AND
31-
b.delete_time IS NULL
32+
b.is_deleted = 0
3233
</select>
3334
</mapper>

src/main/resources/mapper/FileMapper.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,23 @@
1414
<result column="create_time" property="createTime"/>
1515
<result column="update_time" property="updateTime"/>
1616
<result column="delete_time" property="deleteTime"/>
17+
<result column="is_deleted" property="isDeleted"/>
1718
</resultMap>
1819

1920
<select id="selectByMd5" parameterType="java.lang.String" resultMap="BaseResultMap">
2021
SELECT *
2122
FROM lin_file f
2223
WHERE
2324
f.md5 = #{md5}
24-
AND f.delete_time IS NULL
25+
AND f.is_deleted = 0
2526
</select>
2627

2728
<select id="selectCountByMd5" parameterType="java.lang.String" resultType="java.lang.Integer">
2829
SELECT COUNT(*)
2930
FROM lin_file f
3031
WHERE
3132
f.md5 = #{md5}
32-
AND f.delete_time IS NULL
33+
AND f.is_deleted = 0
3334
</select>
3435

3536
</mapper>

src/main/resources/mapper/GroupMapper.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<result column="level" property="level" typeHandler="com.baomidou.mybatisplus.core.handlers.MybatisEnumTypeHandler"/>
1111
<result column="create_time" property="createTime"/>
1212
<result column="update_time" property="updateTime"/>
13-
<result column="delete_time" property="deleteTime"/>
13+
<result column="is_deleted" property="isDeleted"/>
1414
</resultMap>
1515

1616

@@ -19,7 +19,7 @@
1919
g.create_time,g.update_time,g.delete_time
2020
from lin_group AS g
2121
WHERE
22-
g.delete_time IS NULL
22+
g.is_deleted = 0
2323
AND
2424
g.id IN
2525
(
@@ -28,15 +28,15 @@
2828
LEFT JOIN lin_user_group as ug
2929
ON ug.user_id = u.id
3030
WHERE u.id = #{userId}
31-
AND u.delete_time IS NULL
31+
AND u.is_deleted = 0
3232
)
3333
</select>
3434

3535
<select id="selectUserGroupIds" parameterType="java.lang.Integer" resultType="java.lang.Integer">
3636
SELECT g.id
3737
from lin_group AS g
3838
WHERE
39-
g.delete_time IS NULL
39+
g.is_deleted = 0
4040
AND
4141
g.id IN
4242
(
@@ -45,12 +45,12 @@
4545
LEFT JOIN lin_user_group as ug
4646
ON ug.user_id = u.id
4747
WHERE u.id = #{userId}
48-
AND u.delete_time IS NULL
48+
AND u.is_deleted = 0
4949
)
5050
</select>
5151

5252
<select id="selectCountById" parameterType="java.lang.Integer" resultType="java.lang.Integer">
53-
SELECT COUNT(*) AS count FROM lin_group WHERE delete_time IS NULL AND id = #{id}
53+
SELECT COUNT(*) AS count FROM lin_group WHERE is_deleted = 0 AND id = #{id}
5454
</select>
5555

5656
<select id="selectCountUserByUserIdAndGroupName" resultType="java.lang.Integer">
@@ -60,7 +60,7 @@
6060
ug.user_id = #{userId}
6161
AND
6262
ug.group_id =
63-
(SELECT g.id FROM lin_group AS g WHERE g.name = #{groupName} AND g.delete_time IS NULL)
63+
(SELECT g.id FROM lin_group AS g WHERE g.name = #{groupName} AND g.is_deleted = 0)
6464
</select>
6565

6666
</mapper>

0 commit comments

Comments
 (0)