Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 支持多源邮件发送,扩展一些接口,使得支持更详细的查询,并修复一些线上的 bug #58

Merged
merged 113 commits into from
Oct 21, 2024
Merged
Changes from 1 commit
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
6b98f02
fix: 调整代码
CarefreeState Sep 30, 2024
0023ccd
fix: 调整代码
CarefreeState Sep 30, 2024
50c36fd
Merge branch 'master' of github.com:AchoBeta/AchoBeta-Recruitment
CarefreeState Sep 30, 2024
ab70592
Merge branch 'master' of github.com:AchoBeta/AchoBeta-Recruitment
CarefreeState Sep 30, 2024
a1b4f27
feat: 整理sql
CarefreeState Sep 30, 2024
97ccce4
fix: 删除无用依赖
CarefreeState Sep 30, 2024
2a794ef
fix: 调整代码
CarefreeState Sep 30, 2024
28f0028
fix: 调整代码
CarefreeState Sep 30, 2024
d59464f
fix: 调整sql
CarefreeState Sep 30, 2024
a35e9d2
fix: 调整sql
CarefreeState Sep 30, 2024
d18a789
Merge branch 'master' of github.com:AchoBeta/AchoBeta-Recruitment
CarefreeState Sep 30, 2024
b440601
fix: 调整sql
CarefreeState Sep 30, 2024
40a8418
Merge branch 'master' of github.com:AchoBeta/AchoBeta-Recruitment
CarefreeState Oct 1, 2024
5980279
Merge branch 'master' of github.com:AchoBeta/AchoBeta-Recruitment
CarefreeState Oct 7, 2024
d8d05f4
fix: 调整一下代码
CarefreeState Oct 7, 2024
abccdee
fix: 调整一下代码
CarefreeState Oct 8, 2024
a09464f
fix: 调整一下代码
CarefreeState Oct 8, 2024
abbf260
fix: 调整一下代码
CarefreeState Oct 8, 2024
882d7f5
fix: 调整一下代码
CarefreeState Oct 8, 2024
429705a
fix: 调整一下代码
CarefreeState Oct 8, 2024
294f034
fix: 调整一下代码
CarefreeState Oct 8, 2024
1f15683
fix: 调整一下代码
CarefreeState Oct 8, 2024
5fc39b8
fix: 使用分布式锁,防止资源的重复上传
CarefreeState Oct 10, 2024
65e784d
fix: 调整代码
CarefreeState Oct 10, 2024
53f39ba
fix: 调整代码
CarefreeState Oct 11, 2024
e9d95e9
fix: 实现图片压缩
CarefreeState Oct 11, 2024
416a0fe
fix: 实现图片压缩
CarefreeState Oct 11, 2024
6a851b5
fix: 跳转代码
CarefreeState Oct 11, 2024
2a49083
fix: 调整代码
CarefreeState Oct 11, 2024
08a133f
fix: 调整代码
CarefreeState Oct 11, 2024
503e0b0
fix: 调整代码
CarefreeState Oct 12, 2024
59eb867
fix: 调整代码
CarefreeState Oct 12, 2024
4127296
fix: 调整代码
CarefreeState Oct 12, 2024
7f1a177
fix: 调整代码
CarefreeState Oct 12, 2024
f52cd57
fix: 调整代码
CarefreeState Oct 12, 2024
cbe6775
fix: 调整代码
CarefreeState Oct 12, 2024
baddcb0
fix: 调整代码
CarefreeState Oct 12, 2024
324ef59
fix: 调整代码
CarefreeState Oct 12, 2024
7dcf857
fix: 调整代码
CarefreeState Oct 12, 2024
77ea812
fix: 调整代码
CarefreeState Oct 12, 2024
35f3fbf
fix: 调整代码
CarefreeState Oct 13, 2024
aab1dc7
fix: 调整代码
CarefreeState Oct 13, 2024
938d97a
fix: 调整代码
CarefreeState Oct 13, 2024
47a3658
feat: 支持多邮件发送源
CarefreeState Oct 13, 2024
b1f5d7a
feat: 支持多邮件发送源
CarefreeState Oct 13, 2024
b2ef655
feat: 支持多邮件发送源
CarefreeState Oct 13, 2024
b052406
feat: 支持多邮件发送源
CarefreeState Oct 13, 2024
264570b
fix: 修复 bug
CarefreeState Oct 13, 2024
a7ca7f1
fix: 调整代码
CarefreeState Oct 13, 2024
63421ba
fix: 调整代码
CarefreeState Oct 13, 2024
4081093
fix: 调整代码
CarefreeState Oct 13, 2024
cd69e7f
fix: 调整代码
CarefreeState Oct 13, 2024
6e7edb4
fix: 调整代码
CarefreeState Oct 14, 2024
865e16e
fix: 调整代码
CarefreeState Oct 14, 2024
4dcf77e
fix: 调整代码
CarefreeState Oct 14, 2024
e982672
fix: 调整代码
CarefreeState Oct 14, 2024
8d3c8d3
fix: 调整代码
CarefreeState Oct 14, 2024
5c5f9eb
fix: 调整代码
CarefreeState Oct 14, 2024
733e28d
fix: 调整代码
CarefreeState Oct 14, 2024
d6dda26
fix: 调整代码
CarefreeState Oct 14, 2024
5592008
fix: 调整代码
CarefreeState Oct 14, 2024
b8258e4
feat: 增加参与情况的条件查询接口
CarefreeState Oct 14, 2024
b0ad528
fix: 删除无用依赖
CarefreeState Oct 14, 2024
eacfa57
fix: 调整代码
CarefreeState Oct 14, 2024
df22afe
fix: 调整代码
CarefreeState Oct 15, 2024
89de8ed
fix: 调整代码
CarefreeState Oct 15, 2024
e9444c6
fix: 调整代码
CarefreeState Oct 15, 2024
2942037
fix: 调整代码
CarefreeState Oct 15, 2024
ceedfd5
fix: 调整代码
CarefreeState Oct 15, 2024
2fbbfc2
fix: 调整代码
CarefreeState Oct 15, 2024
4dedb3e
fix: 调整代码
CarefreeState Oct 15, 2024
1137de4
fix: 调整代码
CarefreeState Oct 15, 2024
9ac4fe1
fix: 调整代码
CarefreeState Oct 15, 2024
e4118f1
fix: 调整代码
CarefreeState Oct 15, 2024
8dbe502
fix: 调整代码
CarefreeState Oct 15, 2024
8ecac40
fix: 调整代码
CarefreeState Oct 15, 2024
82d3d77
fix: 调整代码
CarefreeState Oct 15, 2024
fbbb304
fix: 调整代码
CarefreeState Oct 15, 2024
231af5d
fix: 调整代码
CarefreeState Oct 15, 2024
e71867a
fix: 调整代码
CarefreeState Oct 15, 2024
84f431a
fix: 调整代码
CarefreeState Oct 15, 2024
b106497
fix: 调整代码
CarefreeState Oct 16, 2024
de9cb6a
fix: 调整代码
CarefreeState Oct 16, 2024
00e129a
fix: 扩展接口支持条件查询,调整代码
CarefreeState Oct 16, 2024
2c51669
fix: 调整代码
CarefreeState Oct 16, 2024
82b9cc4
fix: 调整代码
CarefreeState Oct 16, 2024
78c0b9d
feat: docker 基建
BanTanger Oct 16, 2024
9d0825e
feat: docker 基建
BanTanger Oct 16, 2024
7756f86
fix: 调整代码
CarefreeState Oct 16, 2024
308bceb
fix: 使用 redis 锁避免出现问题
CarefreeState Oct 16, 2024
279cd3d
fix: 调整代码
CarefreeState Oct 16, 2024
b1aad57
Update docker-compose.yml
dbinggo Oct 16, 2024
c525635
feat: docker 基建
BanTanger Oct 16, 2024
f97f30f
Merge remote-tracking branch 'origin/feat-bantanger-docker-build' int…
BanTanger Oct 16, 2024
4f1d5e9
feat: 测试 docker minio 数据卷挂载能力,更新 minio 版本至 2024
BanTanger Oct 17, 2024
9390b3c
Merge branch 'feat-bantanger-docker-build' of github.com:AchoBeta/Ach…
CarefreeState Oct 17, 2024
9a8c416
fix: 调整代码
CarefreeState Oct 17, 2024
61981a3
fix: 调整代码
CarefreeState Oct 17, 2024
1d0f86b
fix: 调整代码
CarefreeState Oct 17, 2024
dc4bcfb
fix: 调整代码
CarefreeState Oct 17, 2024
95330f4
fix: 调整代码
CarefreeState Oct 17, 2024
922552f
fix: 调整代码
CarefreeState Oct 17, 2024
f5443fe
fix: 调整代码
CarefreeState Oct 17, 2024
f68e2c6
fix: 调整代码
CarefreeState Oct 17, 2024
7a1275a
fix: 修复一个 bug
CarefreeState Oct 17, 2024
bbd7f4a
fix: 修复一个 bug
CarefreeState Oct 18, 2024
d3e253e
fix: 调整代码
CarefreeState Oct 19, 2024
4939bae
fix: 调整代码
CarefreeState Oct 19, 2024
73ec72d
fix: 调整代码
CarefreeState Oct 19, 2024
a949753
fix: 调整代码
CarefreeState Oct 19, 2024
018be69
fix: 调整代码
CarefreeState Oct 19, 2024
018383d
fix: 调整代码
CarefreeState Oct 21, 2024
4d1410e
fix: 调整代码
CarefreeState Oct 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: 调整一下代码
CarefreeState committed Oct 7, 2024

Verified

This commit was signed with the committer’s verified signature.
Rigidity Rigidity
commit d8d05f4469d524efead58a9ffc7ed149a4eb9ded
Original file line number Diff line number Diff line change
@@ -11,7 +11,6 @@
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

import static com.achobeta.feishu.constants.FeishuConstants.SHOULD_REFRESH_CODE;
import static com.achobeta.feishu.constants.FeishuConstants.SUCCESS_CODE;

/**
@@ -43,10 +42,8 @@ public void doAfterReturning(Object result) {
if(code == SUCCESS_CODE) {
log.info("飞书请求成功");
} else {
if(code == SHOULD_REFRESH_CODE) {
log.info("飞书 token 刷新");
feishuTenantAccessToken.refreshToken();
}
log.info("飞书 token 刷新");
feishuTenantAccessToken.refreshToken();
throw new GlobalServiceException(response.getMsg(), GlobalServiceStatusCode.REQUEST_NOT_VALID);
}
}else {
Original file line number Diff line number Diff line change
@@ -36,8 +36,6 @@ public interface FeishuConstants {

int SUCCESS_CODE = 0;

int SHOULD_REFRESH_CODE = 4001;

static String getAuthorization(String accessToken) {
return Optional.ofNullable(accessToken)
.map(token -> AUTHORIZATION_PREFIX + token)
Original file line number Diff line number Diff line change
@@ -30,18 +30,13 @@ public class FeishuTenantAccessToken {

private volatile String tenantAccessToken;

private volatile Integer expire;


private long compareToNow(int tokenExpire) {
return TimeUtil.millisToSecond(tokenExpire) - System.currentTimeMillis();
}
private volatile Long expire;

private boolean shouldRefresh() {
return !StringUtils.hasText(tenantAccessToken) || Optional.ofNullable(expire)
// 这里判断的一般是准确的,如果非本类请求到的 token,可能会出现到期前三十分钟获取另一个 token,那也不影响这个 token 的有效性
.filter(tokenExpire -> compareToNow(tokenExpire) > 0)
.isPresent();
.filter(tokenExpire -> tokenExpire - System.currentTimeMillis() > 0)
.isEmpty();
}

public void refreshToken() {
@@ -68,7 +63,7 @@ public void refreshToken() {
null
);
this.tenantAccessToken = responseBody.getTenantAccessToken();
this.expire = responseBody.getExpire();
this.expire = TimeUtil.secondToMillis(responseBody.getExpire()) + System.currentTimeMillis();
}

public String getToken() {