From 6b98f0289f97f34ff4017f06588f17c42badb99f Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Mon, 30 Sep 2024 13:32:31 +0800
Subject: [PATCH 001/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../feishu/config/FolderProperties.java | 26 +++++++++++++++++++
.../feishu/config/ResourceProperties.java | 2 ++
.../feishu/constants/FeishuConstants.java | 15 +++++++----
3 files changed, 38 insertions(+), 5 deletions(-)
create mode 100644 src/main/java/com/achobeta/feishu/config/FolderProperties.java
diff --git a/src/main/java/com/achobeta/feishu/config/FolderProperties.java b/src/main/java/com/achobeta/feishu/config/FolderProperties.java
new file mode 100644
index 00000000..83a36a8e
--- /dev/null
+++ b/src/main/java/com/achobeta/feishu/config/FolderProperties.java
@@ -0,0 +1,26 @@
+package com.achobeta.feishu.config;
+
+import com.achobeta.util.HttpRequestUtil;
+import lombok.Data;
+
+/**
+ * Created With Intellij IDEA
+ * Description:
+ * User: 马拉圈
+ * Date: 2024-09-30
+ * Time: 13:21
+ */
+@Data
+public class FolderProperties {
+
+ private String root;
+
+ private String docxResource;
+
+ private String docxCooperate;
+
+ private String sheetResource;
+
+ private String sheetCooperate;
+
+}
diff --git a/src/main/java/com/achobeta/feishu/config/ResourceProperties.java b/src/main/java/com/achobeta/feishu/config/ResourceProperties.java
index 338efb22..66c8aa8f 100644
--- a/src/main/java/com/achobeta/feishu/config/ResourceProperties.java
+++ b/src/main/java/com/achobeta/feishu/config/ResourceProperties.java
@@ -22,4 +22,6 @@ public class ResourceProperties {
private Integer maxCount;
+ private FolderProperties folder;
+
}
diff --git a/src/main/java/com/achobeta/feishu/constants/FeishuConstants.java b/src/main/java/com/achobeta/feishu/constants/FeishuConstants.java
index cd8e0c46..3893e0a2 100644
--- a/src/main/java/com/achobeta/feishu/constants/FeishuConstants.java
+++ b/src/main/java/com/achobeta/feishu/constants/FeishuConstants.java
@@ -1,5 +1,8 @@
package com.achobeta.feishu.constants;
+import cn.hutool.extra.spring.SpringUtil;
+import com.achobeta.feishu.config.FeishuAppConfig;
+import com.achobeta.feishu.config.FolderProperties;
import com.achobeta.util.HttpRequestUtil;
import java.util.Optional;
@@ -13,12 +16,14 @@
*/
public interface FeishuConstants {
- String ACHOBETA_RECRUITMENT_ROOT_FOLDER = "Sx9KfdvAzlY0YudYhEMcziRznpe";
+ FolderProperties ACHOBETA_RESOURCE_FOLDER = SpringUtil.getBean(FeishuAppConfig.class).getResource().getFolder();
+
+ String ACHOBETA_RECRUITMENT_ROOT_FOLDER = ACHOBETA_RESOURCE_FOLDER.getRoot();
String ACHOBETA_RECRUITMENT_ROOT_URL = HttpRequestUtil.buildUrl("https://j16c0vnbedn.feishu.cn/drive/folder/{folderToken}", null, ACHOBETA_RECRUITMENT_ROOT_FOLDER);
- String ACHOBETA_RECRUITMENT_DOCX_FOLDER_RESOURCE = "LpDBf0emllgCc2dKNfKcsqxJnjc";
- String ACHOBETA_RECRUITMENT_SHEET_FOLDER_RESOURCE = "OQbUfIGR9lqdFVdbJCDcQ3CSntd";
- String ACHOBETA_RECRUITMENT_DOCX_FOLDER_COOPERATE = "LpDBf0emllgCc2dKNfKcsqxJnjc";
- String ACHOBETA_RECRUITMENT_SHEET_FOLDER_COOPERATE = "SyBEf61JglcR5NdCp34cs2tGnMd";
+ String ACHOBETA_RECRUITMENT_DOCX_FOLDER_RESOURCE = ACHOBETA_RESOURCE_FOLDER.getDocxResource();
+ String ACHOBETA_RECRUITMENT_SHEET_FOLDER_RESOURCE = ACHOBETA_RESOURCE_FOLDER.getSheetResource();
+ String ACHOBETA_RECRUITMENT_DOCX_FOLDER_COOPERATE = ACHOBETA_RESOURCE_FOLDER.getDocxCooperate();
+ String ACHOBETA_RECRUITMENT_SHEET_FOLDER_COOPERATE = ACHOBETA_RESOURCE_FOLDER.getSheetCooperate();
String AUTHORIZATION_HEADER = "Authorization";
From 0023ccd637b89abcb40a6c7e587b3e80616e2fcf Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Mon, 30 Sep 2024 13:32:53 +0800
Subject: [PATCH 002/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/main/java/com/achobeta/feishu/config/FolderProperties.java | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/main/java/com/achobeta/feishu/config/FolderProperties.java b/src/main/java/com/achobeta/feishu/config/FolderProperties.java
index 83a36a8e..0e6b2cc0 100644
--- a/src/main/java/com/achobeta/feishu/config/FolderProperties.java
+++ b/src/main/java/com/achobeta/feishu/config/FolderProperties.java
@@ -1,6 +1,5 @@
package com.achobeta.feishu.config;
-import com.achobeta.util.HttpRequestUtil;
import lombok.Data;
/**
From a1b4f27d864647de473b7a95f1529d285a5ec80e Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Mon, 30 Sep 2024 22:53:04 +0800
Subject: [PATCH 003/104] =?UTF-8?q?feat:=20=E6=95=B4=E7=90=86sql?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sql/database/achobeta_recruitment.sql | 4 ++
sql/feedback/user_feedback.sql | 22 +++++++
sql/message/message.sql | 8 +--
sql/{ => shortlink}/short_link.sql | 0
.../resume_status_process.sql | 0
sql/{ => student}/stu_attachment.sql | 0
sql/{ => student}/stu_resume.sql | 0
sql/{interview => user}/member.sql | 0
sql/{ => user}/user.sql | 0
.../ext/MessageSendWithEmailHandler.java | 63 ++++++-------------
.../domain/message/model/entity/Message.java | 4 +-
src/main/java/com/achobeta/util/TimeUtil.java | 4 --
12 files changed, 51 insertions(+), 54 deletions(-)
create mode 100644 sql/database/achobeta_recruitment.sql
create mode 100644 sql/feedback/user_feedback.sql
rename sql/{ => shortlink}/short_link.sql (100%)
rename sql/{resumestate => student}/resume_status_process.sql (100%)
rename sql/{ => student}/stu_attachment.sql (100%)
rename sql/{ => student}/stu_resume.sql (100%)
rename sql/{interview => user}/member.sql (100%)
rename sql/{ => user}/user.sql (100%)
diff --git a/sql/database/achobeta_recruitment.sql b/sql/database/achobeta_recruitment.sql
new file mode 100644
index 00000000..0c9ce607
--- /dev/null
+++ b/sql/database/achobeta_recruitment.sql
@@ -0,0 +1,4 @@
+
+drop database if exists achobeta_recruitment;
+create database achobeta_recruitment charset=utf8mb4;
+use achobeta_recruitment;
diff --git a/sql/feedback/user_feedback.sql b/sql/feedback/user_feedback.sql
new file mode 100644
index 00000000..4e27d6f1
--- /dev/null
+++ b/sql/feedback/user_feedback.sql
@@ -0,0 +1,22 @@
+create table user_feedback
+(
+ id bigint auto_increment comment '反馈id' primary key,
+ user_id bigint not null comment '用户id',
+ batch_id bigint not null comment '招新批次',
+ message_id bigint default null comment '处理结果的消息id',
+ title varchar(256) default '' not null comment '反馈标题',
+ content text not null comment '反馈内容',
+ attachment bigint default null comment '附件链接',
+ feedback_time datetime default CURRENT_TIMESTAMP not null comment '反馈时间'
+ is_handle bit default b'0' not null comment '是否处理标记',
+ version int default 1 not null comment '乐观锁',
+ is_deleted bit default b'0' not null comment '伪删除标记',
+ create_time datetime default CURRENT_TIMESTAMP not null comment '插入时间',
+ update_time datetime default CURRENT_TIMESTAMP not null comment '更新时间'
+);
+
+create index idx_batch_id
+ on user_feedback (batch_id);
+
+create index idx_user_id
+ on user_feedback (user_id);
\ No newline at end of file
diff --git a/sql/message/message.sql b/sql/message/message.sql
index 8611a6de..70430dee 100644
--- a/sql/message/message.sql
+++ b/sql/message/message.sql
@@ -24,17 +24,17 @@ DROP TABLE IF EXISTS `message`;
CREATE TABLE `message` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '消息id',
`manager_id` bigint NOT NULL COMMENT '发送消息的管理员id',
- `tittle` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL DEFAULT '' COMMENT '消息标题',
- `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '消息内容',
+ `tittle` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '消息标题',
+ `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '消息内容',
`send_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '发送时间',
`attachment` bigint NULL DEFAULT NULL COMMENT '附件url',
`version` int NOT NULL DEFAULT 0 COMMENT '乐观锁',
`is_deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '伪删除标记',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
- `user_id` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
+ `user_id` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_manager_id`(`manager_id` ASC) USING BTREE
-) ENGINE = InnoDB AUTO_INCREMENT = 4222 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '“活动参与”表' ROW_FORMAT = Dynamic;
+) ENGINE = InnoDB AUTO_INCREMENT = 4222 CHARACTER SET = utf8mb4 COLLATE utf8mb4_bin COMMENT = '“活动参与”表' ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;
diff --git a/sql/short_link.sql b/sql/shortlink/short_link.sql
similarity index 100%
rename from sql/short_link.sql
rename to sql/shortlink/short_link.sql
diff --git a/sql/resumestate/resume_status_process.sql b/sql/student/resume_status_process.sql
similarity index 100%
rename from sql/resumestate/resume_status_process.sql
rename to sql/student/resume_status_process.sql
diff --git a/sql/stu_attachment.sql b/sql/student/stu_attachment.sql
similarity index 100%
rename from sql/stu_attachment.sql
rename to sql/student/stu_attachment.sql
diff --git a/sql/stu_resume.sql b/sql/student/stu_resume.sql
similarity index 100%
rename from sql/stu_resume.sql
rename to sql/student/stu_resume.sql
diff --git a/sql/interview/member.sql b/sql/user/member.sql
similarity index 100%
rename from sql/interview/member.sql
rename to sql/user/member.sql
diff --git a/sql/user.sql b/sql/user/user.sql
similarity index 100%
rename from sql/user.sql
rename to sql/user/user.sql
diff --git a/src/main/java/com/achobeta/domain/message/handler/ext/MessageSendWithEmailHandler.java b/src/main/java/com/achobeta/domain/message/handler/ext/MessageSendWithEmailHandler.java
index 2a43892b..933db5df 100644
--- a/src/main/java/com/achobeta/domain/message/handler/ext/MessageSendWithEmailHandler.java
+++ b/src/main/java/com/achobeta/domain/message/handler/ext/MessageSendWithEmailHandler.java
@@ -1,23 +1,26 @@
package com.achobeta.domain.message.handler.ext;
+import com.achobeta.config.DateTimeConfig;
import com.achobeta.domain.message.handler.MessageSendHandler;
import com.achobeta.domain.message.handler.websocket.MessageReceiveServer;
import com.achobeta.domain.message.model.dto.MessageSendDTO;
import com.achobeta.domain.message.model.entity.AttachmentFile;
import com.achobeta.domain.message.model.vo.EmailMessageSendTemplate;
-import com.achobeta.domain.resource.service.ResourceService;
import com.achobeta.email.model.po.EmailAttachment;
import com.achobeta.email.model.po.EmailMessage;
import com.achobeta.email.sender.EmailSender;
import com.achobeta.template.engine.HtmlEngine;
-import jakarta.servlet.http.HttpServletRequest;
+import com.achobeta.template.util.TemplateUtil;
+import com.achobeta.util.TimeUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
+import org.springframework.util.CollectionUtils;
import org.springframework.web.multipart.MultipartFile;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
@@ -33,10 +36,8 @@ public class MessageSendWithEmailHandler extends MessageSendHandler {
@Value("${spring.mail.username}")
private String achobetaEmail;
- private final ResourceService resourceService;
private final EmailSender emailSender;
private final HtmlEngine htmlEngine;
- private final HttpServletRequest request;
@Override
public void handle(MessageSendDTO messageSendBody, CopyOnWriteArraySet webSocketSet) {
@@ -51,8 +52,7 @@ public void handle(MessageSendDTO messageSendBody, CopyOnWriteArraySet attachmentInfoList) {
+ private EmailMessage getNoticeMessage(String email, String tittle, String content, String stuName, List attachmentInfoList) {
// 封装 Email
EmailMessage emailMessage = new EmailMessage();
emailMessage.setCreateTime(new Date());
@@ -60,66 +60,43 @@ public void sendEmail(String email, String tittle, String content, String stuNam
emailMessage.setRecipient(email);
emailMessage.setCarbonCopy();
emailMessage.setSender(achobetaEmail);
+
//构造当前时间
- LocalDateTime nowTime = LocalDateTime.now();
- DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
- String now = nowTime.format(timeFormatter);
+ String now = TimeUtil.getDateTime(new Date());
// 构造模板消息
+ String contentTarget = TemplateUtil.getUniqueSymbol();
EmailMessageSendTemplate emailMessageSendTemplate = EmailMessageSendTemplate.builder()
.stuName(stuName)
.tittle(tittle)
- .content(content)
+ .content(contentTarget)
.sendTime(now)
.attachmentInfoList(attachmentInfoList)
.build();
-
-
+
String html = htmlEngine.builder()
.append(MESSAGE_EMAIL_NOTICE.getTemplate(), emailMessageSendTemplate)
+ .replaceMarkdown(contentTarget, content)
.build();
emailMessage.setContent(html);
- // 发送模板消息
- emailSender.send(emailMessage);
+ return emailMessage;
}
public void sendEmail(String email, String tittle, String content, String stuName, List attachmentInfoList, List multipartFileList) {
// 封装 Email
- EmailMessage emailMessage = new EmailMessage();
- emailMessage.setCreateTime(new Date());
- emailMessage.setTitle(MESSAGE_EMAIL_NOTICE.getTitle());
- emailMessage.setRecipient(email);
- emailMessage.setCarbonCopy();
- emailMessage.setSender(achobetaEmail);
- //构造当前时间
- LocalDateTime nowTime = LocalDateTime.now();
- DateTimeFormatter timeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
- String now = nowTime.format(timeFormatter);
-
- // 构造模板消息
- EmailMessageSendTemplate emailMessageSendTemplate = EmailMessageSendTemplate.builder()
- .stuName(stuName)
- .tittle(tittle)
- .content(content)
- .sendTime(now)
- .attachmentInfoList(attachmentInfoList)
- .build();
-
-
- String html = htmlEngine.builder()
- .append(MESSAGE_EMAIL_NOTICE.getTemplate(), emailMessageSendTemplate)
- .build();
- emailMessage.setContent(html);
+ EmailMessage emailMessage = getNoticeMessage(email, tittle, content, stuName, attachmentInfoList);
List emailAttachmentList = Collections.emptyList();
- if(multipartFileList!=null&&!multipartFileList.isEmpty()){
+ if(!CollectionUtils.isEmpty(multipartFileList)){
//构造邮箱附件列表
- emailAttachmentList = multipartFileList.stream().map(file -> {
- return EmailAttachment.of(file);
- }).toList();
+ emailAttachmentList = multipartFileList.stream().map(EmailAttachment::of).toList();
}
// 发送模板消息
emailSender.send(emailMessage,true,emailAttachmentList);
}
+
+ public void sendEmail(String email, String tittle, String content, String stuName, List attachmentInfoList) {
+ sendEmail(email, tittle, content, stuName, attachmentInfoList, new ArrayList<>());
+ }
}
diff --git a/src/main/java/com/achobeta/domain/message/model/entity/Message.java b/src/main/java/com/achobeta/domain/message/model/entity/Message.java
index d61d06e9..6f651dc8 100644
--- a/src/main/java/com/achobeta/domain/message/model/entity/Message.java
+++ b/src/main/java/com/achobeta/domain/message/model/entity/Message.java
@@ -45,9 +45,7 @@ public class Message extends BaseIncrIDEntity implements Serializable {
/**
* 附件url
*/
- private long attachment;
-
-
+ private Long attachment;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
diff --git a/src/main/java/com/achobeta/util/TimeUtil.java b/src/main/java/com/achobeta/util/TimeUtil.java
index f71b6143..fd6480a5 100644
--- a/src/main/java/com/achobeta/util/TimeUtil.java
+++ b/src/main/java/com/achobeta/util/TimeUtil.java
@@ -18,10 +18,6 @@ public static String getDate(Date date) {
return DateTimeConfig.DATE_FORMAT.format(date);
}
- public static String getDate(long date) {
- return DateTimeConfig.DATE_FORMAT.format(new Date(date));
- }
-
public static String getDateTime(Date date) {
return DateTimeConfig.DATE_TIME_FORMAT.format(date);
}
From 97ccce445737748eaf30182711221fdf6bd2e961 Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Mon, 30 Sep 2024 22:53:47 +0800
Subject: [PATCH 004/104] =?UTF-8?q?fix:=20=E5=88=A0=E9=99=A4=E6=97=A0?=
=?UTF-8?q?=E7=94=A8=E4=BE=9D=E8=B5=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../message/handler/ext/MessageSendWithEmailHandler.java | 3 ---
1 file changed, 3 deletions(-)
diff --git a/src/main/java/com/achobeta/domain/message/handler/ext/MessageSendWithEmailHandler.java b/src/main/java/com/achobeta/domain/message/handler/ext/MessageSendWithEmailHandler.java
index 933db5df..0c6a0ba1 100644
--- a/src/main/java/com/achobeta/domain/message/handler/ext/MessageSendWithEmailHandler.java
+++ b/src/main/java/com/achobeta/domain/message/handler/ext/MessageSendWithEmailHandler.java
@@ -1,6 +1,5 @@
package com.achobeta.domain.message.handler.ext;
-import com.achobeta.config.DateTimeConfig;
import com.achobeta.domain.message.handler.MessageSendHandler;
import com.achobeta.domain.message.handler.websocket.MessageReceiveServer;
import com.achobeta.domain.message.model.dto.MessageSendDTO;
@@ -18,8 +17,6 @@
import org.springframework.util.CollectionUtils;
import org.springframework.web.multipart.MultipartFile;
-import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
From 2a794ef891534d915c1e96b2f85d567d7423170e Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Mon, 30 Sep 2024 23:17:27 +0800
Subject: [PATCH 005/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../achobeta/common/enums/GlobalServiceStatusCode.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/main/java/com/achobeta/common/enums/GlobalServiceStatusCode.java b/src/main/java/com/achobeta/common/enums/GlobalServiceStatusCode.java
index efcefa3c..f87b0dbe 100644
--- a/src/main/java/com/achobeta/common/enums/GlobalServiceStatusCode.java
+++ b/src/main/java/com/achobeta/common/enums/GlobalServiceStatusCode.java
@@ -95,10 +95,6 @@ public enum GlobalServiceStatusCode {
INTERVIEW_COMMENT_NOT_EXISTS(6201, "面试评论不存在"),
INTERVIEW_NOT_SUMMARIZED(6202, "面试还未总结"),
- /*消息错误 7001-8000*/
- MESSAGE_TEMPLATE_NOT_EXIST(7001,"消息模板不存在"),
- MESSAGE_NOT_EXIST(7002,"反馈消息不存在"),
- MESSAGE_HANDLER_NOT_EXIST(7003,"反馈处理员不存在"),
/* 资源错误 7001-8000 */
RESOURCE_LEVEL_NOT_EXISTS(7001, "资源权限不存在"),
@@ -117,6 +113,10 @@ public enum GlobalServiceStatusCode {
RESOURCE_OUT_SIZE(7014, "资源过大"),
RESOURCE_TYPE_NOT_MATCH(7015, "资源类型不匹配"),
+ /*消息错误 8001-9000*/
+ MESSAGE_TEMPLATE_NOT_EXIST(8001,"消息模板不存在"),
+ MESSAGE_NOT_EXIST(8002,"反馈消息不存在"),
+ MESSAGE_HANDLER_NOT_EXIST(8003,"反馈处理员不存在"),
/* -------------- */;
From 28f0028e8ce3fafc0d351316197fd037d15479f5 Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Tue, 1 Oct 2024 01:02:03 +0800
Subject: [PATCH 006/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sql/student/stu_attachment.sql | 4 ++--
sql/student/stu_resume.sql | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/sql/student/stu_attachment.sql b/sql/student/stu_attachment.sql
index ad900f16..c1f5d071 100644
--- a/sql/student/stu_attachment.sql
+++ b/sql/student/stu_attachment.sql
@@ -35,8 +35,8 @@ CREATE TABLE `stu_attachment`
INDEX `idx_resume_id` (`resume_id` ASC) USING BTREE
) ENGINE = InnoDB
AUTO_INCREMENT = 1
- CHARACTER SET = utf8
- COLLATE = utf8_bin COMMENT = '学生附件表'
+ CHARACTER SET = utf8mb4
+ COLLATE = utf8mb4_bin COMMENT = '学生附件表'
ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;
diff --git a/sql/student/stu_resume.sql b/sql/student/stu_resume.sql
index 5911235e..15ac05b5 100644
--- a/sql/student/stu_resume.sql
+++ b/sql/student/stu_resume.sql
@@ -75,8 +75,8 @@ CREATE TABLE `stu_resume`
INDEX `idx_name` (`name` ASC) USING BTREE
) ENGINE = InnoDB
AUTO_INCREMENT = 1
- CHARACTER SET = utf8
- COLLATE = utf8_bin COMMENT = '学生简历表'
+ CHARACTER SET = utf8mb4
+ COLLATE = utf8mb4_bin COMMENT = '学生简历表'
ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;
From d59464f2400a9b80f2cf8e2ba13adad99438422a Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Tue, 1 Oct 2024 01:43:00 +0800
Subject: [PATCH 007/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4sql?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sql/feedback/user_feedback.sql | 41 +++++-----
sql/message/message.sql | 59 +++++---------
sql/message/message_template.sql | 44 +++-------
sql/student/stu_attachment.sql | 55 ++++---------
sql/student/stu_resume.sql | 135 +++++++++++++------------------
sql/user/user.sql | 62 ++++++--------
6 files changed, 146 insertions(+), 250 deletions(-)
diff --git a/sql/feedback/user_feedback.sql b/sql/feedback/user_feedback.sql
index 4e27d6f1..7d6eb6ea 100644
--- a/sql/feedback/user_feedback.sql
+++ b/sql/feedback/user_feedback.sql
@@ -1,22 +1,21 @@
-create table user_feedback
+drop table if exists `user_feedback`;
+create table `user_feedback`
(
- id bigint auto_increment comment '反馈id' primary key,
- user_id bigint not null comment '用户id',
- batch_id bigint not null comment '招新批次',
- message_id bigint default null comment '处理结果的消息id',
- title varchar(256) default '' not null comment '反馈标题',
- content text not null comment '反馈内容',
- attachment bigint default null comment '附件链接',
- feedback_time datetime default CURRENT_TIMESTAMP not null comment '反馈时间'
- is_handle bit default b'0' not null comment '是否处理标记',
- version int default 1 not null comment '乐观锁',
- is_deleted bit default b'0' not null comment '伪删除标记',
- create_time datetime default CURRENT_TIMESTAMP not null comment '插入时间',
- update_time datetime default CURRENT_TIMESTAMP not null comment '更新时间'
-);
-
-create index idx_batch_id
- on user_feedback (batch_id);
-
-create index idx_user_id
- on user_feedback (user_id);
\ No newline at end of file
+ `id` bigint primary key auto_increment comment '反馈id' ,
+ `user_id` bigint not null comment '用户id',
+ `batch_id` bigint not null comment '招新批次',
+ `message_id` bigint default null comment '处理结果的消息id',
+ `title` varchar(256) default '' not null comment '反馈标题',
+ `content` text not null comment '反馈内容',
+ `attachment` bigint default null comment '附件链接',
+ `feedback_time` datetime default CURRENT_TIMESTAMP not null comment '反馈时间'
+ `is_handle` bit default b'0' not null comment '是否处理标记',
+ -- common column
+ `version` int not null default 0 comment '乐观锁',
+ `is_deleted` bit not null default b'0' comment '伪删除标记',
+ `create_time` datetime not null default current_timestamp comment '创建时间',
+ `update_time` datetime not null default current_timestamp on update current_timestamp comment '更新时间',
+ -- index
+ index `idx_batch_id`(`batch_id` asc) using btree,
+ index `idx_user_id`(`user_id` asc) using btree
+) comment = '用户反馈表';
\ No newline at end of file
diff --git a/sql/message/message.sql b/sql/message/message.sql
index 70430dee..320f4fe9 100644
--- a/sql/message/message.sql
+++ b/sql/message/message.sql
@@ -1,40 +1,19 @@
-/*
- Navicat Premium Data Transfer
-
- Source Server : 袁哥
- Source Server Type : MySQL
- Source Server Version : 80300
- Source Host : 120.78.157.4:3306
- Source Schema : achobeta_recruitment
-
- Target Server Type : MySQL
- Target Server Version : 80300
- File Encoding : 65001
-
- Date: 25/09/2024 17:52:32
-*/
-
-SET NAMES utf8mb4;
-SET FOREIGN_KEY_CHECKS = 0;
-
--- ----------------------------
--- Table structure for message
--- ----------------------------
-DROP TABLE IF EXISTS `message`;
-CREATE TABLE `message` (
- `id` bigint NOT NULL AUTO_INCREMENT COMMENT '消息id',
- `manager_id` bigint NOT NULL COMMENT '发送消息的管理员id',
- `tittle` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '消息标题',
- `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '消息内容',
- `send_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '发送时间',
- `attachment` bigint NULL DEFAULT NULL COMMENT '附件url',
- `version` int NOT NULL DEFAULT 0 COMMENT '乐观锁',
- `is_deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '伪删除标记',
- `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
- `user_id` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
- PRIMARY KEY (`id`) USING BTREE,
- INDEX `idx_manager_id`(`manager_id` ASC) USING BTREE
-) ENGINE = InnoDB AUTO_INCREMENT = 4222 CHARACTER SET = utf8mb4 COLLATE utf8mb4_bin COMMENT = '“活动参与”表' ROW_FORMAT = Dynamic;
-
-SET FOREIGN_KEY_CHECKS = 1;
+drop table if exists `message`;
+create table `message`
+(
+ `id` bigint primary key auto_increment comment '消息 id',
+ `manager_id` bigint not null comment '发送消息的管理员 id',
+ `user_id` bigint not null comment '用户 id',
+ `tittle` varchar(256) not null default '' comment '消息标题',
+ `content` text not null comment '消息内容',
+ `send_time` datetime not null default current_timestamp comment '发送时间',
+ `attachment` bigint null default null comment '附件 url',
+ -- common column
+ `version` int not null default 0 comment '乐观锁',
+ `is_deleted` bit not null default b'0' comment '伪删除标记',
+ `create_time` datetime not null default current_timestamp comment '创建时间',
+ `update_time` datetime not null default current_timestamp on update current_timestamp comment '更新时间',
+ -- index
+ index `idx_manager_id`(`manager_id` asc) using btree,
+ index `idx_user_id`(`user_id` asc) using btree
+) comment = '消息表';
\ No newline at end of file
diff --git a/sql/message/message_template.sql b/sql/message/message_template.sql
index 85935f7c..87bef4aa 100644
--- a/sql/message/message_template.sql
+++ b/sql/message/message_template.sql
@@ -1,32 +1,12 @@
-/*
- Navicat Premium Data Transfer
-
- Source Server Type : MySQL
- Source Server Version : 80300
- Source Host : 120.78.157.4:3306
- Source Schema : achobeta_recruitment
-
- Target Server Type : MySQL
- Target Server Version : 80300
- File Encoding : 65001
-*/
-
-SET NAMES utf8mb4;
-SET FOREIGN_KEY_CHECKS = 0;
-
--- ----------------------------
--- Table structure for message_template
--- ----------------------------
-DROP TABLE IF EXISTS `message_template`;
-CREATE TABLE `message_template` (
- `id` bigint NOT NULL AUTO_INCREMENT COMMENT '模板消息 ID',
- `template_title` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '模板消息标题',
- `template_content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '模板消息内容',
- `version` int NOT NULL DEFAULT 0 COMMENT '乐观锁',
- `is_deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '伪删除标记',
- `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
- PRIMARY KEY (`id`) USING BTREE
-) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '模板消息表' ROW_FORMAT = Dynamic;
-
-SET FOREIGN_KEY_CHECKS = 1;
+drop table if exists `message_template`;
+create table `message_template`
+(
+ `id` bigint primary key auto_increment comment '模板消息 id',
+ `template_title` varchar(100) not null default '' comment '模板消息标题',
+ `template_content` text not null comment '模板消息内容',
+ -- common column
+ `version` int not null default 0 comment '乐观锁',
+ `is_deleted` bit not null default b'0' comment '伪删除标记',
+ `create_time` datetime not null default current_timestamp comment '创建时间',
+ `update_time` datetime not null default current_timestamp on update current_timestamp comment '更新时间'
+) comment = '模板消息表';
\ No newline at end of file
diff --git a/sql/student/stu_attachment.sql b/sql/student/stu_attachment.sql
index c1f5d071..9433a3c6 100644
--- a/sql/student/stu_attachment.sql
+++ b/sql/student/stu_attachment.sql
@@ -1,42 +1,15 @@
-/*
- Navicat Premium Data Transfer
-
- Source Server : 本机
- Source Server Type : MySQL
- Source Server Version : 80026
- Source Host : localhost:3306
- Source Schema : achobeta_recruitment
-
- Target Server Type : MySQL
- Target Server Version : 80026
- File Encoding : 65001
-
- Date: 17/01/2024 13:44:01
-*/
-
-SET NAMES utf8mb4;
-SET FOREIGN_KEY_CHECKS = 0;
-
--- ----------------------------
--- Table structure for stu_attachment
--- ----------------------------
-DROP TABLE IF EXISTS `stu_attachment`;
-CREATE TABLE `stu_attachment`
+drop table if exists `stu_attachment`;
+create table `stu_attachment`
(
- `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
- `resume_id` bigint UNSIGNED NOT NULL COMMENT '学生表主键id',
- `filename` varchar(256) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '附件名',
- `attachment` bigint NOT NULL COMMENT '附件资源码',
- `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
- `version` int NOT NULL DEFAULT 0 COMMENT '乐观锁',
- `is_deleted` tinyint NOT NULL DEFAULT 0 COMMENT '伪删除标记',
- PRIMARY KEY (`id`) USING BTREE,
- INDEX `idx_resume_id` (`resume_id` ASC) USING BTREE
-) ENGINE = InnoDB
- AUTO_INCREMENT = 1
- CHARACTER SET = utf8mb4
- COLLATE = utf8mb4_bin COMMENT = '学生附件表'
- ROW_FORMAT = Dynamic;
-
-SET FOREIGN_KEY_CHECKS = 1;
+ `id` bigint primary key auto_increment comment 'id',
+ `resume_id` bigint not null comment '学生表主键 id',
+ `filename` varchar(256) not null default '' comment '附件名',
+ `attachment` bigint not null comment '附件资源码',
+ -- common column
+ `version` int not null default 0 comment '乐观锁',
+ `is_deleted` bit not null default b'0' comment '伪删除标记',
+ `create_time` datetime not null default current_timestamp comment '创建时间',
+ `update_time` datetime not null default current_timestamp on update current_timestamp comment '更新时间',
+ -- index
+ index `idx_resume_id`(`resume_id` asc) using btree
+) comment = '学生附件表';
\ No newline at end of file
diff --git a/sql/student/stu_resume.sql b/sql/student/stu_resume.sql
index 15ac05b5..2fd0e7a5 100644
--- a/sql/student/stu_resume.sql
+++ b/sql/student/stu_resume.sql
@@ -1,82 +1,63 @@
-/*
- Navicat Premium Data Transfer
-
- Source Server : 本机
- Source Server Type : MySQL
- Source Server Version : 80026
- Source Host : localhost:3306
- Source Schema : achobeta_recruitment
-
- Target Server Type : MySQL
- Target Server Version : 80026
- File Encoding : 65001
-
- Date: 17/01/2024 13:44:06
-*/
-
-SET NAMES utf8mb4;
-SET FOREIGN_KEY_CHECKS = 0;
-
--- ----------------------------
-- Table structure for student
-- 简历状态comment说明
-- 范围:0~16,简历状态{
-# - 0-草稿
-# - 1-待筛选
-# - 2-筛选不通过
-# - 3-待安排初试
-# - 4-待初试
-# - 5-初试通过(仅当初试为最后一个流程时显示)
-# - 6-初试不通过(仅当初试为最后一个流程时显示)
-# - 7-待安排复试
-# - 8-待复试
-# - 9-复试通过(仅当复试为最后一个流程时显示)
-# - 10-复试不通过(仅当复试为最后一个流程时显示)
-# - 11-待安排终试
-# - 12-待终试
-# - 13-终试通过(仅当复试为最后一个流程时显示)
-# - 14-终试不通过(仅当复试为最后一个流程时显示)
-# - 15-待处理(反馈异常/或管理员主动设置为该状态)
-# - 16-挂起(管理员可以主动设置该状态)}
+-- 0-草稿
+-- 1-待筛选
+-- 2-筛选不通过
+--
+-- 3-待安排初试
+-- 4-待初试
+-- 5-初试通过(仅当初试为最后一个流程时显示)
+-- 6-初试不通过(仅当初试为最后一个流程时显示)
+--
+-- 7-待安排复试
+-- 8-待复试
+-- 9-复试通过(仅当复试为最后一个流程时显示)
+-- 10-复试不通过(仅当复试为最后一个流程时显示)
+--
+-- 11-待安排终试
+-- 12-待终试
+-- 13-终试通过(仅当复试为最后一个流程时显示)
+-- 14-终试不通过(仅当复试为最后一个流程时显示)
+--
+-- 15-待处理(反馈异常/或管理员主动设置为该状态)
+-- 16-挂起(管理员可以主动设置该状态)
+-- }
-- ----------------------------
-DROP TABLE IF EXISTS `stu_resume`;
-CREATE TABLE `stu_resume`
+-- 创建学生简历表
+drop table if exists `stu_resume`;
+create table `stu_resume`
(
- `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
- `user_id` bigint NOT NULL COMMENT '用户 id',
- `batch_id` bigint NOT NULL COMMENT '招新批次 id',
- `student_id` varchar(13) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '学号',
- `name` varchar(10) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '姓名',
- `gender` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '性别',
- `grade` int NOT NULL COMMENT '年级',
- `major` varchar(20) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '专业',
- `class` varchar(30) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '班级',
- `email` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '邮箱',
- `phone_number` varchar(11) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '手机号码',
- `reason` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '加入 AchoBeta 的理由',
- `introduce` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '个人介绍(自我认知)',
- `experience` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '个人经历 (项目经历、 职业规划等)',
- `awards` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '获奖经历',
- `image` bigint NOT NULL COMMENT '照片',
- `remark` varchar(500) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '备注',
- `status` int NOT NULL DEFAULT 1 COMMENT '简历状态',
- `submit_count` int NOT NULL DEFAULT 0 COMMENT '提交次数',
- `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
- `version` int NOT NULL DEFAULT 0 COMMENT '乐观锁',
- `is_deleted` tinyint NOT NULL DEFAULT 0 COMMENT '伪删除标记',
- PRIMARY KEY (`id`) USING BTREE,
- INDEX `idx_student_id` (`student_id` ASC) USING BTREE,
- INDEX `idx_email` (`email` ASC) USING BTREE,
- INDEX `idx_user_id` (`user_id` ASC) USING BTREE,
- INDEX `idx_batch_id` (`batch_id` ASC) USING BTREE,
- INDEX `idx_class` (`class` ASC) USING BTREE,
- INDEX `idx_major` (`major` ASC) USING BTREE,
- INDEX `idx_name` (`name` ASC) USING BTREE
-) ENGINE = InnoDB
- AUTO_INCREMENT = 1
- CHARACTER SET = utf8mb4
- COLLATE = utf8mb4_bin COMMENT = '学生简历表'
- ROW_FORMAT = Dynamic;
-
-SET FOREIGN_KEY_CHECKS = 1;
+ `id` bigint primary key auto_increment comment 'id',
+ `user_id` bigint not null comment '用户 id',
+ `batch_id` bigint not null comment '招新批次 id',
+ `student_id` varchar(13) not null default '' comment '学号',
+ `name` varchar(10) not null default '' comment '姓名',
+ `gender` tinyint not null default 0 comment '性别',
+ `grade` int not null comment '年级',
+ `major` varchar(20) not null default '' comment '专业',
+ `class` varchar(30) not null default '' comment '班级',
+ `email` varchar(50) not null default '' comment '邮箱',
+ `phone_number` varchar(11) not null default '' comment '手机号码',
+ `reason` text not null comment '加入 achobeta 的理由',
+ `introduce` text not null comment '个人介绍(自我认知)',
+ `experience` text not null comment '个人经历(项目经历、职业规划等)',
+ `awards` text not null comment '获奖经历',
+ `image` bigint not null comment '照片',
+ `remark` varchar(500) not null default '' comment '备注',
+ `status` int not null default 1 comment '简历状态,范围:0~16',
+ `submit_count` int not null default 0 comment '提交次数',
+ -- common column
+ `version` int not null default 0 comment '乐观锁',
+ `is_deleted` bit not null default b'0' comment '伪删除标记',
+ `create_time` datetime not null default current_timestamp comment '创建时间',
+ `update_time` datetime not null default current_timestamp on update current_timestamp comment '更新时间',
+ -- index
+ index `idx_student_id` (`student_id` asc) using btree,
+ index `idx_email` (`email` asc) using btree,
+ index `idx_user_id` (`user_id` asc) using btree,
+ index `idx_batch_id` (`batch_id` asc) using btree,
+ index `idx_class` (`class` asc) using btree,
+ index `idx_major` (`major` asc) using btree,
+ index `idx_name` (`name` asc) using btree
+) comment = '学生简历表';
\ No newline at end of file
diff --git a/sql/user/user.sql b/sql/user/user.sql
index 9e642ff7..266df56d 100644
--- a/sql/user/user.sql
+++ b/sql/user/user.sql
@@ -1,40 +1,24 @@
-SET NAMES utf8mb4;
-SET FOREIGN_KEY_CHECKS = 0;
+drop table if exists `user`;
+create table `user`(
+ `id` bigint primary key auto_increment comment '用户唯一 id',
+ `username` varchar(50) not null default '' comment '用户名',
+ `nickname` varchar(50) not null default '' comment '用户昵称',
+ `email` varchar(50) not null default '' comment '邮箱',
+ `phone_number` varchar(11) not null default '' comment '手机号码',
+ `password` varchar(100) not null default '' comment '密码',
+ `user_type` int not null default 1 comment '用户类型:1.普通用户 2. 管理员',
+ `avatar` bigint comment '头像地址',
+ -- common column
+ `version` int not null default 0 comment '乐观锁',
+ `is_deleted` bit not null default b'0' comment '伪删除标记',
+ `create_time` datetime not null default current_timestamp comment '创建时间',
+ `update_time` datetime not null default current_timestamp on update current_timestamp comment '更新时间',
+ -- index
+ index `idx_email`(`email` asc) using btree,
+ index `idx_phone`(`phone_number` asc) using btree,
+ unique index `uni_name`(`username` asc) using btree
+) auto_increment = 10000 comment = '用户基本信息表';
--- ----------------------------
--- Table structure for user
--- ----------------------------
-DROP TABLE IF EXISTS `user`;
-CREATE TABLE `user`
-(
- `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '用户唯一ID',
- `username` varchar(50) NOT NULL DEFAULT '' COMMENT '用户名',
- `nickname` varchar(50) NOT NULL DEFAULT '' COMMENT '用户昵称',
- `email` varchar(50) NOT NULL DEFAULT '' COMMENT '邮箱',
- `phone_number` varchar(11) NOT NULL DEFAULT '' COMMENT '手机号码',
- `password` varchar(100) NOT NULL DEFAULT '' COMMENT '密码',
- `user_type` int NOT NULL DEFAULT 1 COMMENT '用户类型:1.普通用户 2. 管理员',
- `avatar` bigint(20) COMMENT '头像地址',
- `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
- `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间',
- `version` int NOT NULL DEFAULT 0 COMMENT '乐观锁',
- `is_deleted` tinyint NOT NULL DEFAULT 0 COMMENT '伪删除标记',
- PRIMARY KEY (`id`),
- INDEX `idx_email` (`email`),
- INDEX `idx_phone` (`phone_number`),
- UNIQUE INDEX `uni_name` (`username`)
-) ENGINE = InnoDB
- AUTO_INCREMENT = 10000
- CHARACTER SET = utf8
- COLLATE = utf8_bin COMMENT = '用户基本信息表'
- ROW_FORMAT = DYNAMIC;
-
-SET FOREIGN_KEY_CHECKS = 1;
-
--- 管理员,username: root; password: AchoBeta666
-
-insert into user
-(`username`, `nickname`, `password`, `user_type`)
-values
- ('root', 'root', '$2a$10$YPKp0kzLjnNrW5CgKuDdiuF4tZO0KXacmhy2KT7N9Zey49Cmi/rfu', 2)
-;
\ No newline at end of file
+-- root 管理员,username: root; password: AchoBeta666
+insert into user(`username`, `nickname`, `password`, `user_type`)
+ values('root', 'root', '$2a$10$YPKp0kzLjnNrW5CgKuDdiuF4tZO0KXacmhy2KT7N9Zey49Cmi/rfu', 2);
From a35e9d2890036700846c8a77bf5510b0e1e3663e Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Tue, 1 Oct 2024 01:50:18 +0800
Subject: [PATCH 008/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4sql?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
sql/feedback/user_feedback.sql | 11 ++++++-----
sql/student/stu_resume.sql | 3 +--
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/sql/feedback/user_feedback.sql b/sql/feedback/user_feedback.sql
index 7d6eb6ea..7edaa42a 100644
--- a/sql/feedback/user_feedback.sql
+++ b/sql/feedback/user_feedback.sql
@@ -1,14 +1,14 @@
drop table if exists `user_feedback`;
create table `user_feedback`
(
- `id` bigint primary key auto_increment comment '反馈id' ,
+ `id` bigint primary key auto_increment comment '反馈 id' ,
`user_id` bigint not null comment '用户id',
- `batch_id` bigint not null comment '招新批次',
- `message_id` bigint default null comment '处理结果的消息id',
+ `batch_id` bigint not null comment '招新批次 id',
+ `message_id` bigint default null comment '处理结果的消息 id',
`title` varchar(256) default '' not null comment '反馈标题',
`content` text not null comment '反馈内容',
`attachment` bigint default null comment '附件链接',
- `feedback_time` datetime default CURRENT_TIMESTAMP not null comment '反馈时间'
+ `feedback_time` datetime default CURRENT_TIMESTAMP not null comment '反馈时间',
`is_handle` bit default b'0' not null comment '是否处理标记',
-- common column
`version` int not null default 0 comment '乐观锁',
@@ -16,6 +16,7 @@ create table `user_feedback`
`create_time` datetime not null default current_timestamp comment '创建时间',
`update_time` datetime not null default current_timestamp on update current_timestamp comment '更新时间',
-- index
+ index `idx_user_id`(`user_id` asc) using btree,
index `idx_batch_id`(`batch_id` asc) using btree,
- index `idx_user_id`(`user_id` asc) using btree
+ index `idx_message_id`(`message_id` asc) using btree
) comment = '用户反馈表';
\ No newline at end of file
diff --git a/sql/student/stu_resume.sql b/sql/student/stu_resume.sql
index 2fd0e7a5..85d1dcaf 100644
--- a/sql/student/stu_resume.sql
+++ b/sql/student/stu_resume.sql
@@ -1,5 +1,4 @@
--- Table structure for student
--- 简历状态comment说明
+-- 简历状态 comment 说明
-- 范围:0~16,简历状态{
-- 0-草稿
-- 1-待筛选
From d8d05f4469d524efead58a9ffc7ed149a4eb9ded Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Mon, 7 Oct 2024 15:46:06 +0800
Subject: [PATCH 009/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=B8=80?=
=?UTF-8?q?=E4=B8=8B=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../achobeta/feishu/aspect/FeishuRequestAspect.java | 7 ++-----
.../achobeta/feishu/constants/FeishuConstants.java | 2 --
.../feishu/token/FeishuTenantAccessToken.java | 13 ++++---------
3 files changed, 6 insertions(+), 16 deletions(-)
diff --git a/src/main/java/com/achobeta/feishu/aspect/FeishuRequestAspect.java b/src/main/java/com/achobeta/feishu/aspect/FeishuRequestAspect.java
index 1c9550a6..53c47837 100644
--- a/src/main/java/com/achobeta/feishu/aspect/FeishuRequestAspect.java
+++ b/src/main/java/com/achobeta/feishu/aspect/FeishuRequestAspect.java
@@ -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 {
diff --git a/src/main/java/com/achobeta/feishu/constants/FeishuConstants.java b/src/main/java/com/achobeta/feishu/constants/FeishuConstants.java
index 3229a67b..003954b9 100644
--- a/src/main/java/com/achobeta/feishu/constants/FeishuConstants.java
+++ b/src/main/java/com/achobeta/feishu/constants/FeishuConstants.java
@@ -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)
diff --git a/src/main/java/com/achobeta/feishu/token/FeishuTenantAccessToken.java b/src/main/java/com/achobeta/feishu/token/FeishuTenantAccessToken.java
index e2252d11..f4db5353 100644
--- a/src/main/java/com/achobeta/feishu/token/FeishuTenantAccessToken.java
+++ b/src/main/java/com/achobeta/feishu/token/FeishuTenantAccessToken.java
@@ -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() {
From abccdee26164d4446ee612b32872d0400b9b98da Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Tue, 8 Oct 2024 22:01:22 +0800
Subject: [PATCH 010/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=B8=80?=
=?UTF-8?q?=E4=B8=8B=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../domain/recruit/service/impl/TimePeriodServiceImpl.java | 6 +++++-
.../schedule/controller/InterviewScheduleController.java | 3 ---
.../schedule/service/impl/InterviewScheduleServiceImpl.java | 2 +-
.../mapper/recruit/ext/ActivityParticipationExtMapper.xml | 2 ++
4 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/main/java/com/achobeta/domain/recruit/service/impl/TimePeriodServiceImpl.java b/src/main/java/com/achobeta/domain/recruit/service/impl/TimePeriodServiceImpl.java
index 73903637..4b569a14 100644
--- a/src/main/java/com/achobeta/domain/recruit/service/impl/TimePeriodServiceImpl.java
+++ b/src/main/java/com/achobeta/domain/recruit/service/impl/TimePeriodServiceImpl.java
@@ -48,7 +48,11 @@ private void timePeriodValidate(Long startTime, Long endTime) {
@Override
public List getTimePeriodsByActId(Long actId) {
- List timePeriods = this.lambdaQuery().eq(TimePeriod::getActId, actId).list();
+ List timePeriods = this.lambdaQuery()
+ .eq(TimePeriod::getActId, actId)
+ .orderBy(Boolean.TRUE, Boolean.TRUE, TimePeriod::getStartTime)
+ .orderBy(Boolean.TRUE, Boolean.TRUE, TimePeriod::getEndTime)
+ .list();
return TimePeriodConverter.INSTANCE.timePeriodListToTimePeriodVOList(timePeriods);
}
diff --git a/src/main/java/com/achobeta/domain/schedule/controller/InterviewScheduleController.java b/src/main/java/com/achobeta/domain/schedule/controller/InterviewScheduleController.java
index 16b906ab..63d55371 100644
--- a/src/main/java/com/achobeta/domain/schedule/controller/InterviewScheduleController.java
+++ b/src/main/java/com/achobeta/domain/schedule/controller/InterviewScheduleController.java
@@ -9,7 +9,6 @@
import com.achobeta.domain.resource.constants.ResourceConstants;
import com.achobeta.domain.resource.enums.ResourceAccessLevel;
import com.achobeta.domain.resource.model.vo.OnlineResourceVO;
-import com.achobeta.domain.resource.service.ResourceService;
import com.achobeta.domain.schedule.model.dto.ScheduleDTO;
import com.achobeta.domain.schedule.model.dto.ScheduleUpdateDTO;
import com.achobeta.domain.schedule.model.vo.ParticipationDetailVO;
@@ -52,8 +51,6 @@ public class InterviewScheduleController {
private final RecruitmentActivityService recruitmentActivityService;
- private final ResourceService resourceService;
-
@PostMapping("/create")
public SystemJsonResponse createInterviewSchedule(@Valid @RequestBody ScheduleDTO scheduleDTO) {
// 校验
diff --git a/src/main/java/com/achobeta/domain/schedule/service/impl/InterviewScheduleServiceImpl.java b/src/main/java/com/achobeta/domain/schedule/service/impl/InterviewScheduleServiceImpl.java
index 1f5d36c3..43b64696 100644
--- a/src/main/java/com/achobeta/domain/schedule/service/impl/InterviewScheduleServiceImpl.java
+++ b/src/main/java/com/achobeta/domain/schedule/service/impl/InterviewScheduleServiceImpl.java
@@ -129,6 +129,7 @@ public UserSituationVO getSituationsByActId(Long actId) {
List userParticipationVOS = userParticipationVOMap.values()
.stream()
.sorted(Comparator.comparingInt(up -> up.getTimePeriodVOS().size())) // 根据选择时间段排序
+ .sorted(Comparator.comparingLong(up -> CollectionUtils.isEmpty(up.getTimePeriodVOS()) ? 0L : up.getTimePeriodVOS().getFirst().getStartTime().getTime()))
.sorted(Comparator.comparingInt(up -> up.getScheduleVOS().size())) // 没被安排的会被排在前面
.toList();
List timePeriodCountVOS = countMap.values()
@@ -141,7 +142,6 @@ public UserSituationVO getSituationsByActId(Long actId) {
return userSituationVO;
}
-
@Override
public ScheduleDetailVO getInterviewScheduleDetail(Long scheduleId) {
ScheduleDetailVO scheduleDetail = interviewScheduleMapper.getInterviewerScheduleDetail(scheduleId);
diff --git a/src/main/resources/mapper/recruit/ext/ActivityParticipationExtMapper.xml b/src/main/resources/mapper/recruit/ext/ActivityParticipationExtMapper.xml
index dc48f363..8323ec75 100644
--- a/src/main/resources/mapper/recruit/ext/ActivityParticipationExtMapper.xml
+++ b/src/main/resources/mapper/recruit/ext/ActivityParticipationExtMapper.xml
@@ -45,6 +45,7 @@
left join participation_period_link pp on ap.id = pp.participation_id and ap.is_deleted = 0 and pp.is_deleted = 0
left join time_period t on pp.period_id = t.id and pp.is_deleted = 0 and t.is_deleted = 0
where ap.id = #{participationId,jdbcType=BIGINT} and t.id is not null and ap.is_deleted = 0
+ order by t.start_time asc, t.end_time asc
- Welcome to participate in this Achobeta recruitment activity, I look forward to your ability to show, even if you have a pity not to join us in the end,
- I hope you can continue to work hard.
+ Welcome to participate in this Achobeta recruitment activity, we look forward to your ability to show, even if you have a pity not to join us in the end,
+ we hope you can continue to work hard.
-
Tittle:
+
Message Title:
@@ -45,7 +45,7 @@
-
SendTime:
+
Send Time:
From 08a133f0d73a774f870de852e8ad15f412b985c8 Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Fri, 11 Oct 2024 18:36:12 +0800
Subject: [PATCH 024/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../achobeta/email/enums/EmailTemplateEnum.java | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/main/java/com/achobeta/email/enums/EmailTemplateEnum.java b/src/main/java/com/achobeta/email/enums/EmailTemplateEnum.java
index 76dd6e8b..7128137f 100644
--- a/src/main/java/com/achobeta/email/enums/EmailTemplateEnum.java
+++ b/src/main/java/com/achobeta/email/enums/EmailTemplateEnum.java
@@ -11,21 +11,21 @@
@AllArgsConstructor
public enum EmailTemplateEnum {
- CAPTCHA("邮箱验证码:验证用户身份", "identifying-code-model.html"),
+ CAPTCHA("AchoBeta 邮箱验证:验证用户身份", "identifying-code-model.html"),
- INTERVIEW_NOTICE("面试通知", "interview-notice-model.html"),
+ INTERVIEW_NOTICE("AchoBeta 面试通知", "interview-notice-model.html"),
- INTERVIEW_SUMMARY("面试总结", "interview-summary-model.html"),
+ INTERVIEW_SUMMARY("AchoBeta 面试总结", "interview-summary-model.html"),
- INTERVIEW_SUMMARY_MARKDOWN("面试总结", "interview-summary-model.md"),
+ INTERVIEW_SUMMARY_MARKDOWN("AchoBeta 面试总结", "interview-summary-model.md"),
- INTERVIEW_EXPERIENCE("面试经历", "interview-experience-model.html"),
+ INTERVIEW_EXPERIENCE("AchoBeta 面试经历", "interview-experience-model.html"),
- RESUME_NOTICE("简历状态轮转通知", "resume-notice-model.html"),
+ RESUME_NOTICE("AchoBeta 简历状态轮转通知", "resume-notice-model.html"),
- MEMBER_NOTICE("转正通知", "confirmation-notice-model.html"),
+ MEMBER_NOTICE("AchoBeta 转正通知", "confirmation-notice-model.html"),
- MESSAGE_EMAIL_NOTICE("Achobeta消息通知", "message-email-notice.html"),
+ MESSAGE_EMAIL_NOTICE("AchoBeta 消息通知", "message-email-notice.html"),
;
From 503e0b087ae2aaf28d9ca7a500cc1154ead2442d Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Sat, 12 Oct 2024 11:18:34 +0800
Subject: [PATCH 025/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../java/com/achobeta/common/enums/GlobalServiceStatusCode.java | 2 +-
.../domain/interview/service/impl/InterviewServiceImpl.java | 2 +-
.../mapper/schedule/ext/InterviewScheduleExtMapper.xml | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/main/java/com/achobeta/common/enums/GlobalServiceStatusCode.java b/src/main/java/com/achobeta/common/enums/GlobalServiceStatusCode.java
index 5655a9b4..3d0521ec 100644
--- a/src/main/java/com/achobeta/common/enums/GlobalServiceStatusCode.java
+++ b/src/main/java/com/achobeta/common/enums/GlobalServiceStatusCode.java
@@ -87,7 +87,7 @@ public enum GlobalServiceStatusCode {
/* 面试错误 6001-7000 */
INTERVIEW_SCHEDULE_NOT_EXISTS(6001, "面试预约不存在"),
INTERVIEWER_NOT_EXISTS(6002, "面试官不存在"),
- INTERVIEW_SCHEDULE_IS_REFERENCED(6003, "面试预约已被引用"),
+ INTERVIEW_SCHEDULE_IS_REFERENCED(6003, "无法删除已创建面试的面试预约"),
INTERVIEW_NOT_EXISTS(6101, "本场面试不存在"),
INTERVIEW_STATUS_EXCEPTION(6102, "面试状态异常"),
diff --git a/src/main/java/com/achobeta/domain/interview/service/impl/InterviewServiceImpl.java b/src/main/java/com/achobeta/domain/interview/service/impl/InterviewServiceImpl.java
index d3f0f477..c445fd70 100644
--- a/src/main/java/com/achobeta/domain/interview/service/impl/InterviewServiceImpl.java
+++ b/src/main/java/com/achobeta/domain/interview/service/impl/InterviewServiceImpl.java
@@ -124,7 +124,7 @@ public InterviewReserveVO interviewReserveApply(Long interviewId, String mobile)
throw new GlobalServiceException("面试预约时间为过去时", GlobalServiceStatusCode.PARAM_FAILED_VALIDATE);
}
// 预约会议
- ApplyReserveRespBody reserveRespBody = feishuService.reserveApplyBriefly(ownerId, endTime, title);
+ ApplyReserveRespBody reserveRespBody = feishuService.reserveApplyBriefly(ownerId, endTime, title);
return InterviewConverter.INSTANCE.feishuReserveToInterviewReserveVO(reserveRespBody.getReserve());
}
diff --git a/src/main/resources/mapper/schedule/ext/InterviewScheduleExtMapper.xml b/src/main/resources/mapper/schedule/ext/InterviewScheduleExtMapper.xml
index 8ed2e2dc..446c5c17 100644
--- a/src/main/resources/mapper/schedule/ext/InterviewScheduleExtMapper.xml
+++ b/src/main/resources/mapper/schedule/ext/InterviewScheduleExtMapper.xml
@@ -52,7 +52,7 @@
diff --git a/src/main/resources/mapper/schedule/ext/InterviewScheduleExtMapper.xml b/src/main/resources/mapper/schedule/ext/InterviewScheduleExtMapper.xml
index 959e1f24..60416aff 100644
--- a/src/main/resources/mapper/schedule/ext/InterviewScheduleExtMapper.xml
+++ b/src/main/resources/mapper/schedule/ext/InterviewScheduleExtMapper.xml
@@ -56,7 +56,7 @@
order by s.start_time asc, s.end_time asc
-
+
select
p.id, s.id s_id, s.participation_id s_participation_id, s.start_time s_start_time, s.end_time s_end_time,
@@ -66,7 +66,12 @@
left join recruitment_batch b on a.batch_id = b.id and a.is_deleted = 0 and b.is_deleted = 0
left join stu_resume r on r.batch_id = b.id and r.user_id = stu.id and r.is_deleted = 0 and b.is_deleted = 0 and stu.is_deleted = 0
left join interview_schedule s on s.participation_id = p.id and s.is_deleted = 0 and p.is_deleted = 0
- where a.id = #{actId,jdbcType=BIGINT} and r.id is not null and p.is_deleted = 0
+
+ a.id = #{condition.actId,jdbcType=BIGINT} and r.id is not null and p.is_deleted = 0
+
+ #{status,jdbcType=BIGINT}
+
+
order by s.start_time asc, s.end_time asc
From b0ad528a343c227149dc2f5b8f4fe0fa0206c7e8 Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Tue, 15 Oct 2024 01:10:10 +0800
Subject: [PATCH 057/104] =?UTF-8?q?fix:=20=E5=88=A0=E9=99=A4=E6=97=A0?=
=?UTF-8?q?=E7=94=A8=E4=BE=9D=E8=B5=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../achobeta/domain/schedule/model/dto/SituationQueryDTO.java | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/main/java/com/achobeta/domain/schedule/model/dto/SituationQueryDTO.java b/src/main/java/com/achobeta/domain/schedule/model/dto/SituationQueryDTO.java
index 38bf8ea7..5c3dc36b 100644
--- a/src/main/java/com/achobeta/domain/schedule/model/dto/SituationQueryDTO.java
+++ b/src/main/java/com/achobeta/domain/schedule/model/dto/SituationQueryDTO.java
@@ -1,6 +1,5 @@
package com.achobeta.domain.schedule.model.dto;
-import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Data;
From eacfa57c6739fc59e5e19c6dcb067548408325e0 Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Tue, 15 Oct 2024 01:16:14 +0800
Subject: [PATCH 058/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../resources/mapper/schedule/ext/InterviewScheduleExtMapper.xml | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/main/resources/mapper/schedule/ext/InterviewScheduleExtMapper.xml b/src/main/resources/mapper/schedule/ext/InterviewScheduleExtMapper.xml
index 60416aff..a07abe9f 100644
--- a/src/main/resources/mapper/schedule/ext/InterviewScheduleExtMapper.xml
+++ b/src/main/resources/mapper/schedule/ext/InterviewScheduleExtMapper.xml
@@ -68,6 +68,7 @@
left join interview_schedule s on s.participation_id = p.id and s.is_deleted = 0 and p.is_deleted = 0
a.id = #{condition.actId,jdbcType=BIGINT} and r.id is not null and p.is_deleted = 0
+ -- and r.status 放在外面,foreach 内部为空导致没有 in,可能会因为 r.status 为 0 而没有查询到一些行
#{status,jdbcType=BIGINT}
From df22afe1fa5b3826a3576fad6819c94af2e90712 Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Tue, 15 Oct 2024 10:21:35 +0800
Subject: [PATCH 059/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../InterviewScheduleController.java | 25 -------------------
.../service/InterviewScheduleService.java | 14 +++++++----
.../impl/InterviewScheduleServiceImpl.java | 12 ++-------
3 files changed, 11 insertions(+), 40 deletions(-)
diff --git a/src/main/java/com/achobeta/domain/schedule/controller/InterviewScheduleController.java b/src/main/java/com/achobeta/domain/schedule/controller/InterviewScheduleController.java
index 230e4103..88e113d0 100644
--- a/src/main/java/com/achobeta/domain/schedule/controller/InterviewScheduleController.java
+++ b/src/main/java/com/achobeta/domain/schedule/controller/InterviewScheduleController.java
@@ -131,41 +131,16 @@ public SystemJsonResponse getInterviewScheduleListAll(@Valid @RequestBody(requir
/**
* 管理员查看用户参与和预约情况
*
- * @param actId
- * @return
*/
- @GetMapping("/situations/{actId}")
- public SystemJsonResponse getUserParticipationSituationByActId(@PathVariable("actId") @NotNull Long actId) {
- // 检测
- recruitmentActivityService.checkRecruitmentActivityExists(actId);
- // 获取参与本次招新活动的所有用户参与和预约情况
- UserSituationVO situations = interviewScheduleService.querySituations(actId);
- return SystemJsonResponse.SYSTEM_SUCCESS(situations);
- }
-
@PostMapping("/situations")
public SystemJsonResponse querySituations(@Valid @RequestBody SituationQueryDTO situationQueryDTO) {
// 检测
recruitmentActivityService.checkRecruitmentActivityExists(situationQueryDTO.getActId());
- List statusList = Optional.ofNullable(situationQueryDTO.getStatusList()).stream().flatMap(Collection::stream).filter(Objects::nonNull).toList();
- situationQueryDTO.setStatusList(statusList);
// 获取参与本次招新活动的所有用户参与和预约情况
UserSituationVO situations = interviewScheduleService.querySituations(situationQueryDTO);
return SystemJsonResponse.SYSTEM_SUCCESS(situations);
}
- @GetMapping("/print/situations/{actId}")
- public SystemJsonResponse printUserParticipationSituationByActId(@PathVariable("actId") @NotNull Long actId,
- @RequestParam(name = "level", required = false) Integer level,
- @RequestParam(name = "synchronous", required = false) Boolean synchronous) {
- // 检测
- ResourceAccessLevel accessLevel = Optional.ofNullable(level).map(ResourceAccessLevel::get).orElse(ResourceConstants.DEFAULT_EXCEL_ACCESS_LEVEL);
- // 打印表格
- Long managerId = BaseContext.getCurrentUser().getUserId();
- OnlineResourceVO onlineResourceVO = interviewScheduleService.printSituations(managerId, actId, accessLevel, synchronous);
- return SystemJsonResponse.SYSTEM_SUCCESS(onlineResourceVO);
- }
-
@PostMapping("/print/situations")
public SystemJsonResponse printUserParticipationSituations(@Valid @RequestBody SituationQueryDTO situationQueryDTO,
@RequestParam(name = "level", required = false) Integer level,
diff --git a/src/main/java/com/achobeta/domain/schedule/service/InterviewScheduleService.java b/src/main/java/com/achobeta/domain/schedule/service/InterviewScheduleService.java
index e13451e8..4b6a3ff7 100644
--- a/src/main/java/com/achobeta/domain/schedule/service/InterviewScheduleService.java
+++ b/src/main/java/com/achobeta/domain/schedule/service/InterviewScheduleService.java
@@ -28,23 +28,27 @@ public interface InterviewScheduleService extends IService {
List getInterviewScheduleList(Long managerId, InterviewConditionDTO interviewConditionDTO);
/**
- * @param actId 活动 id
+ * @param situationQueryDTO 查询条件
* @return 学生们参与情况,每一个学生包括:
* 1. 学生的基础信息
* 2. 学生时间段选择情况
* 3. 学生面试预约情况
* 并统计各个时间段选中次数
*/
- UserSituationVO querySituations(Long actId);
-
UserSituationVO querySituations(SituationQueryDTO situationQueryDTO);
ScheduleDetailVO getInterviewScheduleDetail(Long scheduleId);
ParticipationDetailVO getDetailActivityParticipation(Long participationId);
- OnlineResourceVO printSituations(Long managerId, Long actId, ResourceAccessLevel level, Boolean synchronous);
-
+ /**
+ * 打印参与情况为表格
+ * @param managerId 管理员 id
+ * @param situationQueryDTO 查询条件
+ * @param level 资源等级
+ * @param synchronous 是否同步飞书
+ * @return 链接
+ */
OnlineResourceVO printSituations(Long managerId, SituationQueryDTO situationQueryDTO, ResourceAccessLevel level, Boolean synchronous);
InterviewReserveVO interviewReserveApply(Long scheduleId, String title, String mobile);
diff --git a/src/main/java/com/achobeta/domain/schedule/service/impl/InterviewScheduleServiceImpl.java b/src/main/java/com/achobeta/domain/schedule/service/impl/InterviewScheduleServiceImpl.java
index ccab5cfa..1f5cd44b 100644
--- a/src/main/java/com/achobeta/domain/schedule/service/impl/InterviewScheduleServiceImpl.java
+++ b/src/main/java/com/achobeta/domain/schedule/service/impl/InterviewScheduleServiceImpl.java
@@ -119,13 +119,10 @@ public List getInterviewScheduleList(Long managerId, Interview
* 3. 根据活动的预约情况得到 participationIds,查询每个学生的时间段选择情况,通过 map 设置到 VO 对象里并进行时间段次数统计
* 4. 构造返回值返回
*/
- @Override
- public UserSituationVO querySituations(Long actId) {
- return querySituations(new SituationQueryDTO(actId, null));
- }
-
@Override
public UserSituationVO querySituations(SituationQueryDTO situationQueryDTO) {
+ List statusList = Optional.ofNullable(situationQueryDTO.getStatusList()).stream().flatMap(Collection::stream).filter(Objects::nonNull).toList();
+ situationQueryDTO.setStatusList(statusList);
// periodId --> 时间段计数器
Map countMap = timePeriodService.getTimePeriodsByActId(situationQueryDTO.getActId())
.stream()
@@ -207,11 +204,6 @@ public ParticipationDetailVO getDetailActivityParticipation(Long participationId
}).orElseThrow(() -> new GlobalServiceException(GlobalServiceStatusCode.ACTIVITY_PARTICIPATION_NOT_EXISTS));
}
- @Override
- public OnlineResourceVO printSituations(Long managerId, Long actId, ResourceAccessLevel level, Boolean synchronous) {
- return printSituations(managerId, new SituationQueryDTO(actId, null), level, synchronous);
- }
-
@Override
public OnlineResourceVO printSituations(Long managerId, SituationQueryDTO situationQueryDTO, ResourceAccessLevel level, Boolean synchronous) {
RecruitmentActivity activity = recruitmentActivityService.checkAndGetRecruitmentActivity(situationQueryDTO.getActId());
From 89de8ed17950d7610565fed9ea6f5bfbe6f4573d Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Tue, 15 Oct 2024 10:23:05 +0800
Subject: [PATCH 060/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../domain/schedule/controller/InterviewScheduleController.java | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/main/java/com/achobeta/domain/schedule/controller/InterviewScheduleController.java b/src/main/java/com/achobeta/domain/schedule/controller/InterviewScheduleController.java
index 88e113d0..8261f478 100644
--- a/src/main/java/com/achobeta/domain/schedule/controller/InterviewScheduleController.java
+++ b/src/main/java/com/achobeta/domain/schedule/controller/InterviewScheduleController.java
@@ -28,9 +28,7 @@
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
-import java.util.Collection;
import java.util.List;
-import java.util.Objects;
import java.util.Optional;
/**
From e9444c69031432e85ec793f0904982d56a5a235f Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Tue, 15 Oct 2024 11:06:23 +0800
Subject: [PATCH 061/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../ext/InterviewQuestionScoreExtMapper.xml | 11 +++++----
.../mapper/member/ext/MemberExtMapper.xml | 4 ++--
.../ext/ActivityParticipationExtMapper.xml | 24 ++++++++++++-------
.../ext/InterviewScheduleExtMapper.xml | 8 ++++---
.../schedule/ext/InterviewerExtMapper.xml | 12 ++++++----
5 files changed, 38 insertions(+), 21 deletions(-)
diff --git a/src/main/resources/mapper/evaluate/ext/InterviewQuestionScoreExtMapper.xml b/src/main/resources/mapper/evaluate/ext/InterviewQuestionScoreExtMapper.xml
index 2aacc018..5504fc63 100644
--- a/src/main/resources/mapper/evaluate/ext/InterviewQuestionScoreExtMapper.xml
+++ b/src/main/resources/mapper/evaluate/ext/InterviewQuestionScoreExtMapper.xml
@@ -15,11 +15,14 @@
q.id, q.title, q.standard, q.create_time, q.update_time, avg(s.score) average
from question q
left join interview_question_score s on q.id = s.question_id and s.is_deleted = 0 and q.is_deleted = 0 and s.score != -1
- where
+
q.is_deleted = 0 and q.id
-
- #{questionId,jdbcType=BIGINT}
-
+
+
+ #{questionId,jdbcType=BIGINT}
+
+
+
group by q.id
order by q.id
diff --git a/src/main/resources/mapper/member/ext/MemberExtMapper.xml b/src/main/resources/mapper/member/ext/MemberExtMapper.xml
index 052062bd..e267e95d 100644
--- a/src/main/resources/mapper/member/ext/MemberExtMapper.xml
+++ b/src/main/resources/mapper/member/ext/MemberExtMapper.xml
@@ -26,7 +26,7 @@
m.id, m.manager_id, m.parent_id,
stu.username u_username, stu.nickname u_nickname,
stu.email u_email, stu.phone_number u_phone_number,
- stu.user_type u_user_type, stu.avatar u_avatar, stu.create_time,
+ stu.user_type u_user_type, stu.avatar u_avatar, stu.id
from user stu
left join member m on stu.id = m.manager_id and stu.is_deleted = 0 and m.is_deleted = 0
@@ -37,7 +37,7 @@
and r.batch_id = #{batchId,jdbcType=BIGINT}
- order by stu.create_time
+ order by stu.id
diff --git a/src/main/resources/mapper/recruit/ext/ActivityParticipationExtMapper.xml b/src/main/resources/mapper/recruit/ext/ActivityParticipationExtMapper.xml
index 8323ec75..ce897cb2 100644
--- a/src/main/resources/mapper/recruit/ext/ActivityParticipationExtMapper.xml
+++ b/src/main/resources/mapper/recruit/ext/ActivityParticipationExtMapper.xml
@@ -55,10 +55,14 @@
activity_participation ap
left join participation_period_link pp on ap.id = pp.participation_id and ap.is_deleted = 0 and pp.is_deleted = 0
left join time_period t on pp.period_id = t.id and pp.is_deleted = 0 and t.is_deleted = 0
- where ap.is_deleted = 0 and ap.id
-
- #{participationId,jdbcType=BIGINT}
-
+
+ ap.is_deleted = 0 and ap.id
+
+
+ #{participationId,jdbcType=BIGINT}
+
+
+
order by t.start_time asc, t.end_time asc
@@ -73,9 +77,13 @@
left join stu_resume r on r.batch_id = b.id and r.user_id = ap.stu_id and b.is_deleted = 0 and r.is_deleted = 0
left join participation_question_link pq on ap.id = pq.participation_id and ap.is_deleted = 0 and pq.is_deleted = 0
left join question q on pq.question_id = q.id and pq.is_deleted = 0 and q.is_deleted = 0
- where ap.is_deleted = 0 and ap.id
-
- #{participationId,jdbcType=BIGINT}
-
+
+ ap.is_deleted = 0 and ap.id
+
+
+ #{participationId,jdbcType=BIGINT}
+
+
+
diff --git a/src/main/resources/mapper/schedule/ext/InterviewScheduleExtMapper.xml b/src/main/resources/mapper/schedule/ext/InterviewScheduleExtMapper.xml
index a07abe9f..81815e13 100644
--- a/src/main/resources/mapper/schedule/ext/InterviewScheduleExtMapper.xml
+++ b/src/main/resources/mapper/schedule/ext/InterviewScheduleExtMapper.xml
@@ -69,9 +69,11 @@
a.id = #{condition.actId,jdbcType=BIGINT} and r.id is not null and p.is_deleted = 0
-- and r.status 放在外面,foreach 内部为空导致没有 in,可能会因为 r.status 为 0 而没有查询到一些行
-
- #{status,jdbcType=BIGINT}
-
+
+
+ #{status,jdbcType=INTEGER}
+
+
order by s.start_time asc, s.end_time asc
diff --git a/src/main/resources/mapper/schedule/ext/InterviewerExtMapper.xml b/src/main/resources/mapper/schedule/ext/InterviewerExtMapper.xml
index ca2aad77..88308362 100644
--- a/src/main/resources/mapper/schedule/ext/InterviewerExtMapper.xml
+++ b/src/main/resources/mapper/schedule/ext/InterviewerExtMapper.xml
@@ -25,10 +25,14 @@
from interview_schedule s
left join interviewer i on s.id = i.schedule_id and s.is_deleted = 0 and i.is_deleted = 0
left join user m on m.id = i.manager_id and m.is_deleted = 0 and i.is_deleted = 0
- where s.is_deleted = 0 and m.id is not null and s.id
-
- #{scheduleId,jdbcType=BIGINT}
-
+
+ s.is_deleted = 0 and m.id is not null and s.id
+
+
+ #{scheduleId,jdbcType=BIGINT}
+
+
+
order by s.start_time asc, s.end_time asc
From 294203777ce3b2cff3d13c365bc3d28d9a7ccbb4 Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Tue, 15 Oct 2024 12:18:54 +0800
Subject: [PATCH 062/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../feishu/service/impl/FeishuServiceImpl.java | 12 ++++++------
.../achobeta/feishu/aspect/FeishuRequestAspect.java | 6 +++---
...nantAccessToken.java => FeishuTenantSession.java} | 2 +-
.../evaluate/ext/InterviewQuestionScoreExtMapper.xml | 1 -
4 files changed, 10 insertions(+), 11 deletions(-)
rename src/main/java/com/achobeta/feishu/token/{FeishuTenantAccessToken.java => FeishuTenantSession.java} (98%)
diff --git a/src/main/java/com/achobeta/domain/feishu/service/impl/FeishuServiceImpl.java b/src/main/java/com/achobeta/domain/feishu/service/impl/FeishuServiceImpl.java
index b70fcaca..497e208f 100644
--- a/src/main/java/com/achobeta/domain/feishu/service/impl/FeishuServiceImpl.java
+++ b/src/main/java/com/achobeta/domain/feishu/service/impl/FeishuServiceImpl.java
@@ -7,7 +7,7 @@
import com.achobeta.feishu.config.ResourceProperties;
import com.achobeta.feishu.constants.ObjectType;
import com.achobeta.feishu.request.FeishuRequestEngine;
-import com.achobeta.feishu.token.FeishuTenantAccessToken;
+import com.achobeta.feishu.token.FeishuTenantSession;
import com.achobeta.util.GsonUtil;
import com.achobeta.util.MediaUtil;
import com.achobeta.util.TimeUtil;
@@ -57,7 +57,7 @@ public class FeishuServiceImpl implements FeishuService, InitializingBean {
private final FeishuAppConfig feishuAppConfig;
- private final FeishuTenantAccessToken feishuTenantAccessToken;
+ private final FeishuTenantSession feishuTenantSession;
private final FeishuRequestEngine feishuRequestEngine;
@@ -86,7 +86,7 @@ public BatchGetIdUserRespBody batchGetUserId(BatchGetIdUserReqBody batchGetIdUse
// } catch (Exception e) {
// throw new GlobalServiceException(e.getMessage());
// }
- String token = feishuTenantAccessToken.getToken();
+ String token = feishuTenantSession.getToken();
return feishuRequestEngine.jsonRequest(
GET_USER_ID,
batchGetIdUserReqBody,
@@ -133,7 +133,7 @@ public ApplyReserveRespBody reserveApply(ApplyReserveReqBody applyReserveReqBody
// } catch (Exception e) {
// throw new GlobalServiceException(e.getMessage());
// }
- String token = feishuTenantAccessToken.getToken();
+ String token = feishuTenantSession.getToken();
return feishuRequestEngine.jsonRequest(
RESERVE_APPLY,
applyReserveReqBody,
@@ -228,7 +228,7 @@ public CreateImportTaskRespBody importTask(ImportTask importTask) {
// } catch (Exception e) {
// throw new GlobalServiceException(e.getMessage());
// }
- String token = feishuTenantAccessToken.getToken();
+ String token = feishuTenantSession.getToken();
return feishuRequestEngine.jsonRequest(
IMPORT_TASK,
importTask,
@@ -264,7 +264,7 @@ public GetImportTaskRespBody getImportTask(String ticket) {
// } catch (Exception e) {
// throw new GlobalServiceException(e.getMessage());
// }
- String token = feishuTenantAccessToken.getToken();
+ String token = feishuTenantSession.getToken();
return feishuRequestEngine.jsonRequest(
GET_IMPORT_TASK,
null,
diff --git a/src/main/java/com/achobeta/feishu/aspect/FeishuRequestAspect.java b/src/main/java/com/achobeta/feishu/aspect/FeishuRequestAspect.java
index af0b5168..68a26571 100644
--- a/src/main/java/com/achobeta/feishu/aspect/FeishuRequestAspect.java
+++ b/src/main/java/com/achobeta/feishu/aspect/FeishuRequestAspect.java
@@ -2,7 +2,7 @@
import com.achobeta.common.enums.GlobalServiceStatusCode;
import com.achobeta.exception.GlobalServiceException;
-import com.achobeta.feishu.token.FeishuTenantAccessToken;
+import com.achobeta.feishu.token.FeishuTenantSession;
import com.lark.oapi.core.response.BaseResponse;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -24,7 +24,7 @@
@RequiredArgsConstructor
public class FeishuRequestAspect {
- private final FeishuTenantAccessToken feishuTenantAccessToken;
+ private final FeishuTenantSession feishuTenantSession;
// 虽然不排除没有返回值的情况,idea 插件识别切点目标方法里没有无返回值的目标方法,但实际上无返回值的目标方法也会执行 AfterReturning,result 为 null 罢了
// 所以要专门排除!
@@ -41,7 +41,7 @@ public void doAfterReturning(Object result) {
log.info("飞书请求成功");
} else {
log.info("飞书 token 刷新");
- feishuTenantAccessToken.refreshToken();
+ feishuTenantSession.refreshToken();
throw new GlobalServiceException(response.getMsg(), GlobalServiceStatusCode.REQUEST_NOT_VALID);
}
}else {
diff --git a/src/main/java/com/achobeta/feishu/token/FeishuTenantAccessToken.java b/src/main/java/com/achobeta/feishu/token/FeishuTenantSession.java
similarity index 98%
rename from src/main/java/com/achobeta/feishu/token/FeishuTenantAccessToken.java
rename to src/main/java/com/achobeta/feishu/token/FeishuTenantSession.java
index 43523eb0..50d04f79 100644
--- a/src/main/java/com/achobeta/feishu/token/FeishuTenantAccessToken.java
+++ b/src/main/java/com/achobeta/feishu/token/FeishuTenantSession.java
@@ -20,7 +20,7 @@
*/
@Component
@RequiredArgsConstructor
-public class FeishuTenantAccessToken {
+public class FeishuTenantSession {
private final Client feishuClient;
diff --git a/src/main/resources/mapper/evaluate/ext/InterviewQuestionScoreExtMapper.xml b/src/main/resources/mapper/evaluate/ext/InterviewQuestionScoreExtMapper.xml
index 5504fc63..57523dc9 100644
--- a/src/main/resources/mapper/evaluate/ext/InterviewQuestionScoreExtMapper.xml
+++ b/src/main/resources/mapper/evaluate/ext/InterviewQuestionScoreExtMapper.xml
@@ -24,7 +24,6 @@
group by q.id
- order by q.id
From ceedfd54d6a25aac619c2cba96014d4d1b5c134e Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Tue, 15 Oct 2024 12:29:15 +0800
Subject: [PATCH 063/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/main/resources/mapper/member/ext/MemberExtMapper.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/resources/mapper/member/ext/MemberExtMapper.xml b/src/main/resources/mapper/member/ext/MemberExtMapper.xml
index e267e95d..f04cd35d 100644
--- a/src/main/resources/mapper/member/ext/MemberExtMapper.xml
+++ b/src/main/resources/mapper/member/ext/MemberExtMapper.xml
@@ -26,7 +26,7 @@
m.id, m.manager_id, m.parent_id,
stu.username u_username, stu.nickname u_nickname,
stu.email u_email, stu.phone_number u_phone_number,
- stu.user_type u_user_type, stu.avatar u_avatar, stu.id
+ stu.user_type u_user_type, stu.avatar u_avatar, stu.id,
from user stu
left join member m on stu.id = m.manager_id and stu.is_deleted = 0 and m.is_deleted = 0
From 2fbbfc278f149bfe23bd3f9c758cb0e292a2b9f7 Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Tue, 15 Oct 2024 14:26:51 +0800
Subject: [PATCH 064/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../interview/controller/InterviewController.java | 2 +-
.../domain/interview/service/InterviewService.java | 2 +-
.../interview/service/impl/InterviewServiceImpl.java | 5 +++--
.../domain/paper/service/PaperQuestionLinkService.java | 2 +-
.../service/impl/PaperQuestionLinkServiceImpl.java | 10 +++++++---
5 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/src/main/java/com/achobeta/domain/interview/controller/InterviewController.java b/src/main/java/com/achobeta/domain/interview/controller/InterviewController.java
index 4c40b757..e6538a24 100644
--- a/src/main/java/com/achobeta/domain/interview/controller/InterviewController.java
+++ b/src/main/java/com/achobeta/domain/interview/controller/InterviewController.java
@@ -124,7 +124,7 @@ public SystemJsonResponse setPaperForInterview(@Valid @RequestBody InterviewPape
// 检查试卷是否存在
questionPaperService.checkPaperExists(paperId);
// 设置试卷
- interviewService.setPaperForInterview(interviewId, paperId);
+ interviewService.setPaperForInterview(interview, paperId);
}
return SystemJsonResponse.SYSTEM_SUCCESS();
}
diff --git a/src/main/java/com/achobeta/domain/interview/service/InterviewService.java b/src/main/java/com/achobeta/domain/interview/service/InterviewService.java
index 89f4c062..d5171e83 100644
--- a/src/main/java/com/achobeta/domain/interview/service/InterviewService.java
+++ b/src/main/java/com/achobeta/domain/interview/service/InterviewService.java
@@ -49,7 +49,7 @@ public interface InterviewService extends IService {
InterviewStatus executeInterviewStateEvent(InterviewEvent interviewEvent, InterviewContext interviewContext);
- void setPaperForInterview(Long interviewId, Long paperId);
+ void setPaperForInterview(Interview interview, Long paperId);
// 检测 ------------------------------------------
diff --git a/src/main/java/com/achobeta/domain/interview/service/impl/InterviewServiceImpl.java b/src/main/java/com/achobeta/domain/interview/service/impl/InterviewServiceImpl.java
index 43dbe223..e6e883ea 100644
--- a/src/main/java/com/achobeta/domain/interview/service/impl/InterviewServiceImpl.java
+++ b/src/main/java/com/achobeta/domain/interview/service/impl/InterviewServiceImpl.java
@@ -161,13 +161,14 @@ public InterviewStatus executeInterviewStateEvent(InterviewEvent interviewEvent,
@Override
@Transactional
- public void setPaperForInterview(Long interviewId, Long paperId) {
+ public void setPaperForInterview(Interview interview, Long paperId) {
// 删除面试相关的打分
+ Long interviewId = interview.getId();
Db.lambdaUpdate(InterviewQuestionScore.class)
.eq(InterviewQuestionScore::getInterviewId, interviewId)
.remove();
// 拷贝一份试卷
- Long newPaperId = paperQuestionLinkService.cloneQuestionPaper(paperId);
+ Long newPaperId = paperQuestionLinkService.cloneQuestionPaper(paperId, interview.getTitle());
// 设置试卷
this.lambdaUpdate()
.eq(Interview::getId, interviewId)
diff --git a/src/main/java/com/achobeta/domain/paper/service/PaperQuestionLinkService.java b/src/main/java/com/achobeta/domain/paper/service/PaperQuestionLinkService.java
index 0cd292ad..79edab6a 100644
--- a/src/main/java/com/achobeta/domain/paper/service/PaperQuestionLinkService.java
+++ b/src/main/java/com/achobeta/domain/paper/service/PaperQuestionLinkService.java
@@ -25,7 +25,7 @@ public interface PaperQuestionLinkService extends IService {
QuestionPaperDetailVO getPaperDetail(Long paperId);
- Long cloneQuestionPaper(Long paperId);
+ Long cloneQuestionPaper(Long paperId, String title);
void checkQuestionExistInPaper(Long paperId, Long questionId);
diff --git a/src/main/java/com/achobeta/domain/paper/service/impl/PaperQuestionLinkServiceImpl.java b/src/main/java/com/achobeta/domain/paper/service/impl/PaperQuestionLinkServiceImpl.java
index 0b15347c..116144ac 100644
--- a/src/main/java/com/achobeta/domain/paper/service/impl/PaperQuestionLinkServiceImpl.java
+++ b/src/main/java/com/achobeta/domain/paper/service/impl/PaperQuestionLinkServiceImpl.java
@@ -14,6 +14,7 @@
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.StringUtils;
import java.util.HashSet;
import java.util.List;
@@ -85,15 +86,18 @@ public QuestionPaperDetailVO getPaperDetail(Long paperId) {
@Override
@Transactional
- public Long cloneQuestionPaper(Long paperId) {
+ public Long cloneQuestionPaper(Long paperId, String title) {
// 拷贝试卷的定义
QuestionPaperDetailVO paperDetail = getPaperDetail(paperId);
List libIds = paperDetail.getTypes()
.stream()
.map(PaperLibraryVO::getId)
.toList();
- Long newPaperId = questionPaperService.addQuestionPaper(libIds,
- paperDetail.getTitle(), paperDetail.getDescription());
+ Long newPaperId = questionPaperService.addQuestionPaper(
+ libIds,
+ Optional.ofNullable(title).filter(StringUtils::hasText).orElseGet(paperDetail::getTitle),
+ paperDetail.getDescription()
+ );
// 拷贝试卷的题目
List questionIds = paperDetail.getQuestions()
.stream()
From 4dedb3e4d0acf2caa375b181d11fc304565fe64c Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Tue, 15 Oct 2024 15:03:02 +0800
Subject: [PATCH 065/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pom.xml | 2 +-
.../achobeta/common/annotation/Intercept.java | 2 --
.../annotation/handler/InterceptHelper.java | 8 -------
.../ext/RemovePaperIQScoreHandler.java | 21 +++++++++---------
.../RemoveQuestionFromPaperIQSHandler.java | 11 ++++++----
.../handler/chain/MessageSendDelayChain.java | 2 ++
.../handler/chain/MessageSendNowChain.java | 2 ++
.../chain/RemovePaperHandlerChain.java | 2 ++
.../RemoveQuestionFromPaperHandlerChain.java | 2 ++
.../impl/PaperQuestionLinkServiceImpl.java | 11 ++++++----
.../chain/RemoveQuestionHandlerChain.java | 2 ++
.../handler/ext/RemovePaperPQLinkHandler.java | 22 +++++++++----------
.../RemoveQuestionFromPaperPQLinkHandler.java | 13 +++++------
.../controller/ResourceController.java | 8 ++-----
.../service/impl/StuResumeServiceImpl.java | 3 +++
.../achobeta/interceptor/UserInterceptor.java | 16 +++++---------
.../ext/InterviewQuestionScoreExtMapper.xml | 4 ++--
.../paper/ext/QuestionPaperExtMapper.xml | 3 +--
.../mapper/question/ext/QuestionExtMapper.xml | 3 +--
.../ext/ActivityParticipationExtMapper.xml | 8 +++----
.../schedule/ext/InterviewerExtMapper.xml | 4 ++--
21 files changed, 72 insertions(+), 77 deletions(-)
diff --git a/pom.xml b/pom.xml
index 35fa158d..94887463 100644
--- a/pom.xml
+++ b/pom.xml
@@ -38,7 +38,7 @@
prodprod
- info
+ debugtrue
diff --git a/src/main/java/com/achobeta/common/annotation/Intercept.java b/src/main/java/com/achobeta/common/annotation/Intercept.java
index 0b666922..5b367db9 100644
--- a/src/main/java/com/achobeta/common/annotation/Intercept.java
+++ b/src/main/java/com/achobeta/common/annotation/Intercept.java
@@ -27,6 +27,4 @@
boolean ignore() default false;
- boolean log() default false;
-
}
diff --git a/src/main/java/com/achobeta/common/annotation/handler/InterceptHelper.java b/src/main/java/com/achobeta/common/annotation/handler/InterceptHelper.java
index a2288b90..f2a47cb5 100644
--- a/src/main/java/com/achobeta/common/annotation/handler/InterceptHelper.java
+++ b/src/main/java/com/achobeta/common/annotation/handler/InterceptHelper.java
@@ -39,14 +39,6 @@ public static boolean isIgnore(Method targetMethod) {
return isIgnore(getIntercept(targetMethod));
}
- public static boolean shouldPrintLog(Intercept intercept) {
- return Objects.isNull(intercept) || intercept.log();
- }
-
- public static boolean shouldPrintLog(Method targetMethod) {
- return shouldPrintLog(getIntercept(targetMethod));
- }
-
public static boolean isValid(Intercept intercept, UserTypeEnum role) {
// permit 中没有 role 就会抛异常
return Arrays.stream(intercept.permit())
diff --git a/src/main/java/com/achobeta/domain/evaluate/handler/ext/RemovePaperIQScoreHandler.java b/src/main/java/com/achobeta/domain/evaluate/handler/ext/RemovePaperIQScoreHandler.java
index 2255eccc..94360315 100644
--- a/src/main/java/com/achobeta/domain/evaluate/handler/ext/RemovePaperIQScoreHandler.java
+++ b/src/main/java/com/achobeta/domain/evaluate/handler/ext/RemovePaperIQScoreHandler.java
@@ -34,18 +34,17 @@ public void handle(Long paperId) {
.stream()
.map(Interview::getId)
.toList();
- if(CollectionUtils.isEmpty(interviewIds)) {
- return;
+ if(!CollectionUtils.isEmpty(interviewIds)) {
+ // 将面试试卷设置为空
+ interviewService.lambdaUpdate()
+ .in(Interview::getId, interviewIds)
+ .set(Interview::getPaperId, null)
+ .update();
+ // 删除对应的评分
+ interviewQuestionScoreService.lambdaUpdate()
+ .in(InterviewQuestionScore::getInterviewId, interviewIds)
+ .remove();
}
- // 将面试试卷设置为空
- interviewService.lambdaUpdate()
- .in(Interview::getId, interviewIds)
- .set(Interview::getPaperId, null)
- .update();
- // 删除对应的评分
- interviewQuestionScoreService.lambdaUpdate()
- .in(InterviewQuestionScore::getInterviewId, interviewIds)
- .remove();
// 执行下一个
super.doNextHandler(paperId);
}
diff --git a/src/main/java/com/achobeta/domain/evaluate/handler/ext/RemoveQuestionFromPaperIQSHandler.java b/src/main/java/com/achobeta/domain/evaluate/handler/ext/RemoveQuestionFromPaperIQSHandler.java
index 85502700..7e0590e4 100644
--- a/src/main/java/com/achobeta/domain/evaluate/handler/ext/RemoveQuestionFromPaperIQSHandler.java
+++ b/src/main/java/com/achobeta/domain/evaluate/handler/ext/RemoveQuestionFromPaperIQSHandler.java
@@ -7,6 +7,7 @@
import com.achobeta.domain.paper.handler.RemoveQuestionFromPaperHandler;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;
+import org.springframework.util.CollectionUtils;
import java.util.List;
@@ -34,10 +35,12 @@ public void handle(Long paperId, List questionIds) {
.map(Interview::getId)
.toList();
// 删除对应的评分
- interviewQuestionScoreService.lambdaUpdate()
- .in(InterviewQuestionScore::getInterviewId, interviewIds)
- .in(InterviewQuestionScore::getQuestionId, questionIds)
- .remove();
+ if(!CollectionUtils.isEmpty(interviewIds) && !CollectionUtils.isEmpty(questionIds)) {
+ interviewQuestionScoreService.lambdaUpdate()
+ .in(InterviewQuestionScore::getInterviewId, interviewIds)
+ .in(InterviewQuestionScore::getQuestionId, questionIds)
+ .remove();
+ }
// 执行下一个
super.doNextHandler(paperId, questionIds);
}
diff --git a/src/main/java/com/achobeta/domain/message/handler/chain/MessageSendDelayChain.java b/src/main/java/com/achobeta/domain/message/handler/chain/MessageSendDelayChain.java
index 5912c613..cc8429db 100644
--- a/src/main/java/com/achobeta/domain/message/handler/chain/MessageSendDelayChain.java
+++ b/src/main/java/com/achobeta/domain/message/handler/chain/MessageSendDelayChain.java
@@ -9,6 +9,7 @@
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
import java.time.Duration;
import java.time.LocalDateTime;
@@ -37,6 +38,7 @@ private MessageSendHandler initHandlerChain() {
}
@Override
+ @Transactional
public void handleChain(MessageSendDTO messageSendBody, CopyOnWriteArraySet webSocketSet) {
//初始化责任链
MessageSendHandler messageSendHandler = initHandlerChain();
diff --git a/src/main/java/com/achobeta/domain/message/handler/chain/MessageSendNowChain.java b/src/main/java/com/achobeta/domain/message/handler/chain/MessageSendNowChain.java
index 72ca72ed..74e8e3b1 100644
--- a/src/main/java/com/achobeta/domain/message/handler/chain/MessageSendNowChain.java
+++ b/src/main/java/com/achobeta/domain/message/handler/chain/MessageSendNowChain.java
@@ -6,6 +6,7 @@
import com.achobeta.domain.message.model.dto.MessageSendDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
import java.util.Optional;
import java.util.concurrent.CopyOnWriteArraySet;
@@ -27,6 +28,7 @@ private MessageSendHandler initHandlerChain() {
}
@Override
+ @Transactional
public void handleChain(MessageSendDTO messageSendBody, CopyOnWriteArraySet webSocketSet) {
//初始化责任链
MessageSendHandler messageSendHandler = initHandlerChain();
diff --git a/src/main/java/com/achobeta/domain/paper/handler/chain/RemovePaperHandlerChain.java b/src/main/java/com/achobeta/domain/paper/handler/chain/RemovePaperHandlerChain.java
index c03799d8..c2bc5438 100644
--- a/src/main/java/com/achobeta/domain/paper/handler/chain/RemovePaperHandlerChain.java
+++ b/src/main/java/com/achobeta/domain/paper/handler/chain/RemovePaperHandlerChain.java
@@ -5,6 +5,7 @@
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@@ -39,6 +40,7 @@ public void doPostConstruct() {
}
@Override
+ @Transactional
public void handle(Long paperId) {
log.info("责任链开始处理 [paperId 为 {}] 的“删除试卷”事件", paperId);
super.doNextHandler(paperId);
diff --git a/src/main/java/com/achobeta/domain/paper/handler/chain/RemoveQuestionFromPaperHandlerChain.java b/src/main/java/com/achobeta/domain/paper/handler/chain/RemoveQuestionFromPaperHandlerChain.java
index 3fe882ee..cca60772 100644
--- a/src/main/java/com/achobeta/domain/paper/handler/chain/RemoveQuestionFromPaperHandlerChain.java
+++ b/src/main/java/com/achobeta/domain/paper/handler/chain/RemoveQuestionFromPaperHandlerChain.java
@@ -5,6 +5,7 @@
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@@ -39,6 +40,7 @@ public void doPostConstruct() {
}
@Override
+ @Transactional
public void handle(Long paperId, List questionIds) {
log.info("责任链开始处理 [paperId 为 {},questionIds 为 {}] 的“从试卷中移除若干题”事件", paperId, questionIds);
super.doNextHandler(paperId, questionIds);
diff --git a/src/main/java/com/achobeta/domain/paper/service/impl/PaperQuestionLinkServiceImpl.java b/src/main/java/com/achobeta/domain/paper/service/impl/PaperQuestionLinkServiceImpl.java
index 116144ac..20b0aadf 100644
--- a/src/main/java/com/achobeta/domain/paper/service/impl/PaperQuestionLinkServiceImpl.java
+++ b/src/main/java/com/achobeta/domain/paper/service/impl/PaperQuestionLinkServiceImpl.java
@@ -14,6 +14,7 @@
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.HashSet;
@@ -70,10 +71,12 @@ public void addQuestionsForPaper(Long paperId, List questionIds) {
@Override
public void removeQuestionsFromPaper(Long paperId, List questionIds) {
- this.lambdaUpdate()
- .eq(PaperQuestionLink::getPaperId, paperId)
- .in(PaperQuestionLink::getQuestionId, questionIds)
- .remove();
+ if(!CollectionUtils.isEmpty(questionIds)) {
+ this.lambdaUpdate()
+ .eq(PaperQuestionLink::getPaperId, paperId)
+ .in(PaperQuestionLink::getQuestionId, questionIds)
+ .remove();
+ }
}
@Override
diff --git a/src/main/java/com/achobeta/domain/question/handler/chain/RemoveQuestionHandlerChain.java b/src/main/java/com/achobeta/domain/question/handler/chain/RemoveQuestionHandlerChain.java
index 7a93dad3..c7d5ad61 100644
--- a/src/main/java/com/achobeta/domain/question/handler/chain/RemoveQuestionHandlerChain.java
+++ b/src/main/java/com/achobeta/domain/question/handler/chain/RemoveQuestionHandlerChain.java
@@ -5,6 +5,7 @@
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@@ -39,6 +40,7 @@ public void doPostConstruct() {
}
@Override
+ @Transactional
public void handle(Long questionId) {
log.info("责任链开始处理 [questionId 为 {}] 的“删除问题”事件", questionId);
super.doNextHandler(questionId);
diff --git a/src/main/java/com/achobeta/domain/recruit/handler/ext/RemovePaperPQLinkHandler.java b/src/main/java/com/achobeta/domain/recruit/handler/ext/RemovePaperPQLinkHandler.java
index 8c471131..880ae55d 100644
--- a/src/main/java/com/achobeta/domain/recruit/handler/ext/RemovePaperPQLinkHandler.java
+++ b/src/main/java/com/achobeta/domain/recruit/handler/ext/RemovePaperPQLinkHandler.java
@@ -32,22 +32,20 @@ public class RemovePaperPQLinkHandler extends RemovePaperHandler {
@Override
public void handle(Long paperId) {
List participationIds = activityParticipationService.getParticipationIdsByPaperId(paperId);
- if(CollectionUtils.isEmpty(participationIds)) {
- return;
+ if(!CollectionUtils.isEmpty(participationIds)) {
+ // 删除对应的行
+ participationQuestionLinkService.lambdaUpdate()
+ .in(ParticipationQuestionLink::getParticipationId, participationIds)
+ .remove();
}
- // 删除对应的行
- participationQuestionLinkService.lambdaUpdate()
- .in(ParticipationQuestionLink::getParticipationId, participationIds)
- .remove();
// 涉及的招新活动的 paperId 置为 null
List actIds = recruitmentActivityService.getActIdsByPaperId(paperId);
- if(CollectionUtils.isEmpty(actIds)) {
- return;
+ if(!CollectionUtils.isEmpty(actIds)) {
+ recruitmentActivityService.lambdaUpdate()
+ .in(RecruitmentActivity::getId, actIds)
+ .set(RecruitmentActivity::getPaperId, null)
+ .update();
}
- recruitmentActivityService.lambdaUpdate()
- .in(RecruitmentActivity::getId, actIds)
- .set(RecruitmentActivity::getPaperId, null)
- .update();
// 执行下一个
super.doNextHandler(paperId);
}
diff --git a/src/main/java/com/achobeta/domain/recruit/handler/ext/RemoveQuestionFromPaperPQLinkHandler.java b/src/main/java/com/achobeta/domain/recruit/handler/ext/RemoveQuestionFromPaperPQLinkHandler.java
index 5e055b32..d0014805 100644
--- a/src/main/java/com/achobeta/domain/recruit/handler/ext/RemoveQuestionFromPaperPQLinkHandler.java
+++ b/src/main/java/com/achobeta/domain/recruit/handler/ext/RemoveQuestionFromPaperPQLinkHandler.java
@@ -28,14 +28,13 @@ public class RemoveQuestionFromPaperPQLinkHandler extends RemoveQuestionFromPape
@Override
public void handle(Long paperId, List questionIds) {
List participationIds = activityParticipationService.getParticipationIdsByPaperId(paperId);
- if(CollectionUtils.isEmpty(participationIds)) {
- return;
+ if(!CollectionUtils.isEmpty(participationIds)) {
+ // 删除对应的行
+ participationQuestionLinkService.lambdaUpdate()
+ .in(ParticipationQuestionLink::getParticipationId, participationIds)
+ .in(ParticipationQuestionLink::getQuestionId, questionIds)
+ .remove();
}
- // 删除对应的行
- participationQuestionLinkService.lambdaUpdate()
- .in(ParticipationQuestionLink::getParticipationId, participationIds)
- .in(ParticipationQuestionLink::getQuestionId, questionIds)
- .remove();
// 执行下一个
super.doNextHandler(paperId, questionIds);
}
diff --git a/src/main/java/com/achobeta/domain/resource/controller/ResourceController.java b/src/main/java/com/achobeta/domain/resource/controller/ResourceController.java
index 610c2988..f3453183 100644
--- a/src/main/java/com/achobeta/domain/resource/controller/ResourceController.java
+++ b/src/main/java/com/achobeta/domain/resource/controller/ResourceController.java
@@ -88,7 +88,6 @@ public SystemJsonResponse getLevels() {
}
@PostMapping("/upload/one")
- @Intercept(permit = {UserTypeEnum.ADMIN, UserTypeEnum.USER}, log = true)
public SystemJsonResponse upload(@RequestPart("file") MultipartFile file) {
Long userId = BaseContext.getCurrentUser().getUserId();
Long code = resourceService.upload(userId, file);
@@ -96,7 +95,7 @@ public SystemJsonResponse upload(@RequestPart("file") MultipartFile file) {
}
@PostMapping("/upload/syncfeishu/markdown")
- @Intercept(permit = {UserTypeEnum.ADMIN}, log = true)
+ @Intercept(permit = {UserTypeEnum.ADMIN})
public SystemJsonResponse uploadMarkdown(@RequestPart("file") MultipartFile file,
@RequestParam(name = "level", required = false) Integer level) {
ResourceUtil.checkText(MediaUtil.getContentType(file));
@@ -109,7 +108,7 @@ public SystemJsonResponse uploadMarkdown(@RequestPart("file") MultipartFile file
}
@PostMapping("/upload/syncfeishu/sheet")
- @Intercept(permit = {UserTypeEnum.ADMIN}, log = true)
+ @Intercept(permit = {UserTypeEnum.ADMIN})
public SystemJsonResponse uploadExcel(@RequestPart("file") MultipartFile file,
@RequestParam(name = "level", required = false) Integer level) {
ResourceUtil.checkSheet(MediaUtil.getBytes(file));
@@ -122,7 +121,6 @@ public SystemJsonResponse uploadExcel(@RequestPart("file") MultipartFile file,
}
@PostMapping("/upload/image")
- @Intercept(permit = {UserTypeEnum.ADMIN, UserTypeEnum.USER}, log = true)
public SystemJsonResponse uploadImage(@RequestPart("file") MultipartFile file) {
// 检查
ResourceUtil.checkImage(MediaUtil.getContentType(file));
@@ -132,7 +130,6 @@ public SystemJsonResponse uploadImage(@RequestPart("file") MultipartFile file) {
}
@PostMapping("/upload/video")
- @Intercept(permit = {UserTypeEnum.ADMIN, UserTypeEnum.USER}, log = true)
public SystemJsonResponse uploadVideo(@RequestPart("file") MultipartFile file) {
// 检查
ResourceUtil.checkVideo(MediaUtil.getContentType(file));
@@ -142,7 +139,6 @@ public SystemJsonResponse uploadVideo(@RequestPart("file") MultipartFile file) {
}
@PostMapping("/upload/list")
- @Intercept(permit = {UserTypeEnum.ADMIN, UserTypeEnum.USER}, log = true)
public SystemJsonResponse upload(@RequestPart("file") List fileList) {
Long userId = BaseContext.getCurrentUser().getUserId();
List codeList = resourceService.uploadList(userId, fileList);
diff --git a/src/main/java/com/achobeta/domain/student/service/impl/StuResumeServiceImpl.java b/src/main/java/com/achobeta/domain/student/service/impl/StuResumeServiceImpl.java
index 4360213f..ae002648 100644
--- a/src/main/java/com/achobeta/domain/student/service/impl/StuResumeServiceImpl.java
+++ b/src/main/java/com/achobeta/domain/student/service/impl/StuResumeServiceImpl.java
@@ -230,6 +230,9 @@ public StuResume checkResumeSubmitCount(StuSimpleResumeDTO resumeDTO, Long userI
@Override
public List queryStuList(Long batchId, List userIds) {
+ if(CollectionUtils.isEmpty(userIds)) {
+ return new ArrayList<>();
+ }
return lambdaQuery()
.eq(StuResume::getBatchId, batchId)
.in(StuResume::getUserId, userIds)
diff --git a/src/main/java/com/achobeta/interceptor/UserInterceptor.java b/src/main/java/com/achobeta/interceptor/UserInterceptor.java
index f8222a62..9c454a9e 100644
--- a/src/main/java/com/achobeta/interceptor/UserInterceptor.java
+++ b/src/main/java/com/achobeta/interceptor/UserInterceptor.java
@@ -123,16 +123,12 @@ public boolean preHandle(HttpServletRequest request, HttpServletResponse respons
@Override
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
try {
- if(handler instanceof HandlerMethod handlerMethod) {
- // 获取目标方法
- Method targetMethod = handlerMethod.getMethod();
- if(InterceptHelper.shouldPrintLog(targetMethod)) {
- String requestId = response.getHeader(requestIdConfig.getHeader());
- log.warn("请求 {} 访问接口 {},响应 HTTP 状态码 {},错误信息 {}",
- requestId, request.getRequestURI(), response.getStatus(),
- Optional.ofNullable(ex).map(Exception::getMessage).orElse(null)
- );
- }
+ if(handler instanceof HandlerMethod) {
+ String requestId = response.getHeader(requestIdConfig.getHeader());
+ log.warn("请求 {} 访问接口 {},响应 HTTP 状态码 {},错误信息 {}",
+ requestId, request.getRequestURI(), response.getStatus(),
+ Optional.ofNullable(ex).map(Exception::getMessage).orElse(null)
+ );
}
} finally {
log.info("删除本地线程变量");
diff --git a/src/main/resources/mapper/evaluate/ext/InterviewQuestionScoreExtMapper.xml b/src/main/resources/mapper/evaluate/ext/InterviewQuestionScoreExtMapper.xml
index 57523dc9..717d0e05 100644
--- a/src/main/resources/mapper/evaluate/ext/InterviewQuestionScoreExtMapper.xml
+++ b/src/main/resources/mapper/evaluate/ext/InterviewQuestionScoreExtMapper.xml
@@ -16,9 +16,9 @@
from question q
left join interview_question_score s on q.id = s.question_id and s.is_deleted = 0 and q.is_deleted = 0 and s.score != -1
- q.is_deleted = 0 and q.id
+ q.is_deleted = 0
-
+
#{questionId,jdbcType=BIGINT}
diff --git a/src/main/resources/mapper/paper/ext/QuestionPaperExtMapper.xml b/src/main/resources/mapper/paper/ext/QuestionPaperExtMapper.xml
index 612ac9c7..551d7958 100644
--- a/src/main/resources/mapper/paper/ext/QuestionPaperExtMapper.xml
+++ b/src/main/resources/mapper/paper/ext/QuestionPaperExtMapper.xml
@@ -23,8 +23,7 @@
p.id is not null and l.is_deleted = 0
- and l.id
-
+
#{libId,jdbcType=BIGINT}
diff --git a/src/main/resources/mapper/question/ext/QuestionExtMapper.xml b/src/main/resources/mapper/question/ext/QuestionExtMapper.xml
index 4b3145de..2a2f47cc 100644
--- a/src/main/resources/mapper/question/ext/QuestionExtMapper.xml
+++ b/src/main/resources/mapper/question/ext/QuestionExtMapper.xml
@@ -23,8 +23,7 @@
q.id is not null and l.is_deleted = 0
- and l.id
-
+
#{libId,jdbcType=BIGINT}
diff --git a/src/main/resources/mapper/recruit/ext/ActivityParticipationExtMapper.xml b/src/main/resources/mapper/recruit/ext/ActivityParticipationExtMapper.xml
index ce897cb2..ec36bdf4 100644
--- a/src/main/resources/mapper/recruit/ext/ActivityParticipationExtMapper.xml
+++ b/src/main/resources/mapper/recruit/ext/ActivityParticipationExtMapper.xml
@@ -56,9 +56,9 @@
left join participation_period_link pp on ap.id = pp.participation_id and ap.is_deleted = 0 and pp.is_deleted = 0
left join time_period t on pp.period_id = t.id and pp.is_deleted = 0 and t.is_deleted = 0
- ap.is_deleted = 0 and ap.id
+ ap.is_deleted = 0
-
+
#{participationId,jdbcType=BIGINT}
@@ -78,9 +78,9 @@
left join participation_question_link pq on ap.id = pq.participation_id and ap.is_deleted = 0 and pq.is_deleted = 0
left join question q on pq.question_id = q.id and pq.is_deleted = 0 and q.is_deleted = 0
- ap.is_deleted = 0 and ap.id
+ ap.is_deleted = 0
-
+
#{participationId,jdbcType=BIGINT}
diff --git a/src/main/resources/mapper/schedule/ext/InterviewerExtMapper.xml b/src/main/resources/mapper/schedule/ext/InterviewerExtMapper.xml
index 88308362..c599021a 100644
--- a/src/main/resources/mapper/schedule/ext/InterviewerExtMapper.xml
+++ b/src/main/resources/mapper/schedule/ext/InterviewerExtMapper.xml
@@ -26,9 +26,9 @@
left join interviewer i on s.id = i.schedule_id and s.is_deleted = 0 and i.is_deleted = 0
left join user m on m.id = i.manager_id and m.is_deleted = 0 and i.is_deleted = 0
- s.is_deleted = 0 and m.id is not null and s.id
+ s.is_deleted = 0 and m.id is not null
-
+
#{scheduleId,jdbcType=BIGINT}
From 1137de4bc478930f77a39d43f428e244b77644df Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Tue, 15 Oct 2024 17:15:46 +0800
Subject: [PATCH 066/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../paper/service/impl/PaperQuestionLinkServiceImpl.java | 7 ++-----
.../service/impl/ParticipationQuestionLinkServiceImpl.java | 7 ++-----
.../mapper/paper/ext/PaperQuestionLinkExtMapper.xml | 3 ++-
.../resources/mapper/paper/ext/QuestionPaperExtMapper.xml | 3 ++-
.../mapper/paper/ext/QuestionPaperLibraryExtMapper.xml | 3 ++-
.../resources/mapper/question/ext/QuestionExtMapper.xml | 3 ++-
.../mapper/question/ext/QuestionLibararyExtMapper.xml | 3 ++-
7 files changed, 14 insertions(+), 15 deletions(-)
diff --git a/src/main/java/com/achobeta/domain/paper/service/impl/PaperQuestionLinkServiceImpl.java b/src/main/java/com/achobeta/domain/paper/service/impl/PaperQuestionLinkServiceImpl.java
index 20b0aadf..dfbe77e7 100644
--- a/src/main/java/com/achobeta/domain/paper/service/impl/PaperQuestionLinkServiceImpl.java
+++ b/src/main/java/com/achobeta/domain/paper/service/impl/PaperQuestionLinkServiceImpl.java
@@ -17,10 +17,7 @@
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Optional;
-import java.util.Set;
+import java.util.*;
/**
* @author 马拉圈
@@ -54,7 +51,7 @@ public Optional getPaperQuestionLink(Long paperId, Long quest
@Override
@Transactional
public void addQuestionsForPaper(Long paperId, List questionIds) {
- Set hash = new HashSet<>();
+ Set hash = new LinkedHashSet<>();
// 获取试卷的所有题
getQuestionsOnPaper(paperId).forEach(questionVO -> hash.add(questionVO.getId()));
// 将不存在于原试卷的题滤出来
diff --git a/src/main/java/com/achobeta/domain/recruit/service/impl/ParticipationQuestionLinkServiceImpl.java b/src/main/java/com/achobeta/domain/recruit/service/impl/ParticipationQuestionLinkServiceImpl.java
index 32c0736e..4956602b 100644
--- a/src/main/java/com/achobeta/domain/recruit/service/impl/ParticipationQuestionLinkServiceImpl.java
+++ b/src/main/java/com/achobeta/domain/recruit/service/impl/ParticipationQuestionLinkServiceImpl.java
@@ -15,10 +15,7 @@
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
+import java.util.*;
/**
* @author 马拉圈
@@ -76,7 +73,7 @@ public Optional getParticipationQuestionLink(Long par
@Override
public void putQuestionAnswers(Long participationId, List questionAnswerDTOS) {
Long recId = getActivityParticipationActId(participationId);
- Map hash = new HashMap<>();
+ Map hash = new LinkedHashMap<>();
// 获取答题模板
recruitmentActivityService.getQuestionsByActId(recId).forEach(questionVO -> {
hash.put(questionVO.getId(), ActivityParticipationConstants.DEFAULT_ANSWER);
diff --git a/src/main/resources/mapper/paper/ext/PaperQuestionLinkExtMapper.xml b/src/main/resources/mapper/paper/ext/PaperQuestionLinkExtMapper.xml
index 0d43205f..9b624f31 100644
--- a/src/main/resources/mapper/paper/ext/PaperQuestionLinkExtMapper.xml
+++ b/src/main/resources/mapper/paper/ext/PaperQuestionLinkExtMapper.xml
@@ -6,11 +6,12 @@
select
- q.id, q.title, q.standard, q.create_time, q.update_time
+ q.id, q.title, q.standard, q.create_time, q.update_time, pq.create_time pq_create_time
from question_paper p
left join paper_question_link pq on p.id = pq.paper_id and p.is_deleted = 0 and pq.is_deleted = 0
left join question q on q.id = pq.question_id and q.is_deleted = 0 and pq.is_deleted = 0
where p.id = #{paperId,jdbcType=BIGINT} and q.id is not null and p.is_deleted = 0
+ order by pq_create_time
diff --git a/src/main/resources/mapper/paper/ext/QuestionPaperExtMapper.xml b/src/main/resources/mapper/paper/ext/QuestionPaperExtMapper.xml
index 551d7958..c06d18ac 100644
--- a/src/main/resources/mapper/paper/ext/QuestionPaperExtMapper.xml
+++ b/src/main/resources/mapper/paper/ext/QuestionPaperExtMapper.xml
@@ -16,7 +16,7 @@
resultMap="com.achobeta.domain.paper.model.dao.mapper.QuestionPaperMapper.BaseResultMap">
select
-- 试卷与试卷库多对多,在本条 sql 容易出现重复行
- distinct p.id, p.title, p.description, p.create_time, p.update_time
+ distinct p.id, p.title, p.description, p.create_time, p.update_time, lp.create_time lp_create_time
from question_paper_library l
left join library_paper_link lp on l.id = lp.lib_id and l.is_deleted = 0 and lp.is_deleted = 0
left join question_paper p on p.id = lp.paper_id and p.is_deleted = 0 and lp.is_deleted = 0
@@ -28,6 +28,7 @@
+ order by lp_create_time
diff --git a/src/main/resources/mapper/paper/ext/QuestionPaperLibraryExtMapper.xml b/src/main/resources/mapper/paper/ext/QuestionPaperLibraryExtMapper.xml
index 1edfb210..5ad9b615 100644
--- a/src/main/resources/mapper/paper/ext/QuestionPaperLibraryExtMapper.xml
+++ b/src/main/resources/mapper/paper/ext/QuestionPaperLibraryExtMapper.xml
@@ -19,10 +19,11 @@
select
p.id, p.title, p.description, p.create_time, p.update_time,
- l.id l_id, l.lib_type l_lib_type, l.create_time l_create_time
+ l.id l_id, l.lib_type l_lib_type, l.create_time l_create_time, lp.create_time lp_create_time
from question_paper p
left join library_paper_link lp on p.id = lp.paper_id and p.is_deleted = 0 and lp.is_deleted = 0
left join question_paper_library l on l.id = lp.lib_id and l.is_deleted = 0 and lp.is_deleted = 0
where p.id = #{paperId,jdbcType=BIGINT} and p.is_deleted = 0
+ order by lp_create_time
diff --git a/src/main/resources/mapper/question/ext/QuestionExtMapper.xml b/src/main/resources/mapper/question/ext/QuestionExtMapper.xml
index 2a2f47cc..e9b7a136 100644
--- a/src/main/resources/mapper/question/ext/QuestionExtMapper.xml
+++ b/src/main/resources/mapper/question/ext/QuestionExtMapper.xml
@@ -16,7 +16,7 @@
resultMap="com.achobeta.domain.question.model.dao.mapper.QuestionMapper.BaseResultMap">
select
-- 问题与题库多对多,在本条 sql 容易出现重复行
- distinct q.id, q.title, q.standard, q.create_time, q.update_time
+ distinct q.id, q.title, q.standard, q.create_time, q.update_time, lq.create_time lq_create_time
from question_library l
left join library_question_link lq on l.id = lq.lib_id and l.is_deleted = 0 and lq.is_deleted = 0
left join question q on q.id = lq.question_id and q.is_deleted = 0 and lq.is_deleted = 0
@@ -28,5 +28,6 @@
+ order by lq_create_time
diff --git a/src/main/resources/mapper/question/ext/QuestionLibararyExtMapper.xml b/src/main/resources/mapper/question/ext/QuestionLibararyExtMapper.xml
index 8101f804..69994f5a 100644
--- a/src/main/resources/mapper/question/ext/QuestionLibararyExtMapper.xml
+++ b/src/main/resources/mapper/question/ext/QuestionLibararyExtMapper.xml
@@ -19,11 +19,12 @@
select
q.id, q.title, q.standard, q.create_time, q.update_time,
- l.id l_id, l.lib_type l_lib_type, l.create_time l_create_time
+ l.id l_id, l.lib_type l_lib_type, l.create_time l_create_time, lq.create_time lq_create_time
from question q
left join library_question_link lq on q.id = lq.question_id and q.is_deleted = 0 and lq.is_deleted = 0
left join question_library l on l.id = lq.lib_id and l.is_deleted = 0 and lq.is_deleted = 0
where q.id = #{questionId,jdbcType=BIGINT} and q.is_deleted = 0
+ order by lq_create_time
From 9ac4fe1a34c1d915e24f91720aaec2aa2aeb10d9 Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Tue, 15 Oct 2024 17:39:42 +0800
Subject: [PATCH 067/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../mapper/evaluate/ext/InterviewCommentExtMapper.xml | 2 +-
.../mapper/evaluate/ext/InterviewQuestionScoreExtMapper.xml | 5 +++--
.../resources/mapper/interview/ext/InterviewExtMapper.xml | 1 +
src/main/resources/mapper/member/ext/MemberExtMapper.xml | 4 ++--
.../mapper/paper/ext/PaperQuestionLinkExtMapper.xml | 2 +-
.../resources/mapper/paper/ext/QuestionPaperExtMapper.xml | 2 +-
.../mapper/paper/ext/QuestionPaperLibraryExtMapper.xml | 2 +-
.../resources/mapper/question/ext/QuestionExtMapper.xml | 2 +-
.../mapper/question/ext/QuestionLibararyExtMapper.xml | 2 +-
.../mapper/recruit/ext/ActivityParticipationExtMapper.xml | 6 ++++--
.../mapper/recruit/ext/RecruitmentBatchExtMapper.xml | 3 ++-
11 files changed, 18 insertions(+), 13 deletions(-)
diff --git a/src/main/resources/mapper/evaluate/ext/InterviewCommentExtMapper.xml b/src/main/resources/mapper/evaluate/ext/InterviewCommentExtMapper.xml
index e72295ae..8510997c 100644
--- a/src/main/resources/mapper/evaluate/ext/InterviewCommentExtMapper.xml
+++ b/src/main/resources/mapper/evaluate/ext/InterviewCommentExtMapper.xml
@@ -30,7 +30,7 @@
left join interview_comment c on c.interview_id = i.id and c.is_deleted = 0 and i.is_deleted = 0
left join user m on m.id = c.manager_id and m.is_deleted = 0 and c.is_deleted = 0
where i.id = #{interviewId,jdbcType=BIGINT} and c.id is not null and i.is_deleted = 0
- order by c.create_time
+ order by c.create_time asc
diff --git a/src/main/resources/mapper/evaluate/ext/InterviewQuestionScoreExtMapper.xml b/src/main/resources/mapper/evaluate/ext/InterviewQuestionScoreExtMapper.xml
index 717d0e05..87b41d71 100644
--- a/src/main/resources/mapper/evaluate/ext/InterviewQuestionScoreExtMapper.xml
+++ b/src/main/resources/mapper/evaluate/ext/InterviewQuestionScoreExtMapper.xml
@@ -12,7 +12,7 @@
select
- q.id, q.title, q.standard, q.create_time, q.update_time, avg(s.score) average
+ q.id, q.title, q.standard, q.create_time, q.update_time, avg(s.score) average, s.create_time s_create_time
from question q
left join interview_question_score s on q.id = s.question_id and s.is_deleted = 0 and q.is_deleted = 0 and s.score != -1
@@ -23,7 +23,8 @@
- group by q.id
+ group by q.create_time
+ order by s_create_time asc
diff --git a/src/main/resources/mapper/interview/ext/InterviewExtMapper.xml b/src/main/resources/mapper/interview/ext/InterviewExtMapper.xml
index d948d170..afe8fc3a 100644
--- a/src/main/resources/mapper/interview/ext/InterviewExtMapper.xml
+++ b/src/main/resources/mapper/interview/ext/InterviewExtMapper.xml
@@ -85,6 +85,7 @@
left join recruitment_batch b on b.id = a.batch_id and a.is_deleted = 0 and b.is_deleted = 0
left join stu_resume r on r.batch_id = b.id and r.user_id = stu.id and r.is_deleted = 0 and b.is_deleted = 0 and stu.is_deleted = 0
where i.id = #{interviewId,jdbcType=BIGINT} and i.is_deleted = 0
+ order by s.start_time asc, s.end_time asc
diff --git a/src/main/resources/mapper/member/ext/MemberExtMapper.xml b/src/main/resources/mapper/member/ext/MemberExtMapper.xml
index f04cd35d..9843c762 100644
--- a/src/main/resources/mapper/member/ext/MemberExtMapper.xml
+++ b/src/main/resources/mapper/member/ext/MemberExtMapper.xml
@@ -26,7 +26,7 @@
m.id, m.manager_id, m.parent_id,
stu.username u_username, stu.nickname u_nickname,
stu.email u_email, stu.phone_number u_phone_number,
- stu.user_type u_user_type, stu.avatar u_avatar, stu.id,
+ stu.user_type u_user_type, stu.avatar u_avatar, stu.create_time,
from user stu
left join member m on stu.id = m.manager_id and stu.is_deleted = 0 and m.is_deleted = 0
@@ -37,7 +37,7 @@
and r.batch_id = #{batchId,jdbcType=BIGINT}
- order by stu.id
+ order by stu.create_time asc
diff --git a/src/main/resources/mapper/paper/ext/PaperQuestionLinkExtMapper.xml b/src/main/resources/mapper/paper/ext/PaperQuestionLinkExtMapper.xml
index 9b624f31..d359fa5e 100644
--- a/src/main/resources/mapper/paper/ext/PaperQuestionLinkExtMapper.xml
+++ b/src/main/resources/mapper/paper/ext/PaperQuestionLinkExtMapper.xml
@@ -11,7 +11,7 @@
left join paper_question_link pq on p.id = pq.paper_id and p.is_deleted = 0 and pq.is_deleted = 0
left join question q on q.id = pq.question_id and q.is_deleted = 0 and pq.is_deleted = 0
where p.id = #{paperId,jdbcType=BIGINT} and q.id is not null and p.is_deleted = 0
- order by pq_create_time
+ order by pq_create_time asc
diff --git a/src/main/resources/mapper/paper/ext/QuestionPaperExtMapper.xml b/src/main/resources/mapper/paper/ext/QuestionPaperExtMapper.xml
index c06d18ac..c6fd0986 100644
--- a/src/main/resources/mapper/paper/ext/QuestionPaperExtMapper.xml
+++ b/src/main/resources/mapper/paper/ext/QuestionPaperExtMapper.xml
@@ -28,7 +28,7 @@
- order by lp_create_time
+ order by lp_create_time asc
diff --git a/src/main/resources/mapper/paper/ext/QuestionPaperLibraryExtMapper.xml b/src/main/resources/mapper/paper/ext/QuestionPaperLibraryExtMapper.xml
index 5ad9b615..9aed00d7 100644
--- a/src/main/resources/mapper/paper/ext/QuestionPaperLibraryExtMapper.xml
+++ b/src/main/resources/mapper/paper/ext/QuestionPaperLibraryExtMapper.xml
@@ -24,6 +24,6 @@
left join library_paper_link lp on p.id = lp.paper_id and p.is_deleted = 0 and lp.is_deleted = 0
left join question_paper_library l on l.id = lp.lib_id and l.is_deleted = 0 and lp.is_deleted = 0
where p.id = #{paperId,jdbcType=BIGINT} and p.is_deleted = 0
- order by lp_create_time
+ order by lp_create_time asc
diff --git a/src/main/resources/mapper/question/ext/QuestionExtMapper.xml b/src/main/resources/mapper/question/ext/QuestionExtMapper.xml
index e9b7a136..5ddf8826 100644
--- a/src/main/resources/mapper/question/ext/QuestionExtMapper.xml
+++ b/src/main/resources/mapper/question/ext/QuestionExtMapper.xml
@@ -28,6 +28,6 @@
- order by lq_create_time
+ order by lq_create_time asc
diff --git a/src/main/resources/mapper/question/ext/QuestionLibararyExtMapper.xml b/src/main/resources/mapper/question/ext/QuestionLibararyExtMapper.xml
index 69994f5a..a3e3bb24 100644
--- a/src/main/resources/mapper/question/ext/QuestionLibararyExtMapper.xml
+++ b/src/main/resources/mapper/question/ext/QuestionLibararyExtMapper.xml
@@ -24,7 +24,7 @@
left join library_question_link lq on q.id = lq.question_id and q.is_deleted = 0 and lq.is_deleted = 0
left join question_library l on l.id = lq.lib_id and l.is_deleted = 0 and lq.is_deleted = 0
where q.id = #{questionId,jdbcType=BIGINT} and q.is_deleted = 0
- order by lq_create_time
+ order by lq_create_time asc
diff --git a/src/main/resources/mapper/recruit/ext/ActivityParticipationExtMapper.xml b/src/main/resources/mapper/recruit/ext/ActivityParticipationExtMapper.xml
index ec36bdf4..1a1e8cf6 100644
--- a/src/main/resources/mapper/recruit/ext/ActivityParticipationExtMapper.xml
+++ b/src/main/resources/mapper/recruit/ext/ActivityParticipationExtMapper.xml
@@ -29,12 +29,13 @@
select
- q.id, q.title, pq.answer
+ q.id, q.title, pq.answer, pq.create_time pq_create_time
from
activity_participation ap
left join participation_question_link pq on ap.id = pq.participation_id and ap.is_deleted = 0 and pq.is_deleted = 0
left join question q on pq.question_id = q.id and pq.is_deleted = 0 and q.is_deleted = 0
where ap.id = #{participationId,jdbcType=BIGINT} and q.id is not null and ap.is_deleted = 0
+ order by pq_create_time
@@ -68,7 +69,7 @@
select
- ap.id, q.id q_id, q.title q_title, pq.answer q_answer,
+ ap.id, q.id q_id, q.title q_title, pq.answer q_answer, pq.create_time pq_create_time,
from
activity_participation ap
@@ -85,5 +86,6 @@
+ order by pq_create_time asc
diff --git a/src/main/resources/mapper/recruit/ext/RecruitmentBatchExtMapper.xml b/src/main/resources/mapper/recruit/ext/RecruitmentBatchExtMapper.xml
index 7ccb9f79..e005fa32 100644
--- a/src/main/resources/mapper/recruit/ext/RecruitmentBatchExtMapper.xml
+++ b/src/main/resources/mapper/recruit/ext/RecruitmentBatchExtMapper.xml
@@ -6,10 +6,11 @@
select
- s.id, s.user_id, s.student_id, s.name, u.username, s.email, s.gender, s.grade, s.major, s.class, s.status
+ s.id, s.user_id, s.student_id, s.name, u.username, s.email, s.gender, s.grade, s.major, s.class, s.status, s.create_time
from recruitment_batch rb
left join stu_resume s on s.batch_id = rb.id and s.is_deleted = 0 and rb.is_deleted = 0
left join user u on s.user_id = u.id and s.is_deleted = 0 and u.is_deleted = 0
where rb.id = #{batchId,jdbcType=BIGINT} and s.id is not null and rb.is_deleted = 0
+ order by s.create_time asc
From e4118f1870a7b70bc4c9c0ce296a801638198a8d Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Tue, 15 Oct 2024 17:39:58 +0800
Subject: [PATCH 068/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/main/resources/mapper/feedback/UserFeedbackMapper.xml | 7 ++++---
src/main/resources/mapper/message/MessageMapper.xml | 1 +
.../resources/mapper/message/MessageTemplateMapper.xml | 1 +
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/main/resources/mapper/feedback/UserFeedbackMapper.xml b/src/main/resources/mapper/feedback/UserFeedbackMapper.xml
index bd83f350..2f580a4e 100644
--- a/src/main/resources/mapper/feedback/UserFeedbackMapper.xml
+++ b/src/main/resources/mapper/feedback/UserFeedbackMapper.xml
@@ -9,18 +9,19 @@
-
+
-
+
+
id,user_id,batch_id,
- message_id,title,content,
+ message_id,tittle,content,
attchment,is_handle,version,
is_deleted,create_time,update_time
diff --git a/src/main/resources/mapper/message/MessageMapper.xml b/src/main/resources/mapper/message/MessageMapper.xml
index 2977949a..efc5abeb 100644
--- a/src/main/resources/mapper/message/MessageMapper.xml
+++ b/src/main/resources/mapper/message/MessageMapper.xml
@@ -12,6 +12,7 @@
+
diff --git a/src/main/resources/mapper/message/MessageTemplateMapper.xml b/src/main/resources/mapper/message/MessageTemplateMapper.xml
index e11c0190..6c7daaf8 100644
--- a/src/main/resources/mapper/message/MessageTemplateMapper.xml
+++ b/src/main/resources/mapper/message/MessageTemplateMapper.xml
@@ -9,6 +9,7 @@
+
From 8dbe502cacff423c72269d5d5f02526496852c92 Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Tue, 15 Oct 2024 17:57:09 +0800
Subject: [PATCH 069/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../domain/paper/handler/ext/RemovePaperLPLinkHandler.java | 7 +++++++
.../paper/service/impl/PaperQuestionLinkServiceImpl.java | 5 ++++-
.../service/impl/ParticipationQuestionLinkServiceImpl.java | 5 ++++-
3 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/src/main/java/com/achobeta/domain/paper/handler/ext/RemovePaperLPLinkHandler.java b/src/main/java/com/achobeta/domain/paper/handler/ext/RemovePaperLPLinkHandler.java
index 642e2b55..65a4c1ef 100644
--- a/src/main/java/com/achobeta/domain/paper/handler/ext/RemovePaperLPLinkHandler.java
+++ b/src/main/java/com/achobeta/domain/paper/handler/ext/RemovePaperLPLinkHandler.java
@@ -2,7 +2,9 @@
import com.achobeta.domain.paper.handler.RemovePaperHandler;
import com.achobeta.domain.paper.model.entity.LibraryPaperLink;
+import com.achobeta.domain.paper.model.entity.PaperQuestionLink;
import com.achobeta.domain.paper.service.LibraryPaperLinkService;
+import com.achobeta.domain.paper.service.PaperQuestionLinkService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;
@@ -19,12 +21,17 @@ public class RemovePaperLPLinkHandler extends RemovePaperHandler {
private final LibraryPaperLinkService libraryPaperLinkService;
+ private final PaperQuestionLinkService paperQuestionLinkService;
+
@Override
public void handle(Long paperId) {
// 删除关联表的一些行
libraryPaperLinkService.lambdaUpdate()
.eq(LibraryPaperLink::getPaperId, paperId)
.remove();
+ paperQuestionLinkService.lambdaUpdate()
+ .eq(PaperQuestionLink::getPaperId, paperId)
+ .remove();
super.doNextHandler(paperId);
}
diff --git a/src/main/java/com/achobeta/domain/paper/service/impl/PaperQuestionLinkServiceImpl.java b/src/main/java/com/achobeta/domain/paper/service/impl/PaperQuestionLinkServiceImpl.java
index dfbe77e7..c89c7503 100644
--- a/src/main/java/com/achobeta/domain/paper/service/impl/PaperQuestionLinkServiceImpl.java
+++ b/src/main/java/com/achobeta/domain/paper/service/impl/PaperQuestionLinkServiceImpl.java
@@ -17,7 +17,10 @@
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
-import java.util.*;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Optional;
+import java.util.Set;
/**
* @author 马拉圈
diff --git a/src/main/java/com/achobeta/domain/recruit/service/impl/ParticipationQuestionLinkServiceImpl.java b/src/main/java/com/achobeta/domain/recruit/service/impl/ParticipationQuestionLinkServiceImpl.java
index 4956602b..463a4373 100644
--- a/src/main/java/com/achobeta/domain/recruit/service/impl/ParticipationQuestionLinkServiceImpl.java
+++ b/src/main/java/com/achobeta/domain/recruit/service/impl/ParticipationQuestionLinkServiceImpl.java
@@ -15,7 +15,10 @@
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
-import java.util.*;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
/**
* @author 马拉圈
From 8ecac40d8df5758c4aa39e961137bdbcf4114955 Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Tue, 15 Oct 2024 19:02:33 +0800
Subject: [PATCH 070/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../mapper/evaluate/ext/InterviewQuestionScoreExtMapper.xml | 4 ++--
src/main/resources/mapper/member/ext/MemberExtMapper.xml | 2 +-
.../mapper/recruit/ext/ActivityParticipationExtMapper.xml | 4 ++--
.../resources/mapper/schedule/ext/InterviewerExtMapper.xml | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/main/resources/mapper/evaluate/ext/InterviewQuestionScoreExtMapper.xml b/src/main/resources/mapper/evaluate/ext/InterviewQuestionScoreExtMapper.xml
index 87b41d71..9ba27282 100644
--- a/src/main/resources/mapper/evaluate/ext/InterviewQuestionScoreExtMapper.xml
+++ b/src/main/resources/mapper/evaluate/ext/InterviewQuestionScoreExtMapper.xml
@@ -16,14 +16,14 @@
from question q
left join interview_question_score s on q.id = s.question_id and s.is_deleted = 0 and q.is_deleted = 0 and s.score != -1
- q.is_deleted = 0
+ q.id is not null and q.is_deleted = 0
#{questionId,jdbcType=BIGINT}
- group by q.create_time
+ group by q.id
order by s_create_time asc
diff --git a/src/main/resources/mapper/member/ext/MemberExtMapper.xml b/src/main/resources/mapper/member/ext/MemberExtMapper.xml
index 9843c762..7bffaaaa 100644
--- a/src/main/resources/mapper/member/ext/MemberExtMapper.xml
+++ b/src/main/resources/mapper/member/ext/MemberExtMapper.xml
@@ -32,7 +32,7 @@
left join member m on stu.id = m.manager_id and stu.is_deleted = 0 and m.is_deleted = 0
left join stu_resume r on r.id = m.resume_id and r.is_deleted = 0 and m.is_deleted = 0
- stu.user_type = 2 and stu.is_deleted = 0
+ stu.id is not null and stu.user_type = 2 and stu.is_deleted = 0
and r.batch_id = #{batchId,jdbcType=BIGINT}
diff --git a/src/main/resources/mapper/recruit/ext/ActivityParticipationExtMapper.xml b/src/main/resources/mapper/recruit/ext/ActivityParticipationExtMapper.xml
index 1a1e8cf6..463b2720 100644
--- a/src/main/resources/mapper/recruit/ext/ActivityParticipationExtMapper.xml
+++ b/src/main/resources/mapper/recruit/ext/ActivityParticipationExtMapper.xml
@@ -57,7 +57,7 @@
left join participation_period_link pp on ap.id = pp.participation_id and ap.is_deleted = 0 and pp.is_deleted = 0
left join time_period t on pp.period_id = t.id and pp.is_deleted = 0 and t.is_deleted = 0
- ap.is_deleted = 0
+ ap.id is not null and ap.is_deleted = 0
#{participationId,jdbcType=BIGINT}
@@ -79,7 +79,7 @@
left join participation_question_link pq on ap.id = pq.participation_id and ap.is_deleted = 0 and pq.is_deleted = 0
left join question q on pq.question_id = q.id and pq.is_deleted = 0 and q.is_deleted = 0
- ap.is_deleted = 0
+ ap.id is not null and ap.is_deleted = 0
#{participationId,jdbcType=BIGINT}
diff --git a/src/main/resources/mapper/schedule/ext/InterviewerExtMapper.xml b/src/main/resources/mapper/schedule/ext/InterviewerExtMapper.xml
index c599021a..e5bd102a 100644
--- a/src/main/resources/mapper/schedule/ext/InterviewerExtMapper.xml
+++ b/src/main/resources/mapper/schedule/ext/InterviewerExtMapper.xml
@@ -26,7 +26,7 @@
left join interviewer i on s.id = i.schedule_id and s.is_deleted = 0 and i.is_deleted = 0
left join user m on m.id = i.manager_id and m.is_deleted = 0 and i.is_deleted = 0
- s.is_deleted = 0 and m.id is not null
+ s.id is not null and s.is_deleted = 0 and m.id is not null
#{scheduleId,jdbcType=BIGINT}
From 82d3d779ec22760107fa21704db29c7509a36776 Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Tue, 15 Oct 2024 19:03:45 +0800
Subject: [PATCH 071/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 94887463..35fa158d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -38,7 +38,7 @@
prodprod
- debug
+ infotrue
From fbbb30459b3767ca033534c7765a21462594d5fc Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Tue, 15 Oct 2024 19:13:06 +0800
Subject: [PATCH 072/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../mapper/evaluate/ext/InterviewQuestionScoreExtMapper.xml | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/main/resources/mapper/evaluate/ext/InterviewQuestionScoreExtMapper.xml b/src/main/resources/mapper/evaluate/ext/InterviewQuestionScoreExtMapper.xml
index 9ba27282..c580e416 100644
--- a/src/main/resources/mapper/evaluate/ext/InterviewQuestionScoreExtMapper.xml
+++ b/src/main/resources/mapper/evaluate/ext/InterviewQuestionScoreExtMapper.xml
@@ -12,7 +12,7 @@
select
- q.id, q.title, q.standard, q.create_time, q.update_time, avg(s.score) average, s.create_time s_create_time
+ q.id, q.title, q.standard, q.create_time, q.update_time, avg(s.score) average
from question q
left join interview_question_score s on q.id = s.question_id and s.is_deleted = 0 and q.is_deleted = 0 and s.score != -1
@@ -24,7 +24,6 @@
group by q.id
- order by s_create_time asc
From 231af5de4f90b6742b89d58e98c1901452aa810e Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Tue, 15 Oct 2024 23:05:30 +0800
Subject: [PATCH 073/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../paper/service/impl/PaperQuestionLinkServiceImpl.java | 4 ++--
.../mapper/evaluate/ext/InterviewQuestionScoreExtMapper.xml | 1 +
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/main/java/com/achobeta/domain/paper/service/impl/PaperQuestionLinkServiceImpl.java b/src/main/java/com/achobeta/domain/paper/service/impl/PaperQuestionLinkServiceImpl.java
index c89c7503..20b0aadf 100644
--- a/src/main/java/com/achobeta/domain/paper/service/impl/PaperQuestionLinkServiceImpl.java
+++ b/src/main/java/com/achobeta/domain/paper/service/impl/PaperQuestionLinkServiceImpl.java
@@ -17,7 +17,7 @@
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
-import java.util.LinkedHashSet;
+import java.util.HashSet;
import java.util.List;
import java.util.Optional;
import java.util.Set;
@@ -54,7 +54,7 @@ public Optional getPaperQuestionLink(Long paperId, Long quest
@Override
@Transactional
public void addQuestionsForPaper(Long paperId, List questionIds) {
- Set hash = new LinkedHashSet<>();
+ Set hash = new HashSet<>();
// 获取试卷的所有题
getQuestionsOnPaper(paperId).forEach(questionVO -> hash.add(questionVO.getId()));
// 将不存在于原试卷的题滤出来
diff --git a/src/main/resources/mapper/evaluate/ext/InterviewQuestionScoreExtMapper.xml b/src/main/resources/mapper/evaluate/ext/InterviewQuestionScoreExtMapper.xml
index c580e416..d406f29a 100644
--- a/src/main/resources/mapper/evaluate/ext/InterviewQuestionScoreExtMapper.xml
+++ b/src/main/resources/mapper/evaluate/ext/InterviewQuestionScoreExtMapper.xml
@@ -24,6 +24,7 @@
group by q.id
+ order by q.create_time
From e71867a50156116b485bbf1c1f27d79a55e2b4e5 Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Wed, 16 Oct 2024 00:33:37 +0800
Subject: [PATCH 074/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../domain/resource/service/impl/ResourceServiceImpl.java | 3 +--
src/main/java/com/achobeta/util/HttpRequestUtil.java | 2 +-
src/main/java/com/achobeta/util/HttpServletUtil.java | 6 ++++++
.../mapper/schedule/ext/InterviewScheduleExtMapper.xml | 1 +
4 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/main/java/com/achobeta/domain/resource/service/impl/ResourceServiceImpl.java b/src/main/java/com/achobeta/domain/resource/service/impl/ResourceServiceImpl.java
index 92fb1877..1c1ccdb2 100644
--- a/src/main/java/com/achobeta/domain/resource/service/impl/ResourceServiceImpl.java
+++ b/src/main/java/com/achobeta/domain/resource/service/impl/ResourceServiceImpl.java
@@ -167,8 +167,7 @@ public Long upload(Long userId, String originalName, byte[] data, ResourceAccess
if(ResourceUtil.matchType(contentType, ResourceType.IMAGE) && compressionThreshold.compareTo(data.length) <= 0) {
// 压缩图片
data = MediaUtil.compressImage(data);
- suffix = "." + MediaUtil.COMPRESS_FORMAT_NAME;
- originalName = ResourceUtil.changeSuffix(originalName, suffix);
+ originalName = ResourceUtil.changeExtension(originalName, MediaUtil.COMPRESS_FORMAT_NAME);
} else {
// 使用原后缀
suffix = ResourceUtil.getSuffix(originalName);
diff --git a/src/main/java/com/achobeta/util/HttpRequestUtil.java b/src/main/java/com/achobeta/util/HttpRequestUtil.java
index 3f4b8664..34e6675f 100644
--- a/src/main/java/com/achobeta/util/HttpRequestUtil.java
+++ b/src/main/java/com/achobeta/util/HttpRequestUtil.java
@@ -22,10 +22,10 @@
/**
* Created With Intellij IDEA
- * Description:
* User: 马拉圈
* Date: 2024-09-26
* Time: 7:41
+ * Description: 用 Gson 序列化,已有业务依赖 Gson,不建议修改为其他序列化器
*/
public class HttpRequestUtil {
diff --git a/src/main/java/com/achobeta/util/HttpServletUtil.java b/src/main/java/com/achobeta/util/HttpServletUtil.java
index 52b0134a..8056a793 100644
--- a/src/main/java/com/achobeta/util/HttpServletUtil.java
+++ b/src/main/java/com/achobeta/util/HttpServletUtil.java
@@ -29,10 +29,16 @@ public static Optional getAttributes() {
return Optional.ofNullable((ServletRequestAttributes) RequestContextHolder.getRequestAttributes());
}
+ /**
+ * 获取本次请求的 HttpServletRequest 对象
+ */
public static HttpServletRequest getRequest() {
return getAttributes().map(ServletRequestAttributes::getRequest).orElseThrow(GlobalServiceException::new);
}
+ /**
+ * 获取本次请求的 HttpServletResponse 对象
+ */
public static HttpServletResponse getResponse() {
return getAttributes().map(ServletRequestAttributes::getResponse).orElseThrow(GlobalServiceException::new);
}
diff --git a/src/main/resources/mapper/schedule/ext/InterviewScheduleExtMapper.xml b/src/main/resources/mapper/schedule/ext/InterviewScheduleExtMapper.xml
index 81815e13..c319b840 100644
--- a/src/main/resources/mapper/schedule/ext/InterviewScheduleExtMapper.xml
+++ b/src/main/resources/mapper/schedule/ext/InterviewScheduleExtMapper.xml
@@ -16,6 +16,7 @@
+
From 84f431a3a848bd77b9b1179140486267990945ce Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Wed, 16 Oct 2024 00:43:08 +0800
Subject: [PATCH 075/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../machine/events/internal/InterviewExperienceHelper.java | 1 -
.../evaluate/model/vo/InterviewExperienceTemplateInner.java | 2 --
src/main/resources/templates/interview-experience-model.html | 2 --
3 files changed, 5 deletions(-)
diff --git a/src/main/java/com/achobeta/domain/evaluate/machine/events/internal/InterviewExperienceHelper.java b/src/main/java/com/achobeta/domain/evaluate/machine/events/internal/InterviewExperienceHelper.java
index 0812f0ba..bf9beb24 100644
--- a/src/main/java/com/achobeta/domain/evaluate/machine/events/internal/InterviewExperienceHelper.java
+++ b/src/main/java/com/achobeta/domain/evaluate/machine/events/internal/InterviewExperienceHelper.java
@@ -91,7 +91,6 @@ public Action getPerformActio
InterviewExperienceTemplateInner inner = InterviewExperienceTemplateInner.builder()
.title(question.getTitle())
.score(question.getScore())
- .average(question.getAverage())
.standard(target)
.build();
replaceResourceList.add(new ReplaceResource(target, question.getStandard()));
diff --git a/src/main/java/com/achobeta/domain/evaluate/model/vo/InterviewExperienceTemplateInner.java b/src/main/java/com/achobeta/domain/evaluate/model/vo/InterviewExperienceTemplateInner.java
index 08903b4f..19945649 100644
--- a/src/main/java/com/achobeta/domain/evaluate/model/vo/InterviewExperienceTemplateInner.java
+++ b/src/main/java/com/achobeta/domain/evaluate/model/vo/InterviewExperienceTemplateInner.java
@@ -22,8 +22,6 @@ public class InterviewExperienceTemplateInner {
private Integer score;
- private Double average;
-
private String standard;
}
diff --git a/src/main/resources/templates/interview-experience-model.html b/src/main/resources/templates/interview-experience-model.html
index 5d4913c9..bdc63846 100644
--- a/src/main/resources/templates/interview-experience-model.html
+++ b/src/main/resources/templates/interview-experience-model.html
@@ -39,8 +39,6 @@
- 历史平均分:
- 标准答案:
From b10649724b011e1b51821a287a17246d0a18b3ab Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Wed, 16 Oct 2024 13:32:39 +0800
Subject: [PATCH 076/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../handler/GlobalExceptionHandler.java | 55 ++++++++++---------
.../achobeta/interceptor/UserInterceptor.java | 19 +++----
2 files changed, 39 insertions(+), 35 deletions(-)
diff --git a/src/main/java/com/achobeta/handler/GlobalExceptionHandler.java b/src/main/java/com/achobeta/handler/GlobalExceptionHandler.java
index 35527199..32f29484 100644
--- a/src/main/java/com/achobeta/handler/GlobalExceptionHandler.java
+++ b/src/main/java/com/achobeta/handler/GlobalExceptionHandler.java
@@ -1,12 +1,14 @@
package com.achobeta.handler;
import com.achobeta.common.SystemJsonResponse;
-import com.achobeta.common.enums.GlobalServiceStatusCode;
+import com.achobeta.config.RequestIdConfig;
import com.achobeta.exception.GlobalServiceException;
import com.mysql.jdbc.MysqlDataTruncation;
import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.ConstraintViolation;
import jakarta.validation.ConstraintViolationException;
+import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.tomcat.util.http.fileupload.FileUploadException;
import org.springframework.dao.DataIntegrityViolationException;
@@ -32,38 +34,43 @@
*/
@Slf4j
@RestControllerAdvice
+@RequiredArgsConstructor
public class GlobalExceptionHandler {
+ private final RequestIdConfig requestIdConfig;
+
+ private void logError(HttpServletRequest request, HttpServletResponse response, Exception e) {
+ log.error("请求 {} 访问接口 {},错误信息 {}",
+ response.getHeader(requestIdConfig.getHeader()),
+ request.getRequestURI(),
+ e.getMessage()
+ );
+ }
+
@ExceptionHandler(GlobalServiceException.class)
- public SystemJsonResponse handleGlobalServiceException(GlobalServiceException e, HttpServletRequest request) {
- String requestURI = request.getRequestURI();
- String message = e.getMessage();
- GlobalServiceStatusCode statusCode = e.getStatusCode();
- log.error("请求地址'{}', {}: '{}'", requestURI, statusCode, message);
- return SystemJsonResponse.CUSTOMIZE_MSG_ERROR(statusCode, message);
+ public SystemJsonResponse handleGlobalServiceException(GlobalServiceException e, HttpServletRequest request, HttpServletResponse response) {
+ logError(request, response, e);
+ return SystemJsonResponse.CUSTOMIZE_MSG_ERROR(e.getStatusCode(), e.getMessage());
}
@ExceptionHandler({FileUploadException.class})
- public SystemJsonResponse handleFileUploadException(FileUploadException e, HttpServletRequest request) {
- String requestURI = request.getRequestURI();
- String message = e.getMessage();
- log.error("请求地址'{}', '{}'", requestURI, message);
+ public SystemJsonResponse handleFileUploadException(FileUploadException e, HttpServletRequest request, HttpServletResponse response) {
+ logError(request, response, e);
+ String message = "文件上传异常";
return SystemJsonResponse.CUSTOMIZE_MSG_ERROR(RESOURCE_NOT_VALID, message);
}
@ExceptionHandler({DataIntegrityViolationException.class})
- public SystemJsonResponse handleDataIntegrityViolationException(DataIntegrityViolationException e, HttpServletRequest request) {
- String requestURI = request.getRequestURI();
- String message = e.getCause() instanceof MysqlDataTruncation ? "文本长度超出限制" : "数据异常";
- log.error("请求地址'{}', '{}', '{}'", requestURI, message, e.getMessage());
+ public SystemJsonResponse handleDataIntegrityViolationException(DataIntegrityViolationException e, HttpServletRequest request, HttpServletResponse response) {
+ logError(request, response, e);
+ String message = e.getCause() instanceof MysqlDataTruncation ? "数据截断,请检查长度、范围和类型" : "数据非法";
return SystemJsonResponse.CUSTOMIZE_MSG_ERROR(SYSTEM_SERVICE_ERROR, message);
}
@ExceptionHandler({SQLException.class})
- public SystemJsonResponse handleSQLException(SQLException e, HttpServletRequest request) {
- String requestURI = request.getRequestURI();
- String message = "数据异常";
- log.error("请求地址'{}', '{}', '{}'", requestURI, message, e.getMessage());
+ public SystemJsonResponse handleSQLException(SQLException e, HttpServletRequest request, HttpServletResponse response) {
+ logError(request, response, e);
+ String message = "数据访问与交互异常";
return SystemJsonResponse.CUSTOMIZE_MSG_ERROR(SYSTEM_SERVICE_ERROR, message);
}
@@ -71,9 +78,8 @@ public SystemJsonResponse handleSQLException(SQLException e, HttpServletRequest
* 自定义验证异常
*/
@ExceptionHandler(ConstraintViolationException.class)
- public SystemJsonResponse constraintViolationException(ConstraintViolationException e, HttpServletRequest request) {
- String requestURI = request.getRequestURI();
- log.error("请求地址'{}', 自定义验证异常'{}'", requestURI, e.getMessage());
+ public SystemJsonResponse constraintViolationException(ConstraintViolationException e, HttpServletRequest request, HttpServletResponse response) {
+ logError(request, response, e);
String message = e.getConstraintViolations().stream()
.map(ConstraintViolation::getMessage)
.filter(Objects::nonNull)
@@ -82,9 +88,8 @@ public SystemJsonResponse constraintViolationException(ConstraintViolationExcept
}
@ExceptionHandler(MethodArgumentNotValidException.class)
- public SystemJsonResponse ValidationHandler(MethodArgumentNotValidException e, HttpServletRequest request) {
- String requestURI = request.getRequestURI();
- log.error("请求地址'{}', 自定义验证异常'{}'", requestURI, e.getMessage());
+ public SystemJsonResponse ValidationHandler(MethodArgumentNotValidException e, HttpServletRequest request, HttpServletResponse response) {
+ logError(request, response, e);
String message = e.getBindingResult().getFieldErrors().stream()
.map(FieldError::getDefaultMessage)
.filter(Objects::nonNull)
diff --git a/src/main/java/com/achobeta/interceptor/UserInterceptor.java b/src/main/java/com/achobeta/interceptor/UserInterceptor.java
index 9c454a9e..7e5518d9 100644
--- a/src/main/java/com/achobeta/interceptor/UserInterceptor.java
+++ b/src/main/java/com/achobeta/interceptor/UserInterceptor.java
@@ -88,15 +88,16 @@ public UserHelper getUserHelper() {
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
+ // 设置请求 id
+ long requestId = requestIdGenerator.nextId();
+ response.setHeader(requestIdConfig.getHeader(), String.valueOf(requestId));
+
//可以解决拦截器跨域问题
if (!(handler instanceof HandlerMethod)) {
// 并不处理非目标方法的请求
// todo: 例如通过本服务,但不是通过目标方法获取资源的请求,而这些请求需要进行其他的处理!
return Boolean.TRUE;
}
- // 设置请求 id
- long requestId = requestIdGenerator.nextId();
- response.setHeader(requestIdConfig.getHeader(), String.valueOf(requestId));
// 获取目标方法
Method targetMethod = ((HandlerMethod) handler).getMethod();
// 获取 intercept 注解实例
@@ -123,13 +124,11 @@ public boolean preHandle(HttpServletRequest request, HttpServletResponse respons
@Override
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
try {
- if(handler instanceof HandlerMethod) {
- String requestId = response.getHeader(requestIdConfig.getHeader());
- log.warn("请求 {} 访问接口 {},响应 HTTP 状态码 {},错误信息 {}",
- requestId, request.getRequestURI(), response.getStatus(),
- Optional.ofNullable(ex).map(Exception::getMessage).orElse(null)
- );
- }
+ String requestId = response.getHeader(requestIdConfig.getHeader());
+ log.warn("请求 {} 访问接口 {},响应 HTTP 状态码 {},错误信息 {}",
+ requestId, request.getRequestURI(), response.getStatus(),
+ Optional.ofNullable(ex).map(Exception::getMessage).orElse(null)
+ );
} finally {
log.info("删除本地线程变量");
BaseContext.removeCurrentUser();
From de9cb6aef3afb174b0d508cadb7a017d1f15d2fc Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Wed, 16 Oct 2024 13:45:52 +0800
Subject: [PATCH 077/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../resource/service/impl/ObjectStorageMinioServiceImpl.java | 2 +-
.../domain/resource/service/impl/ResourceServiceImpl.java | 5 +++--
src/main/java/com/achobeta/util/MediaUtil.java | 2 ++
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/main/java/com/achobeta/domain/resource/service/impl/ObjectStorageMinioServiceImpl.java b/src/main/java/com/achobeta/domain/resource/service/impl/ObjectStorageMinioServiceImpl.java
index d7a50673..0068d329 100644
--- a/src/main/java/com/achobeta/domain/resource/service/impl/ObjectStorageMinioServiceImpl.java
+++ b/src/main/java/com/achobeta/domain/resource/service/impl/ObjectStorageMinioServiceImpl.java
@@ -112,7 +112,7 @@ public String compressImage(Long userId, String fileName) throws Exception {
// 压缩图片
bytes = MediaUtil.compressImage(bytes);
// 上传图片
- String uniqueFileName = ResourceUtil.getUniqueFileName(userId, "." + MediaUtil.COMPRESS_FORMAT_NAME);
+ String uniqueFileName = ResourceUtil.getUniqueFileName(userId, MediaUtil.COMPRESS_FORMAT_SUFFIX);
minioEngine.upload(uniqueFileName, bytes);
return uniqueFileName;
}
diff --git a/src/main/java/com/achobeta/domain/resource/service/impl/ResourceServiceImpl.java b/src/main/java/com/achobeta/domain/resource/service/impl/ResourceServiceImpl.java
index 1c1ccdb2..80ca3366 100644
--- a/src/main/java/com/achobeta/domain/resource/service/impl/ResourceServiceImpl.java
+++ b/src/main/java/com/achobeta/domain/resource/service/impl/ResourceServiceImpl.java
@@ -167,7 +167,8 @@ public Long upload(Long userId, String originalName, byte[] data, ResourceAccess
if(ResourceUtil.matchType(contentType, ResourceType.IMAGE) && compressionThreshold.compareTo(data.length) <= 0) {
// 压缩图片
data = MediaUtil.compressImage(data);
- originalName = ResourceUtil.changeExtension(originalName, MediaUtil.COMPRESS_FORMAT_NAME);
+ suffix = MediaUtil.COMPRESS_FORMAT_SUFFIX;
+ originalName = ResourceUtil.changeSuffix(originalName, suffix);
} else {
// 使用原后缀
suffix = ResourceUtil.getSuffix(originalName);
@@ -307,7 +308,7 @@ public void compressImage(Long code) throws Exception {
String compressImage = objectStorageService.compressImage(resource.getUserId(), resource.getFileName());
digitalResourceService.renameDigitalResource(
resource.getId(),
- ResourceUtil.changeExtension(resource.getOriginalName(), MediaUtil.COMPRESS_FORMAT_NAME),
+ ResourceUtil.changeSuffix(resource.getOriginalName(), MediaUtil.COMPRESS_FORMAT_SUFFIX),
compressImage
);
}
diff --git a/src/main/java/com/achobeta/util/MediaUtil.java b/src/main/java/com/achobeta/util/MediaUtil.java
index a6b6d4a7..3c4c0e18 100644
--- a/src/main/java/com/achobeta/util/MediaUtil.java
+++ b/src/main/java/com/achobeta/util/MediaUtil.java
@@ -27,6 +27,8 @@ public class MediaUtil {
public final static String COMPRESS_FORMAT_NAME = "jpg"; // 压缩图片格式
+ public final static String COMPRESS_FORMAT_SUFFIX = "." + COMPRESS_FORMAT_NAME; // 压缩图片格式
+
public final static float COMPRESS_SCALE = 1.0f; // 压缩图片大小
public final static float COMPRESS_QUALITY = 0.5f; // 压缩图片质量
From 2c516690dcc542a46b41c9ded199499e51213df4 Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Wed, 16 Oct 2024 16:00:43 +0800
Subject: [PATCH 078/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../domain/resource/service/ResourceService.java | 2 +-
.../resource/service/impl/ResourceServiceImpl.java | 5 +++--
.../student/service/impl/StuResumeServiceImpl.java | 8 +++++++-
.../domain/users/service/impl/UserServiceImpl.java | 9 ++++++---
.../mapper/evaluate/ext/InterviewCommentExtMapper.xml | 2 +-
5 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/src/main/java/com/achobeta/domain/resource/service/ResourceService.java b/src/main/java/com/achobeta/domain/resource/service/ResourceService.java
index cbb878f0..f44222bd 100644
--- a/src/main/java/com/achobeta/domain/resource/service/ResourceService.java
+++ b/src/main/java/com/achobeta/domain/resource/service/ResourceService.java
@@ -35,7 +35,7 @@ public interface ResourceService {
void checkImage(Long code);
- void checkAndRemoveImage(Long code, Long old);
+ Boolean shouldRemove(Long code, Long old);
String getSystemUrl(Long code);
diff --git a/src/main/java/com/achobeta/domain/resource/service/impl/ResourceServiceImpl.java b/src/main/java/com/achobeta/domain/resource/service/impl/ResourceServiceImpl.java
index 80ca3366..70526148 100644
--- a/src/main/java/com/achobeta/domain/resource/service/impl/ResourceServiceImpl.java
+++ b/src/main/java/com/achobeta/domain/resource/service/impl/ResourceServiceImpl.java
@@ -125,11 +125,12 @@ public void checkImage(Long code) {
@Override
@Transactional
- public void checkAndRemoveImage(Long code, Long old) {
+ public Boolean shouldRemove(Long code, Long old) {
if(!code.equals(old)) {
checkImage(code);
- removeKindly(old);
+ return Boolean.TRUE;
}
+ return Boolean.FALSE;
}
@Override
diff --git a/src/main/java/com/achobeta/domain/student/service/impl/StuResumeServiceImpl.java b/src/main/java/com/achobeta/domain/student/service/impl/StuResumeServiceImpl.java
index ae002648..90a98790 100644
--- a/src/main/java/com/achobeta/domain/student/service/impl/StuResumeServiceImpl.java
+++ b/src/main/java/com/achobeta/domain/student/service/impl/StuResumeServiceImpl.java
@@ -80,7 +80,8 @@ public void submitResume(StuResumeDTO stuResumeDTO, Long userId) {
StuSimpleResumeDTO resumeDTO = stuResumeDTO.getStuSimpleResumeDTO();
// 检测
- resourceService.checkAndRemoveImage(resumeDTO.getImage(), stuResume.getImage());
+ Long oldImage = stuResume.getImage();
+ Boolean shouldRemove = resourceService.shouldRemove(resumeDTO.getImage(), oldImage);
//附件列表
List stuAttachmentDTOList = stuResumeDTO.getStuAttachmentDTOList();
@@ -91,6 +92,11 @@ public void submitResume(StuResumeDTO stuResumeDTO, Long userId) {
//保存附件信息
saveStuAttachment(stuAttachmentDTOList, stuResume.getId());
+
+ // 等提交成功后再删除
+ if(Boolean.TRUE.equals(shouldRemove)) {
+ resourceService.removeKindly(oldImage);
+ }
}, () -> {}, simpleLockStrategy);
}
diff --git a/src/main/java/com/achobeta/domain/users/service/impl/UserServiceImpl.java b/src/main/java/com/achobeta/domain/users/service/impl/UserServiceImpl.java
index 88421b44..8ec37b3d 100644
--- a/src/main/java/com/achobeta/domain/users/service/impl/UserServiceImpl.java
+++ b/src/main/java/com/achobeta/domain/users/service/impl/UserServiceImpl.java
@@ -56,12 +56,15 @@ public void updateUser(Long userId, UserDTO userDTO) {
// 设置默认头像
Long avatar = userDTO.getAvatar();
UserEntity userEntity = UserConverter.INSTANCE.userDTOToUser(userDTO);
- getUserById(userId).map(UserEntity::getAvatar).ifPresent(code -> {
- resourceService.checkAndRemoveImage(avatar, code);
- });
+ Long oldAvatar = getUserById(userId).map(UserEntity::getAvatar).orElse(null);
+ Boolean shouldRemove = resourceService.shouldRemove(avatar, oldAvatar);
// 更新
this.lambdaUpdate()
.eq(UserEntity::getId, userId)
.update(userEntity);
+ // 更新成功再删除
+ if(Boolean.TRUE.equals(shouldRemove)) {
+ resourceService.removeKindly(oldAvatar);
+ }
}
}
diff --git a/src/main/resources/mapper/evaluate/ext/InterviewCommentExtMapper.xml b/src/main/resources/mapper/evaluate/ext/InterviewCommentExtMapper.xml
index 8510997c..6eab9f40 100644
--- a/src/main/resources/mapper/evaluate/ext/InterviewCommentExtMapper.xml
+++ b/src/main/resources/mapper/evaluate/ext/InterviewCommentExtMapper.xml
@@ -25,7 +25,7 @@
select
c.id, c.content, c.create_time, c.update_time,
m.id m_id, m.username m_username, m.nickname m_nickname,m.email m_email,
- m.phone_number m_phone_number, m.avatar m_acvtar
+ m.phone_number m_phone_number, m.avatar m_acvatar
from interview i
left join interview_comment c on c.interview_id = i.id and c.is_deleted = 0 and i.is_deleted = 0
left join user m on m.id = c.manager_id and m.is_deleted = 0 and c.is_deleted = 0
From 82b9cc4bf56c80dfc2f12685865cca51d22c2841 Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Wed, 16 Oct 2024 16:04:12 +0800
Subject: [PATCH 079/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../resources/mapper/evaluate/ext/InterviewCommentExtMapper.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/resources/mapper/evaluate/ext/InterviewCommentExtMapper.xml b/src/main/resources/mapper/evaluate/ext/InterviewCommentExtMapper.xml
index 6eab9f40..696c6ce9 100644
--- a/src/main/resources/mapper/evaluate/ext/InterviewCommentExtMapper.xml
+++ b/src/main/resources/mapper/evaluate/ext/InterviewCommentExtMapper.xml
@@ -25,7 +25,7 @@
select
c.id, c.content, c.create_time, c.update_time,
m.id m_id, m.username m_username, m.nickname m_nickname,m.email m_email,
- m.phone_number m_phone_number, m.avatar m_acvatar
+ m.phone_number m_phone_number, m.avatar m_avatar
from interview i
left join interview_comment c on c.interview_id = i.id and c.is_deleted = 0 and i.is_deleted = 0
left join user m on m.id = c.manager_id and m.is_deleted = 0 and c.is_deleted = 0
From 78c0b9d666f8849a2ce13cf84191b43299d29d51 Mon Sep 17 00:00:00 2001
From: BanTanger <1290288968@qq.com>
Date: Wed, 16 Oct 2024 16:05:25 +0800
Subject: [PATCH 080/104] =?UTF-8?q?feat:=20docker=20=E5=9F=BA=E5=BB=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Dockerfile | 14 +
build.sh | 22 +-
docker-compose.yml | 179 ++++++++-
docker/mysql/Dockerfile | 9 +
docker/mysql/conf/my.conf | 57 +++
docker/mysql/db/recruitment-core.sql | 559 +++++++++++++++++++++++++++
docker/rabbitmq/enabled_plugins | 1 +
docker/redis/Dockerfile | 14 +
docker/redis/conf/redis.conf | 5 +
dockerfile | 22 +-
10 files changed, 860 insertions(+), 22 deletions(-)
create mode 100644 Dockerfile
create mode 100644 docker/mysql/Dockerfile
create mode 100644 docker/mysql/conf/my.conf
create mode 100644 docker/mysql/db/recruitment-core.sql
create mode 100644 docker/rabbitmq/enabled_plugins
create mode 100644 docker/redis/Dockerfile
create mode 100644 docker/redis/conf/redis.conf
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 00000000..de055307
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,14 @@
+# 基础镜像
+FROM openjdk:21
+
+# 配置
+ENV PARAMS=""
+
+# 时区
+ENV TZ=PRC
+RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
+
+# 添加应用
+ADD ../target/AchoBeta-Recruitment-1.0.jar /AchoBeta-Recruitment-1.0.jar
+
+ENTRYPOINT ["sh","-c","java -jar $JAVA_OPTS /AchoBeta-Recruitment-1.0.jar $PARAMS"]
diff --git a/build.sh b/build.sh
index e273e82d..ff583106 100644
--- a/build.sh
+++ b/build.sh
@@ -1,5 +1,17 @@
-#!/bin/zsh
-# shellcheck disable=SC2164
-mvn clean install package -Dmaven.test.skip=true
-docker-compose pull
-docker-compose up -d --build
\ No newline at end of file
+#!/usr/bin/env bash
+# Be sure your script exits whenever encounter errors
+
+echo "--------------------------------"
+echo "::: Welcome to AB-Recruitment :::"
+
+set -e
+# Be sure your charset is correct. eg: zh_CN.UTF-8
+export LC_ALL=en_US.UTF-8
+export LANG=en_US.UTF-8
+export LANGUAGE=en_US.UTF-8
+
+#mvn clean install package -Dmaven.test.skip=true
+
+# 普通镜像构建,随系统版本构建 amd/arm
+
+docker-compose -f docker-compose.yml up -d
diff --git a/docker-compose.yml b/docker-compose.yml
index ff897245..3d1e1bcc 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -1,12 +1,175 @@
-version: '3'
+# 命令执行 docker-compose -f docker-compose.yml up -d
+version: '3.9'
services:
- recruitment:
- container_name: achobeta-recruitment #配置容器名
+ mysql:
+ image: mysql:5.7
+ container_name: mysql
+ command: --default-authentication-plugin=mysql_native_password
+ restart: always
+ environment:
+ TZ: Asia/Shanghai
+ MYSQL_ROOT_PASSWORD: bitter-macaron
+ networks:
+ - my-network
+ depends_on:
+ - mysql-job-dbdata
+ ports:
+ - "13306:3306"
+ volumes:
+ - ./mysql/sql:/docker-entrypoint-initdb.d
+ - ./mysql/conf/my.conf:/usr/local/etc/mysql/my.conf
+ healthcheck:
+ test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ]
+ interval: 5s
+ timeout: 10s
+ retries: 10
+ start_period: 15s
+
+ # 自动加载数据
+ mysql-job-dbdata:
+ image: alpine:3.18.2
+ container_name: mysql-job-dbdata
+ volumes:
+ - /var/lib/mysql
+
+ # phpmyadmin https://hub.docker.com/_/phpmyadmin
+ phpmyadmin:
+ image: phpmyadmin:5.2.1
+ container_name: phpmyadmin
+ hostname: phpmyadmin
+ ports:
+ - 8899:80
+ environment:
+ - PMA_HOST=mysql
+ - PMA_PORT=13306
+ - MYSQL_ROOT_PASSWORD=bitter-macaron
+ depends_on:
+ mysql:
+ condition: service_healthy
+ networks:
+ - my-network
+
+ # Redis
+ redis:
+ image: redis:6.2
+ container_name: redis
+ restart: always
+ hostname: redis
+ privileged: true
+ ports:
+ - "6379:6379"
+ volumes:
+ - ./redis/conf/redis.conf:/usr/local/etc/redis/redis.conf
+ command: redis-server /usr/local/etc/redis/redis.conf
+ networks:
+ - my-network
+ healthcheck:
+ test: [ "CMD", "redis-cli", "ping" ]
+ interval: 10s
+ timeout: 5s
+ retries: 3
+
+ # RedisAdmin https://github.com/joeferner/redis-commander
+ # 账密 admin/admin
+ redis-admin:
+ image: spryker/redis-commander:0.8.0
+ container_name: redis-admin
+ hostname: redis-commander
+ restart: always
+ ports:
+ - "8081:8081"
+ environment:
+ - REDIS_HOSTS=local:redis:6379
+ - HTTP_USER=admin
+ - HTTP_PASSWORD=bitter-macaron
+ - LANG=C.UTF-8
+ - LANGUAGE=C.UTF-8
+ - LC_ALL=C.UTF-8
+ networks:
+ - my-network
+ depends_on:
+ redis:
+ condition: service_healthy
+
+ # rabbitmq
+ # 账密 admin/admin
+ # rabbitmq-plugins enable rabbitmq_management
+ rabbitmq:
+ image: rabbitmq:3.12.9
+ container_name: rabbitmq
+ restart: always
+ ports:
+ - "5672:5672"
+ - "15672:15672"
+ environment:
+ RABBITMQ_DEFAULT_USER: itcast
+ RABBITMQ_DEFAULT_PASS: 123321
+ command: rabbitmq-server
+ volumes:
+ - ./rabbitmq/enabled_plugins:/etc/rabbitmq/enabled_plugins
+ networks:
+ - my-network
+
+ # minio
+ # minio 的 docker 有问题,一直没法连接,只好先用旧服务器了
+ minio:
+ image: minio/minio:RELEASE.2021-06-17T00-10-46Z
+ container_name: minio
+ hostname: minio
+ privileged: true
+ restart: always
+ environment:
+ # 账号
+ MINIO_ROOT_USER: mms
+ # 密码
+ MINIO_ROOT_PASSWORD: bitter-macaron
+ ports:
+ - "9005:9005"
+ - "19005:19005"
+ volumes:
+ - ./minio/data:/data
+ command: server /data
+ networks:
+ - my-network
+
+ ab-recruitment-app:
+ container_name: ab-recruitment-app
build:
- context: .
- dockerfile: ./dockerfile #指定dockerFile文件
- image: java/achobeta-recruitment:1.0.0 # 指定镜像名
+ context: ../
+ dockerfile: Dockerfile
+ restart: always
ports:
- - "9001:9001" # 暴露端口
+ - "9001:9001"
+ environment:
+ - TZ=PRC
+ - SERVER_PORT=9001
+ - APP_CONFIG_API_VERSION=v1
+ - APP_CONFIG_CROSS_ORIGIN=*
+ - SPRING_DATASOURCE_USERNAME=mms
+ - SPRING_DATASOURCE_PASSWORD=bitter-macaron
+ - SPRING_DATASOURCE_URL=jdbc:mysql://mysql:13306/achobeta_recruitment?serverTimezone=UTC&characterEncoding=utf8&autoReconnect=true&serverTimezone=Asia/Shanghai
+ - SPRING_DATASOURCE_DRIVER_CLASS_NAME=com.mysql.jdbc.Driver
+ - SPRING_HIKARI_POOL_NAME=Retail_HikariCP
+ - REDIS_SDK_CONFIG_HOST=redis
+ - REDIS_SDK_CONFIG_PORT=6379
volumes:
- - ./logs:/logs # 创建容器数据卷
\ No newline at end of file
+ - ./log:/data/log
+ depends_on:
+ - redis
+ - rabbitmq
+ - mysql
+ links:
+ - redis
+ - rabbitmq
+ - mysql
+ networks:
+ - my-network
+ logging:
+ driver: "json-file"
+ options:
+ max-size: "10m"
+ max-file: "3"
+
+networks:
+ my-network:
+ driver: bridge
\ No newline at end of file
diff --git a/docker/mysql/Dockerfile b/docker/mysql/Dockerfile
new file mode 100644
index 00000000..37d7b973
--- /dev/null
+++ b/docker/mysql/Dockerfile
@@ -0,0 +1,9 @@
+# 基础镜像
+FROM mysql:5.7
+
+# author
+MAINTAINER BanTanger
+
+# 执行sql脚本
+# `/docker-entrypoint-initdb.d/`是MySQL官方镜像中的一个特殊目录,用于存放初始化数据库的脚本文件。
+ADD ./db/*.sql /docker-entrypoint-initdb.d/
diff --git a/docker/mysql/conf/my.conf b/docker/mysql/conf/my.conf
new file mode 100644
index 00000000..e6ad824e
--- /dev/null
+++ b/docker/mysql/conf/my.conf
@@ -0,0 +1,57 @@
+[mysqld]
+# 设置13306端口
+port=13306
+
+# 设置mysql的安装目录
+basedir=/usr/local/mysql
+
+# 设置mysql数据库的数据的存放目录
+datadir=/usr/local/mysql/mysqldb
+
+# 允许最大连接数
+max_connections=1000
+
+# 允许连接失败的次数。这是为了防止有人从该主机试图攻击数据库系统
+max_connect_errors=100
+
+init_connect='SET collation_connection = utf8_unicode_ci'
+init_connect='SET NAMES utf8'
+
+# 服务端使用的字符集默认为UTF8
+character-set-server=utf8
+
+collation-server=utf8_unicode_ci
+skip-character-set-client-handshake
+
+# 创建新表时将使用的默认存储引擎
+default-storage-engine=INNODB
+
+# 默认使用“mysql_native_password”插件认证
+default_authentication_plugin=mysql_native_password
+
+#是否对sql语句大小写敏感,1表示不敏感
+lower_case_table_names = 1
+
+#MySQL连接闲置超过一定时间后(单位:秒)将会被强行关闭
+#MySQL默认的wait_timeout 值为8个小时, interactive_timeout参数需要同时配置才能生效
+interactive_timeout = 1800
+wait_timeout = 1800
+
+#Metadata Lock最大时长(秒), 一般用于控制 alter操作的最大时长sine mysql5.6
+#执行 DML操作时除了增加innodb事务锁外还增加Metadata Lock,其他alter(DDL)session将阻塞
+lock_wait_timeout = 3600
+
+#内部内存临时表的最大值。
+#比如大数据量的group by ,order by时可能用到临时表,
+#超过了这个值将写入磁盘,系统IO压力增大
+tmp_table_size = 64M
+max_heap_table_size = 64M
+
+[mysql]
+# 设置mysql客户端默认字符集
+default-character-set=utf8
+
+[client]
+# 设置mysql客户端连接服务端时默认使用的端口
+port=13306
+default-character-set=utf8
diff --git a/docker/mysql/db/recruitment-core.sql b/docker/mysql/db/recruitment-core.sql
new file mode 100644
index 00000000..71f99c13
--- /dev/null
+++ b/docker/mysql/db/recruitment-core.sql
@@ -0,0 +1,559 @@
+
+drop database if exists achobeta_recruitment;
+create database achobeta_recruitment character set utf8mb4 collate utf8mb4_bin;
+use achobeta_recruitment;
+
+drop table if exists `user`;
+create table `user`
+(
+ `id` bigint primary key auto_increment comment '用户唯一 id',
+ `username` varchar(50) not null default '' comment '用户名',
+ `nickname` varchar(50) not null default '' comment '用户昵称',
+ `email` varchar(50) not null default '' comment '邮箱',
+ `phone_number` varchar(11) not null default '' comment '手机号码',
+ `password` varchar(100) not null default '' comment '密码',
+ `user_type` int not null default 1 comment '用户类型:1.普通用户 2. 管理员',
+ `avatar` bigint comment '头像地址',
+ -- common column
+ `version` int not null default 0 comment '乐观锁',
+ `is_deleted` bit not null default b'0' comment '伪删除标记',
+ `create_time` datetime not null default current_timestamp comment '创建时间',
+ `update_time` datetime not null default current_timestamp on update current_timestamp comment '更新时间',
+ -- index
+ index `idx_email`(`email` asc) using btree,
+ index `idx_phone`(`phone_number` asc) using btree,
+ unique `uni_username`(`username` asc) using btree
+) auto_increment = 10000 comment = '用户基本信息表';
+
+-- root 管理员,username: root; password: AchoBeta666
+insert into user(`username`, `nickname`, `password`, `user_type`)
+ values('root', 'root', '$2a$10$YPKp0kzLjnNrW5CgKuDdiuF4tZO0KXacmhy2KT7N9Zey49Cmi/rfu', 2);
+
+drop table if exists `member`;
+create table `member`
+(
+ `id` bigint primary key auto_increment comment '正式成员 id',
+ `resume_id` bigint not null comment '简历 id',
+ `manager_id` bigint unique not null comment '新开的管理员账号 id',
+ `parent_id` bigint not null comment '父管理员 id',
+ -- common column
+ `version` int not null default 0 comment '乐观锁',
+ `is_deleted` bit not null default b'0' comment '伪删除标记',
+ `create_time` datetime not null default current_timestamp comment '创建时间',
+ `update_time` datetime not null default current_timestamp on update current_timestamp comment '更新时间',
+ -- index
+ index `idx_resume_id`(`resume_id` asc) using btree,
+ unique index `uni_manager_id`(`manager_id` asc) using btree,
+ index `idx_parent_id`(`parent_id` asc) using btree
+) comment '正式成员表';
+
+drop table if exists `user_feedback`;
+create table `user_feedback`
+(
+ `id` bigint primary key auto_increment comment '反馈 id' ,
+ `user_id` bigint not null comment '用户id',
+ `batch_id` bigint not null comment '招新批次 id',
+ `message_id` bigint default null comment '处理结果的消息 id',
+ `title` varchar(256) default '' not null comment '反馈标题',
+ `content` text not null comment '反馈内容',
+ `attachment` bigint default null comment '附件链接',
+ `feedback_time` datetime default CURRENT_TIMESTAMP not null comment '反馈时间',
+ `is_handle` bit default b'0' not null comment '是否处理标记',
+ -- common column
+ `version` int not null default 0 comment '乐观锁',
+ `is_deleted` bit not null default b'0' comment '伪删除标记',
+ `create_time` datetime not null default current_timestamp comment '创建时间',
+ `update_time` datetime not null default current_timestamp on update current_timestamp comment '更新时间',
+ -- index
+ index `idx_user_id`(`user_id` asc) using btree,
+ index `idx_batch_id`(`batch_id` asc) using btree,
+ index `idx_message_id`(`message_id` asc) using btree
+) comment = '用户反馈表';
+
+drop table if exists `interview`;
+create table `interview`
+(
+ `id` bigint primary key auto_increment comment '面试 id',
+ `schedule_id` bigint unsigned not null comment '面试预约 id',
+ `paper_id` bigint default null comment '面试试卷 id',
+ `title` varchar(100) not null default '' comment '面试主题',
+ `description` text not null comment '面试说明',
+ `status` tinyint not null default 0 comment '是否开始(0未开始、1进行中、2已结束)',
+ `address` varchar(500) not null default '' comment '线下面试地址/显示面试会议链接',
+ -- common column
+ `version` int not null default 0 comment '乐观锁',
+ `is_deleted` bit not null default b'0' comment '伪删除标记',
+ `create_time` datetime not null default current_timestamp comment '创建时间',
+ `update_time` datetime not null default current_timestamp on update current_timestamp comment '更新时间',
+ -- index
+ index `idx_schedule_id`(`schedule_id` asc) using btree,
+ index `idx_paper_id`(`paper_id` asc) using btree
+) comment '面试表';
+
+drop table if exists `interview_comment`;
+create table `interview_comment`
+(
+ `id` bigint primary key auto_increment comment '面评 id',
+ `interview_id` bigint not null comment '面试 id',
+ `manager_id` bigint not null comment '管理员 id',
+ `content` text not null comment '评论内容',
+ -- common column
+ `version` int not null default 0 comment '乐观锁',
+ `is_deleted` bit not null default b'0' comment '伪删除标记',
+ `create_time` datetime not null default current_timestamp comment '创建时间',
+ `update_time` datetime not null default current_timestamp on update current_timestamp comment '更新时间',
+ -- index
+ index `idx_interview_id`(`interview_id` asc) using btree,
+ index `idx_manager_id`(`manager_id` asc) using btree
+) comment '面试评论表';
+
+drop table if exists `interview_question_score`;
+create table `interview_question_score`
+(
+ `id` bigint primary key auto_increment comment '面试题评分 id',
+ `interview_id` bigint not null comment '面试 id',
+ `question_id` bigint not null comment '问题 id',
+ `score` int not null comment '评分(0-10,-1为超纲)',
+ -- common column
+ `version` int not null default 0 comment '乐观锁',
+ `is_deleted` bit not null default b'0' comment '伪删除标记',
+ `create_time` datetime not null default current_timestamp comment '创建时间',
+ `update_time` datetime not null default current_timestamp on update current_timestamp comment '更新时间',
+ -- index
+ index `idx_interview_id`(`interview_id` asc) using btree,
+ index `idx_question_id`(`question_id` asc) using btree
+) comment '面试题评分关联表';
+
+drop table if exists `interview_schedule`;
+create table `interview_schedule`
+(
+ `id` bigint primary key auto_increment comment '面试预约 id',
+ `participation_id` bigint not null comment '用户的“活动参与” id',
+ `start_time` datetime not null comment '预约开始时间',
+ `end_time` datetime not null comment '预约结束时间',
+ -- common column
+ `version` int not null default 0 comment '乐观锁',
+ `is_deleted` bit not null default b'0' comment '伪删除标记',
+ `create_time` datetime not null default current_timestamp comment '创建时间',
+ `update_time` datetime not null default current_timestamp on update current_timestamp comment '更新时间',
+ -- index
+ index `idx_participation_id`(`participation_id` asc) using btree
+) comment '面试预约表';
+
+drop table if exists `interview_summary`;
+create table `interview_summary`
+(
+ `id` bigint primary key auto_increment comment '面试总结 id',
+ `interview_id` bigint not null comment '面试 id',
+ `basis` tinyint not null default 0 comment '基础理论知识掌握(0-5)',
+ `coding` tinyint not null default 0 comment '代码能力(0-5)',
+ `thinking` tinyint not null default 0 comment '思维能力(0-5)',
+ `express` tinyint not null default 0 comment '表达能力(0-5)',
+ `evaluate` varchar(500) not null default '' comment '面试总评',
+ `suggest` varchar(500) not null default '' comment '复习建议',
+ `playback` varchar(256) not null default '' comment '面试回放链接',
+ -- common column
+ `version` int not null default 0 comment '乐观锁',
+ `is_deleted` bit not null default b'0' comment '伪删除标记',
+ `create_time` datetime not null default current_timestamp comment '创建时间',
+ `update_time` datetime not null default current_timestamp on update current_timestamp comment '更新时间',
+ -- index
+ index `idx_interview_id`(`interview_id` asc) using btree
+) comment '面试总结表';
+
+drop table if exists `interviewer`;
+create table `interviewer`
+(
+ `id` bigint primary key auto_increment comment '面试官 id',
+ `manager_id` bigint not null comment '管理员 id',
+ `schedule_id` bigint not null comment '面试预约 id',
+ -- common column
+ `version` int not null default 0 comment '乐观锁',
+ `is_deleted` bit not null default b'0' comment '伪删除标记',
+ `create_time` datetime not null default current_timestamp comment '创建时间',
+ `update_time` datetime not null default current_timestamp on update current_timestamp comment '更新时间',
+ -- index
+ index `idx_manager_id`(`manager_id` asc) using btree,
+ index `idx_schedule_id`(`schedule_id` asc) using btree
+) comment '面试官表';
+
+drop table if exists `message`;
+create table `message`
+(
+ `id` bigint primary key auto_increment comment '消息 id',
+ `manager_id` bigint not null comment '发送消息的管理员 id',
+ `user_id` bigint not null comment '用户 id',
+ `tittle` varchar(256) not null default '' comment '消息标题',
+ `content` text not null comment '消息内容',
+ `send_time` datetime not null default current_timestamp comment '发送时间',
+ `attachment` bigint null default null comment '附件 url',
+ -- common column
+ `version` int not null default 0 comment '乐观锁',
+ `is_deleted` bit not null default b'0' comment '伪删除标记',
+ `create_time` datetime not null default current_timestamp comment '创建时间',
+ `update_time` datetime not null default current_timestamp on update current_timestamp comment '更新时间',
+ -- index
+ index `idx_manager_id`(`manager_id` asc) using btree,
+ index `idx_user_id`(`user_id` asc) using btree
+) comment = '消息表';
+
+drop table if exists `message_template`;
+create table `message_template`
+(
+ `id` bigint primary key auto_increment comment '模板消息 id',
+ `template_title` varchar(100) not null default '' comment '模板消息标题',
+ `template_content` text not null comment '模板消息内容',
+ -- common column
+ `version` int not null default 0 comment '乐观锁',
+ `is_deleted` bit not null default b'0' comment '伪删除标记',
+ `create_time` datetime not null default current_timestamp comment '创建时间',
+ `update_time` datetime not null default current_timestamp on update current_timestamp comment '更新时间'
+) comment = '模板消息表';
+
+drop table if exists `library_paper_link`;
+create table `library_paper_link`
+(
+ `id` bigint primary key auto_increment comment 'id',
+ `lib_id` bigint not null comment '试卷库 id',
+ `paper_id` bigint not null comment '试卷 id',
+ -- common column
+ `version` int not null default 0 comment '乐观锁',
+ `is_deleted` bit not null default b'0' comment '伪删除标记',
+ `create_time` datetime not null default current_timestamp comment '创建时间',
+ `update_time` datetime not null default current_timestamp on update current_timestamp comment '更新时间',
+ -- index
+ index `idx_lp_id`(`lib_id` asc, `paper_id`) using btree
+) comment '试卷库-试卷关联表';
+
+drop table if exists `paper_question_link`;
+create table `paper_question_link`
+(
+ `id` bigint primary key auto_increment comment 'id',
+ `paper_id` bigint not null comment '试卷 id',
+ `question_id` bigint not null comment '问题 id',
+ -- common column
+ `version` int not null default 0 comment '乐观锁',
+ `is_deleted` bit not null default b'0' comment '伪删除标记',
+ `create_time` datetime not null default current_timestamp comment '创建时间',
+ `update_time` datetime not null default current_timestamp on update current_timestamp comment '更新时间',
+ -- index
+ index idx_pq_id(`paper_id` asc, `question_id`) using btree
+) comment '试卷-问题关联表';
+
+drop table if exists `question_paper`;
+create table `question_paper`
+(
+ `id` bigint primary key auto_increment comment '试卷 id',
+ `title` varchar(100) not null default '' comment '试卷标题',
+ `description` text not null comment '试卷说明',
+ -- common column
+ `version` int not null default 0 comment '乐观锁',
+ `is_deleted` bit not null default b'0' comment '伪删除标记',
+ `create_time` datetime not null default current_timestamp comment '创建时间',
+ `update_time` datetime not null default current_timestamp on update current_timestamp comment '更新时间'
+) comment '试卷表';
+
+drop table if exists `question_paper_library`;
+create table `question_paper_library`
+(
+ `id` bigint primary key auto_increment comment '试卷库 id',
+ `lib_type` varchar(100) not null default '' comment '试卷库的类别,例如技术类的后端试卷,前端试卷;非技术的信息收集试卷;筛选的笔试试卷...',
+ -- common column
+ `version` int not null default 0 comment '乐观锁',
+ `is_deleted` bit not null default b'0' comment '伪删除标记',
+ `create_time` datetime not null default current_timestamp comment '创建时间',
+ `update_time` datetime not null default current_timestamp on update current_timestamp comment '更新时间',
+ -- index
+ index `idx_lib_type`(`lib_type` asc) using btree
+) comment '试卷库表';
+
+drop table if exists `library_question_link`;
+create table `library_question_link`
+(
+ `id` bigint primary key auto_increment comment 'id',
+ `lib_id` bigint not null comment '题库 id',
+ `question_id` bigint not null comment '问题 id',
+ -- common column
+ `version` int not null default 0 comment '乐观锁',
+ `is_deleted` bit not null default b'0' comment '伪删除标记',
+ `create_time` datetime not null default current_timestamp comment '创建时间',
+ `update_time` datetime not null default current_timestamp on update current_timestamp comment '更新时间',
+ -- index
+ index `idx_lq_id`(`lib_id` asc, `question_id`) using btree
+) comment '题库-问题关联表';
+
+drop table if exists `question`;
+create table `question`
+(
+ `id` bigint primary key auto_increment comment '问题 id',
+ `title` varchar(2048) not null default '' comment '问题标题',
+ `standard` text not null comment '问题标答',
+ -- common column
+ `version` int not null default 0 comment '乐观锁',
+ `is_deleted` bit not null default b'0' comment '伪删除标记',
+ `create_time` datetime not null default current_timestamp comment '创建时间',
+ `update_time` datetime not null default current_timestamp on update current_timestamp comment '更新时间'
+) comment '问题表';
+
+drop table if exists `question_library`;
+create table `question_library`
+(
+ `id` bigint primary key auto_increment comment '题库 id',
+ `lib_type` varchar(100) not null default '' comment '题库的类别',
+ -- common column
+ `version` int not null default 0 comment '乐观锁',
+ `is_deleted` bit not null default b'0' comment '伪删除标记',
+ `create_time` datetime not null default current_timestamp comment '创建时间',
+ `update_time` datetime not null default current_timestamp on update current_timestamp comment '更新时间',
+ -- index
+ index `idx_lib_type`(`lib_type` asc) using btree
+) comment '题库表';
+
+drop table if exists `activity_participation`;
+create table `activity_participation`
+(
+ `id` bigint primary key auto_increment comment '“活动参与” id',
+ `stu_id` bigint not null comment '学生 id',
+ `act_id` bigint not null comment '活动 id',
+ -- common column
+ `version` int not null default 0 comment '乐观锁',
+ `is_deleted` bit not null default b'0' comment '伪删除标记',
+ `create_time` datetime not null default current_timestamp comment '创建时间',
+ `update_time` datetime not null default current_timestamp on update current_timestamp comment '更新时间',
+ -- index
+ index `idx_stu_id`(`stu_id` asc) using btree,
+ index `idx_act_id`(`act_id` asc) using btree
+) comment '“活动参与”表';
+
+drop table if exists `participation_period_link`;
+create table `participation_period_link`
+(
+ `id` bigint primary key auto_increment comment 'id',
+ `participation_id` bigint not null comment '“活动参与” id',
+ `period_id` bigint not null comment '时间段 id',
+ -- common column
+ `version` int not null default 0 comment '乐观锁',
+ `is_deleted` bit not null default b'0' comment '伪删除标记',
+ `create_time` datetime not null default current_timestamp comment '创建时间',
+ `update_time` datetime not null default current_timestamp on update current_timestamp comment '更新时间',
+ -- index
+ index `idx_pp_id`(`participation_id` asc, `period_id` asc) using btree
+) comment '“活动参与”-时间段关联表';
+
+drop table if exists `participation_question_link`;
+create table `participation_question_link`
+(
+ `id` bigint primary key auto_increment comment 'id',
+ `participation_id` bigint not null comment '“活动参与” id',
+ `question_id` bigint not null comment '问题 id',
+ `answer` text not null comment '回答',
+ -- common column
+ `version` int not null default 0 comment '乐观锁',
+ `is_deleted` bit not null default b'0' comment '伪删除标记',
+ `create_time` datetime not null default current_timestamp comment '创建时间',
+ `update_time` datetime not null default current_timestamp on update current_timestamp comment '更新时间',
+ -- index
+ index `idx_pq_id`(`participation_id` asc, `question_id` asc) using btree
+) comment '“活动参与”-问题关联表';
+
+drop table if exists `recruitment_activity`;
+create table `recruitment_activity`
+(
+ `id` bigint primary key auto_increment comment '招新活动 id',
+ `batch_id` bigint not null comment '招新批次 id',
+ `paper_id` bigint default null comment '试卷 id',
+ `title` varchar(100) not null default '' comment '活动标题',
+ `target` json not null comment '面向的人群',
+ `description` text not null comment '活动说明',
+ `deadline` datetime not null comment '截止时间',
+ `is_run` bit not null default b'0' comment '是否启动',
+ -- common column
+ `version` int not null default 0 comment '乐观锁',
+ `is_deleted` bit not null default b'0' comment '伪删除标记',
+ `create_time` datetime not null default current_timestamp comment '创建时间',
+ `update_time` datetime not null default current_timestamp on update current_timestamp comment '更新时间',
+ -- index
+ index `idx_batch_id`(`batch_id` asc) using btree,
+ index `idx_paper_id`(`paper_id` asc) using btree
+) comment '招新活动表';
+
+drop table if exists `recruitment_batch`;
+create table `recruitment_batch`
+(
+ `id` bigint primary key auto_increment comment '招新批次 id',
+ `batch` int not null comment 'AchoBeta 届数',
+ `title` varchar(100) not null default '' comment '招新标题',
+ `deadline` datetime not null comment '截止时间',
+ `is_run` bit not null default b'0' comment '是否启动',
+ -- common column
+ `version` int not null default 0 comment '乐观锁',
+ `is_deleted` bit not null default b'0' comment '伪删除标记',
+ `create_time` datetime not null default current_timestamp comment '创建时间',
+ `update_time` datetime not null default current_timestamp on update current_timestamp comment '更新时间',
+ -- index
+ index `idx_batch`(`batch` asc) using btree
+) comment '招新批次表';
+
+drop table if exists `time_period`;
+create table `time_period`
+(
+ `id` bigint primary key auto_increment comment '时间段 id',
+ `act_id` bigint not null comment '招新活动 id',
+ `start_time` datetime not null comment '开始时间',
+ `end_time` datetime not null comment '结束时间',
+ -- common column
+ `version` int not null default 0 comment '乐观锁',
+ `is_deleted` bit not null default b'0' comment '伪删除标记',
+ `create_time` datetime not null default current_timestamp comment '创建时间',
+ `update_time` datetime not null default current_timestamp on update current_timestamp comment '更新时间',
+ -- index
+ index `idx_act_id`(`act_id` asc) using btree
+) comment '时间段表';
+
+drop table if exists `digital_resource`;
+create table `digital_resource`
+(
+ `id` bigint primary key auto_increment comment '资源 id',
+ `code` bigint unique not null comment '资源码',
+ `user_id` bigint not null comment '上传文件的用户 id',
+ `access_level` int not null default 2 comment '访问权限',
+ `original_name` varchar(100) not null comment '上传时的文件名',
+ `file_name` varchar(256) not null comment '在对象存储服务中存储的对象名',
+ -- common column
+ `version` int not null default 0 comment '乐观锁',
+ `is_deleted` bit not null default b'0' comment '伪删除标记',
+ `create_time` datetime not null default current_timestamp comment '创建时间',
+ `update_time` datetime not null default current_timestamp on update current_timestamp comment '更新时间',
+ -- index
+ unique index `uni_code`(`code` asc) using btree,
+ index `idx_user_id`(`user_id` asc) using btree
+) comment '资源表';
+
+drop table if exists `feishu_resource`;
+create table `feishu_resource`
+(
+ `id` bigint primary key auto_increment comment '飞书资源 id',
+ `ticket` varchar(50) unique not null comment '任务 ID',
+ `original_name` varchar(100) not null comment '上传时的文件名',
+ `token` varchar(50) not null default '' comment '导入云文档的 token',
+ `type` varchar(20) not null default '' comment '导入的在线云文档类型',
+ `url` varchar(200) not null default '' comment '导入云文档的 URL',
+ -- common column
+ `version` int not null default 0 comment '乐观锁',
+ `is_deleted` bit not null default b'0' comment '伪删除标记',
+ `create_time` datetime not null default current_timestamp comment '创建时间',
+ `update_time` datetime not null default current_timestamp on update current_timestamp comment '更新时间',
+ -- index
+ unique index `uni_ticket`(`ticket`) using btree
+) comment '飞书资源表';
+
+drop table if exists `short_link`;
+create table `short_link`
+(
+ `id` bigint primary key auto_increment comment '短链接编号',
+ `origin_url` varchar(512) default '' comment '原链接',
+ `short_code` char(6) unique default '' comment '短链code',
+ `is_used` bit default b'0' comment '是否使用过',
+ -- common column
+ `version` int not null default 0 comment '乐观锁',
+ `is_deleted` bit not null default b'0' comment '伪删除标记',
+ `create_time` datetime not null default current_timestamp comment '创建时间',
+ `update_time` datetime not null default current_timestamp on update current_timestamp comment '更新时间',
+ -- 索引
+ index `idx_short_code`(`short_code` asc) using btree
+) comment '长短链关系表';
+
+drop table if exists `resume_status_process`;
+create table `resume_status_process`
+(
+ `id` bigint primary key auto_increment comment 'id',
+ `resume_id` bigint not null comment '简历 id',
+ `resume_status` int not null comment '简历状态',
+ `resume_event` int not null comment '简历事件',
+ -- common column
+ `version` int not null default 0 comment '乐观锁',
+ `is_deleted` bit not null default b'0' comment '伪删除标记',
+ `create_time` datetime not null default current_timestamp comment '创建时间',
+ `update_time` datetime not null default current_timestamp on update current_timestamp comment '更新时间',
+ -- 索引
+ index `idx_resume_id`(`resume_id` asc) using btree
+) comment '招新简历状态过程表';
+
+drop table if exists `stu_attachment`;
+create table `stu_attachment`
+(
+ `id` bigint primary key auto_increment comment 'id',
+ `resume_id` bigint not null comment '学生表主键 id',
+ `filename` varchar(256) not null default '' comment '附件名',
+ `attachment` bigint not null comment '附件资源码',
+ -- common column
+ `version` int not null default 0 comment '乐观锁',
+ `is_deleted` bit not null default b'0' comment '伪删除标记',
+ `create_time` datetime not null default current_timestamp comment '创建时间',
+ `update_time` datetime not null default current_timestamp on update current_timestamp comment '更新时间',
+ -- index
+ index `idx_resume_id`(`resume_id` asc) using btree
+) comment = '学生附件表';
+
+-- 简历状态 comment 说明
+-- 范围:0~16,简历状态{
+-- 0-草稿
+-- 1-待筛选
+-- 2-筛选不通过
+--
+-- 3-待安排初试
+-- 4-待初试
+-- 5-初试通过(仅当初试为最后一个流程时显示)
+-- 6-初试不通过(仅当初试为最后一个流程时显示)
+--
+-- 7-待安排复试
+-- 8-待复试
+-- 9-复试通过(仅当复试为最后一个流程时显示)
+-- 10-复试不通过(仅当复试为最后一个流程时显示)
+--
+-- 11-待安排终试
+-- 12-待终试
+-- 13-终试通过(仅当复试为最后一个流程时显示)
+-- 14-终试不通过(仅当复试为最后一个流程时显示)
+--
+-- 15-待处理(反馈异常/或管理员主动设置为该状态)
+-- 16-挂起(管理员可以主动设置该状态)
+-- }
+-- ----------------------------
+-- 创建学生简历表
+drop table if exists `stu_resume`;
+create table `stu_resume`
+(
+ `id` bigint primary key auto_increment comment 'id',
+ `user_id` bigint not null comment '用户 id',
+ `batch_id` bigint not null comment '招新批次 id',
+ `student_id` varchar(13) not null default '' comment '学号',
+ `name` varchar(10) not null default '' comment '姓名',
+ `gender` tinyint not null default 0 comment '性别',
+ `grade` int not null comment '年级',
+ `major` varchar(20) not null default '' comment '专业',
+ `class` varchar(30) not null default '' comment '班级',
+ `email` varchar(50) not null default '' comment '邮箱',
+ `phone_number` varchar(11) not null default '' comment '手机号码',
+ `reason` text not null comment '加入 achobeta 的理由',
+ `introduce` text not null comment '个人介绍(自我认知)',
+ `experience` text not null comment '个人经历(项目经历、职业规划等)',
+ `awards` text not null comment '获奖经历',
+ `image` bigint not null comment '照片',
+ `remark` varchar(500) not null default '' comment '备注',
+ `status` int not null default 1 comment '简历状态,范围:0~16',
+ `submit_count` int not null default 0 comment '提交次数',
+ -- common column
+ `version` int not null default 0 comment '乐观锁',
+ `is_deleted` bit not null default b'0' comment '伪删除标记',
+ `create_time` datetime not null default current_timestamp comment '创建时间',
+ `update_time` datetime not null default current_timestamp on update current_timestamp comment '更新时间',
+ -- index
+ index `idx_student_id` (`student_id` asc) using btree,
+ index `idx_email` (`email` asc) using btree,
+ index `idx_user_id` (`user_id` asc) using btree,
+ index `idx_batch_id` (`batch_id` asc) using btree,
+ index `idx_class` (`class` asc) using btree,
+ index `idx_major` (`major` asc) using btree,
+ index `idx_name` (`name` asc) using btree
+) comment = '学生简历表';
diff --git a/docker/rabbitmq/enabled_plugins b/docker/rabbitmq/enabled_plugins
new file mode 100644
index 00000000..90fdaa37
--- /dev/null
+++ b/docker/rabbitmq/enabled_plugins
@@ -0,0 +1 @@
+[rabbitmq_management].
\ No newline at end of file
diff --git a/docker/redis/Dockerfile b/docker/redis/Dockerfile
new file mode 100644
index 00000000..845d6315
--- /dev/null
+++ b/docker/redis/Dockerfile
@@ -0,0 +1,14 @@
+# 基础镜像
+FROM redis:6.0.8
+# author
+MAINTAINER BanTanger
+
+EXPOSE 6379
+# 挂载目录
+VOLUME /home/order/redis
+# 创建目录
+RUN mkdir -p /home/order/redis
+# 指定路径
+WORKDIR /home/order/redis
+# 复制conf文件到路径
+COPY ./conf/redis.conf /home/order/redis/redis.conf
diff --git a/docker/redis/conf/redis.conf b/docker/redis/conf/redis.conf
new file mode 100644
index 00000000..8fe64b4e
--- /dev/null
+++ b/docker/redis/conf/redis.conf
@@ -0,0 +1,5 @@
+bind 0.0.0.0
+requirepass bitter-macaron
+protected-mode no
+appendonly yes
+daemonize no
diff --git a/dockerfile b/dockerfile
index 433514a0..d8264b39 100644
--- a/dockerfile
+++ b/dockerfile
@@ -1,10 +1,14 @@
-# 以jdk8为基础镜像
+# 基础镜像
FROM openjdk:21
-# 描述
-LABEL description="AchoBeta Recruitment"
-# 暴露接口
-EXPOSE 9001
-# 将主机中的jar包添加到镜像中
-ADD target/AchoBeta-Recruitment-1.0.jar AchoBeta-Recruitment-1.0.jar
-# 运行jar包
-ENTRYPOINT ["java", "-jar","AchoBeta-Recruitment-1.0.jar"]
\ No newline at end of file
+
+# 配置
+ENV PARAMS=""
+
+# 时区
+ENV TZ=PRC
+RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
+
+# 添加应用
+ADD target/AchoBeta-Recruitment-1.0.jar /AchoBeta-Recruitment-1.0.jar
+
+ENTRYPOINT ["sh","-c","java -jar $JAVA_OPTS /AchoBeta-Recruitment-1.0.jar $PARAMS"]
From 9d0825eb50b6447a2e415f96d6537a6b5dddcccd Mon Sep 17 00:00:00 2001
From: BanTanger <1290288968@qq.com>
Date: Wed, 16 Oct 2024 16:05:48 +0800
Subject: [PATCH 081/104] =?UTF-8?q?feat:=20docker=20=E5=9F=BA=E5=BB=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Dockerfile | 2 +-
dockerfile | 14 --------------
2 files changed, 1 insertion(+), 15 deletions(-)
delete mode 100644 dockerfile
diff --git a/Dockerfile b/Dockerfile
index de055307..d8264b39 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -9,6 +9,6 @@ ENV TZ=PRC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# 添加应用
-ADD ../target/AchoBeta-Recruitment-1.0.jar /AchoBeta-Recruitment-1.0.jar
+ADD target/AchoBeta-Recruitment-1.0.jar /AchoBeta-Recruitment-1.0.jar
ENTRYPOINT ["sh","-c","java -jar $JAVA_OPTS /AchoBeta-Recruitment-1.0.jar $PARAMS"]
diff --git a/dockerfile b/dockerfile
deleted file mode 100644
index d8264b39..00000000
--- a/dockerfile
+++ /dev/null
@@ -1,14 +0,0 @@
-# 基础镜像
-FROM openjdk:21
-
-# 配置
-ENV PARAMS=""
-
-# 时区
-ENV TZ=PRC
-RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
-
-# 添加应用
-ADD target/AchoBeta-Recruitment-1.0.jar /AchoBeta-Recruitment-1.0.jar
-
-ENTRYPOINT ["sh","-c","java -jar $JAVA_OPTS /AchoBeta-Recruitment-1.0.jar $PARAMS"]
From 7756f860321c677413e356b09cead5774d8388cd Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Wed, 16 Oct 2024 21:17:08 +0800
Subject: [PATCH 082/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../controller/PaperLibraryController.java | 11 ++++++++
.../model/dao/mapper/QuestionPaperMapper.java | 2 ++
.../model/dto/LibraryReferencePaperDTO.java | 25 +++++++++++++++++++
.../paper/model/dto/PaperLibraryDTO.java | 2 +-
.../paper/model/dto/PaperQuestionLinkDTO.java | 3 ++-
.../paper/model/dto/QuestionPaperDTO.java | 5 ++--
.../paper/service/QuestionPaperService.java | 2 ++
.../impl/QuestionPaperServiceImpl.java | 16 ++++++++++++
.../controller/QuestionLibraryController.java | 11 ++++++++
.../model/dao/mapper/QuestionMapper.java | 2 ++
.../dto/LibraryReferenceQuestionDTO.java | 25 +++++++++++++++++++
.../model/dto/QuestionLibraryDTO.java | 2 +-
.../question/service/QuestionService.java | 2 ++
.../service/impl/QuestionServiceImpl.java | 16 ++++++++++++
.../paper/ext/QuestionPaperExtMapper.xml | 19 ++++++++++++++
.../mapper/question/ext/QuestionExtMapper.xml | 19 ++++++++++++++
16 files changed, 156 insertions(+), 6 deletions(-)
create mode 100644 src/main/java/com/achobeta/domain/paper/model/dto/LibraryReferencePaperDTO.java
create mode 100644 src/main/java/com/achobeta/domain/question/model/dto/LibraryReferenceQuestionDTO.java
diff --git a/src/main/java/com/achobeta/domain/paper/controller/PaperLibraryController.java b/src/main/java/com/achobeta/domain/paper/controller/PaperLibraryController.java
index 6442b9e8..20ec0aad 100644
--- a/src/main/java/com/achobeta/domain/paper/controller/PaperLibraryController.java
+++ b/src/main/java/com/achobeta/domain/paper/controller/PaperLibraryController.java
@@ -4,9 +4,11 @@
import com.achobeta.common.annotation.Intercept;
import com.achobeta.common.enums.UserTypeEnum;
import com.achobeta.domain.paper.model.converter.LibraryConverter;
+import com.achobeta.domain.paper.model.dto.LibraryReferencePaperDTO;
import com.achobeta.domain.paper.model.dto.PaperLibraryDTO;
import com.achobeta.domain.paper.model.entity.QuestionPaperLibrary;
import com.achobeta.domain.paper.service.QuestionPaperLibraryService;
+import com.achobeta.domain.paper.service.QuestionPaperService;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import lombok.RequiredArgsConstructor;
@@ -33,12 +35,21 @@ public class PaperLibraryController {
private final QuestionPaperLibraryService questionPaperLibraryService;
+ private final QuestionPaperService questionPaperService;
+
@PostMapping("/create")
public SystemJsonResponse createPaperLibrary(@RequestParam("libType") @NotBlank String libType) {
Long paperLibraryId = questionPaperLibraryService.createPaperLibrary(libType);
return SystemJsonResponse.SYSTEM_SUCCESS(paperLibraryId);
}
+ @PostMapping("/reference")
+ public SystemJsonResponse referencePapers(@Valid @RequestBody LibraryReferencePaperDTO libraryReferencePaperDTO) {
+ // 引用
+ questionPaperService.referencePapers(libraryReferencePaperDTO.getLibId(), libraryReferencePaperDTO.getPaperIds());
+ return SystemJsonResponse.SYSTEM_SUCCESS();
+ }
+
@PostMapping("/rename")
public SystemJsonResponse renamePaperLibrary(@Valid @RequestBody PaperLibraryDTO paperLibraryDTO) {
// 检查
diff --git a/src/main/java/com/achobeta/domain/paper/model/dao/mapper/QuestionPaperMapper.java b/src/main/java/com/achobeta/domain/paper/model/dao/mapper/QuestionPaperMapper.java
index d8270db0..2b0993f1 100644
--- a/src/main/java/com/achobeta/domain/paper/model/dao/mapper/QuestionPaperMapper.java
+++ b/src/main/java/com/achobeta/domain/paper/model/dao/mapper/QuestionPaperMapper.java
@@ -17,6 +17,8 @@ public interface QuestionPaperMapper extends BaseMapper {
// 并不会将结果集加入 page,而是返回值 IPage 里
IPage queryPapers(IPage page, @Param("libIds") List libIds);
+
+ List getPapers(@Param("libIds") List libIds);
}
diff --git a/src/main/java/com/achobeta/domain/paper/model/dto/LibraryReferencePaperDTO.java b/src/main/java/com/achobeta/domain/paper/model/dto/LibraryReferencePaperDTO.java
new file mode 100644
index 00000000..fc3fc0f9
--- /dev/null
+++ b/src/main/java/com/achobeta/domain/paper/model/dto/LibraryReferencePaperDTO.java
@@ -0,0 +1,25 @@
+package com.achobeta.domain.paper.model.dto;
+
+import jakarta.validation.constraints.NotEmpty;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * Created With Intellij IDEA
+ * Description:
+ * User: 马拉圈
+ * Date: 2024-10-16
+ * Time: 20:43
+ */
+@Data
+public class LibraryReferencePaperDTO {
+
+ @NotNull(message = "试卷库 id 不能为空")
+ private Long libId;
+
+ @NotEmpty(message = "试卷 id 列表不能为空")
+ private List paperIds;
+
+}
diff --git a/src/main/java/com/achobeta/domain/paper/model/dto/PaperLibraryDTO.java b/src/main/java/com/achobeta/domain/paper/model/dto/PaperLibraryDTO.java
index e6de6bc9..7d9dfbde 100644
--- a/src/main/java/com/achobeta/domain/paper/model/dto/PaperLibraryDTO.java
+++ b/src/main/java/com/achobeta/domain/paper/model/dto/PaperLibraryDTO.java
@@ -14,7 +14,7 @@
@Data
public class PaperLibraryDTO {
- @NotNull(message = "库的 id 不能为空")
+ @NotNull(message = "试卷库 id 不能为空")
private Long libId;
@NotBlank(message = "库的类型不能为空")
diff --git a/src/main/java/com/achobeta/domain/paper/model/dto/PaperQuestionLinkDTO.java b/src/main/java/com/achobeta/domain/paper/model/dto/PaperQuestionLinkDTO.java
index 34f39141..8a149324 100644
--- a/src/main/java/com/achobeta/domain/paper/model/dto/PaperQuestionLinkDTO.java
+++ b/src/main/java/com/achobeta/domain/paper/model/dto/PaperQuestionLinkDTO.java
@@ -1,5 +1,6 @@
package com.achobeta.domain.paper.model.dto;
+import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
@@ -18,7 +19,7 @@ public class PaperQuestionLinkDTO {
@NotNull(message = "试卷 id 不能为空")
private Long paperId;
- @NotNull(message = "问题 ids 不能为空")
+ @NotEmpty(message = "问题 ids 不能为空")
private List questionIds;
}
diff --git a/src/main/java/com/achobeta/domain/paper/model/dto/QuestionPaperDTO.java b/src/main/java/com/achobeta/domain/paper/model/dto/QuestionPaperDTO.java
index e15294e2..24361403 100644
--- a/src/main/java/com/achobeta/domain/paper/model/dto/QuestionPaperDTO.java
+++ b/src/main/java/com/achobeta/domain/paper/model/dto/QuestionPaperDTO.java
@@ -1,7 +1,7 @@
package com.achobeta.domain.paper.model.dto;
import jakarta.validation.constraints.NotBlank;
-import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.NotEmpty;
import lombok.Data;
import java.util.List;
@@ -16,7 +16,7 @@
@Data
public class QuestionPaperDTO {
- @NotNull(message = "试卷库 ids 不能为空")
+ @NotEmpty(message = "试卷库 ids 不能为空")
private List libIds;
@NotBlank(message = "题目不能为空")
@@ -25,5 +25,4 @@ public class QuestionPaperDTO {
@NotBlank(message = "试卷说明不能为空")
private String description;
-
}
diff --git a/src/main/java/com/achobeta/domain/paper/service/QuestionPaperService.java b/src/main/java/com/achobeta/domain/paper/service/QuestionPaperService.java
index 5565f0c9..2363f269 100644
--- a/src/main/java/com/achobeta/domain/paper/service/QuestionPaperService.java
+++ b/src/main/java/com/achobeta/domain/paper/service/QuestionPaperService.java
@@ -21,6 +21,8 @@ public interface QuestionPaperService extends IService {
Long addQuestionPaper(List libIds, String title, String description);
+ void referencePapers(Long libId, List paperIds);
+
void updateQuestionPaper(Long paperId, List libIds, String title, String description);
/**
diff --git a/src/main/java/com/achobeta/domain/paper/service/impl/QuestionPaperServiceImpl.java b/src/main/java/com/achobeta/domain/paper/service/impl/QuestionPaperServiceImpl.java
index eff1936b..51876914 100644
--- a/src/main/java/com/achobeta/domain/paper/service/impl/QuestionPaperServiceImpl.java
+++ b/src/main/java/com/achobeta/domain/paper/service/impl/QuestionPaperServiceImpl.java
@@ -19,6 +19,7 @@
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
+import java.util.stream.Collectors;
/**
* @author 马拉圈
@@ -77,6 +78,21 @@ public Long addQuestionPaper(List libIds, String title, String description
return paperId;
}
+ @Override
+ public void referencePapers(Long libId, List paperIds) {
+ Set hash = questionPaperMapper.getPapers(List.of(libId)).stream().map(QuestionPaper::getId).collect(Collectors.toSet());
+ List libraryPaperLinkList = paperIds.stream()
+ .distinct()
+ .filter(paperId -> Objects.nonNull(paperId) && !hash.contains(paperId))
+ .map(paperId -> {
+ LibraryPaperLink libraryPaperLink = new LibraryPaperLink();
+ libraryPaperLink.setPaperId(paperId);
+ libraryPaperLink.setLibId(libId);
+ return libraryPaperLink;
+ }).toList();
+ libraryPaperLinkService.saveBatch(libraryPaperLinkList);
+ }
+
@Override
@Transactional
public void updateQuestionPaper(Long paperId, List libIds, String title, String description) {
diff --git a/src/main/java/com/achobeta/domain/question/controller/QuestionLibraryController.java b/src/main/java/com/achobeta/domain/question/controller/QuestionLibraryController.java
index 75929d49..03bf1c28 100644
--- a/src/main/java/com/achobeta/domain/question/controller/QuestionLibraryController.java
+++ b/src/main/java/com/achobeta/domain/question/controller/QuestionLibraryController.java
@@ -4,9 +4,11 @@
import com.achobeta.common.annotation.Intercept;
import com.achobeta.common.enums.UserTypeEnum;
import com.achobeta.domain.paper.model.converter.LibraryConverter;
+import com.achobeta.domain.question.model.dto.LibraryReferenceQuestionDTO;
import com.achobeta.domain.question.model.dto.QuestionLibraryDTO;
import com.achobeta.domain.question.model.entity.QuestionLibrary;
import com.achobeta.domain.question.service.QuestionLibraryService;
+import com.achobeta.domain.question.service.QuestionService;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import lombok.RequiredArgsConstructor;
@@ -33,12 +35,21 @@ public class QuestionLibraryController {
private final QuestionLibraryService questionLibraryService;
+ private final QuestionService questionService;
+
@PostMapping("/create")
public SystemJsonResponse createQuestionLibrary(@RequestParam("libType") @NotBlank String libType) {
Long questionLibraryId = questionLibraryService.createQuestionLibrary(libType);
return SystemJsonResponse.SYSTEM_SUCCESS(questionLibraryId);
}
+ @PostMapping("/reference")
+ public SystemJsonResponse referenceQuestions(@Valid @RequestBody LibraryReferenceQuestionDTO libraryReferenceQuestionDTO) {
+ // 引用
+ questionService.referenceQuestions(libraryReferenceQuestionDTO.getLibId(), libraryReferenceQuestionDTO.getQuestionIds());
+ return SystemJsonResponse.SYSTEM_SUCCESS();
+ }
+
@PostMapping("/rename")
public SystemJsonResponse renameQuestionLibrary(@Valid @RequestBody QuestionLibraryDTO questionLibraryDTO) {
// 检查
diff --git a/src/main/java/com/achobeta/domain/question/model/dao/mapper/QuestionMapper.java b/src/main/java/com/achobeta/domain/question/model/dao/mapper/QuestionMapper.java
index abcb0c6a..eb41d0d2 100644
--- a/src/main/java/com/achobeta/domain/question/model/dao/mapper/QuestionMapper.java
+++ b/src/main/java/com/achobeta/domain/question/model/dao/mapper/QuestionMapper.java
@@ -18,6 +18,8 @@ public interface QuestionMapper extends BaseMapper {
// 并不会将结果集加入 page,而是返回值 IPage 里
IPage queryQuestions(IPage page, @Param("libIds") List libIds);
+ List getQuestions(@Param("libIds") List libIds);
+
}
diff --git a/src/main/java/com/achobeta/domain/question/model/dto/LibraryReferenceQuestionDTO.java b/src/main/java/com/achobeta/domain/question/model/dto/LibraryReferenceQuestionDTO.java
new file mode 100644
index 00000000..9de7a50b
--- /dev/null
+++ b/src/main/java/com/achobeta/domain/question/model/dto/LibraryReferenceQuestionDTO.java
@@ -0,0 +1,25 @@
+package com.achobeta.domain.question.model.dto;
+
+import jakarta.validation.constraints.NotEmpty;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * Created With Intellij IDEA
+ * Description:
+ * User: 马拉圈
+ * Date: 2024-10-16
+ * Time: 20:22
+ */
+@Data
+public class LibraryReferenceQuestionDTO {
+
+ @NotNull(message = "题库 id 不能为空")
+ private Long libId;
+
+ @NotEmpty(message = "问题 id 列表不能为空")
+ private List questionIds;
+
+}
diff --git a/src/main/java/com/achobeta/domain/question/model/dto/QuestionLibraryDTO.java b/src/main/java/com/achobeta/domain/question/model/dto/QuestionLibraryDTO.java
index 3064be85..41cea0b5 100644
--- a/src/main/java/com/achobeta/domain/question/model/dto/QuestionLibraryDTO.java
+++ b/src/main/java/com/achobeta/domain/question/model/dto/QuestionLibraryDTO.java
@@ -14,7 +14,7 @@
@Data
public class QuestionLibraryDTO {
- @NotNull(message = "库的 id 不能为空")
+ @NotNull(message = "题库 id 不能为空")
private Long libId;
@NotBlank(message = "库的类型不能为空")
diff --git a/src/main/java/com/achobeta/domain/question/service/QuestionService.java b/src/main/java/com/achobeta/domain/question/service/QuestionService.java
index 2bf8bce9..da9c9079 100644
--- a/src/main/java/com/achobeta/domain/question/service/QuestionService.java
+++ b/src/main/java/com/achobeta/domain/question/service/QuestionService.java
@@ -23,6 +23,8 @@ public interface QuestionService extends IService {
Long addQuestion(List libIds, String title, String standard);
+ void referenceQuestions(Long libId, List questionIds);
+
void saveBatchQuestion(QuestionSaveBatchDTO questionSaveBatchDTO);
void updateQuestion(Long questionId, List libIds, String title, String standard);
diff --git a/src/main/java/com/achobeta/domain/question/service/impl/QuestionServiceImpl.java b/src/main/java/com/achobeta/domain/question/service/impl/QuestionServiceImpl.java
index 6c4c475e..52c14c82 100644
--- a/src/main/java/com/achobeta/domain/question/service/impl/QuestionServiceImpl.java
+++ b/src/main/java/com/achobeta/domain/question/service/impl/QuestionServiceImpl.java
@@ -27,6 +27,7 @@
import org.springframework.util.CollectionUtils;
import java.util.*;
+import java.util.stream.Collectors;
/**
* @author 马拉圈
@@ -90,6 +91,21 @@ public Long addQuestion(List libIds, String title, String standard) {
return questionId;
}
+ @Override
+ public void referenceQuestions(Long libId, List questionIds) {
+ Set hash = questionMapper.getQuestions(List.of(libId)).stream().map(Question::getId).collect(Collectors.toSet());
+ List libraryQuestionLinkList = questionIds.stream()
+ .distinct()
+ .filter(questionId -> Objects.nonNull(questionId) && !hash.contains(questionId))
+ .map(questionId -> {
+ LibraryQuestionLink libraryQuestionLink = new LibraryQuestionLink();
+ libraryQuestionLink.setQuestionId(questionId);
+ libraryQuestionLink.setLibId(libId);
+ return libraryQuestionLink;
+ }).toList();
+ libraryQuestionLinkService.saveBatch(libraryQuestionLinkList);
+ }
+
@Override
@Transactional
public void saveBatchQuestion(QuestionSaveBatchDTO questionSaveBatchDTO) {
diff --git a/src/main/resources/mapper/paper/ext/QuestionPaperExtMapper.xml b/src/main/resources/mapper/paper/ext/QuestionPaperExtMapper.xml
index c6fd0986..6c027d12 100644
--- a/src/main/resources/mapper/paper/ext/QuestionPaperExtMapper.xml
+++ b/src/main/resources/mapper/paper/ext/QuestionPaperExtMapper.xml
@@ -31,4 +31,23 @@
order by lp_create_time asc
+
+ select
+ -- 试卷与试卷库多对多,在本条 sql 容易出现重复行
+ distinct p.id, p.title, p.description, p.create_time, p.update_time, lp.create_time lp_create_time
+ from question_paper_library l
+ left join library_paper_link lp on l.id = lp.lib_id and l.is_deleted = 0 and lp.is_deleted = 0
+ left join question_paper p on p.id = lp.paper_id and p.is_deleted = 0 and lp.is_deleted = 0
+
+ p.id is not null and l.is_deleted = 0
+
+
+ #{libId,jdbcType=BIGINT}
+
+
+
+ order by lp_create_time asc
+
+
diff --git a/src/main/resources/mapper/question/ext/QuestionExtMapper.xml b/src/main/resources/mapper/question/ext/QuestionExtMapper.xml
index 5ddf8826..927e36ec 100644
--- a/src/main/resources/mapper/question/ext/QuestionExtMapper.xml
+++ b/src/main/resources/mapper/question/ext/QuestionExtMapper.xml
@@ -30,4 +30,23 @@
order by lq_create_time asc
+
+
+ select
+ -- 问题与题库多对多,在本条 sql 容易出现重复行
+ distinct q.id, q.title, q.standard, q.create_time, q.update_time, lq.create_time lq_create_time
+ from question_library l
+ left join library_question_link lq on l.id = lq.lib_id and l.is_deleted = 0 and lq.is_deleted = 0
+ left join question q on q.id = lq.question_id and q.is_deleted = 0 and lq.is_deleted = 0
+
+ q.id is not null and l.is_deleted = 0
+
+
+ #{libId,jdbcType=BIGINT}
+
+
+
+ order by lq_create_time asc
+
From 308bcebb890d32f2cca46d61f8bc5ec99b0376cc Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Wed, 16 Oct 2024 21:42:39 +0800
Subject: [PATCH 083/104] =?UTF-8?q?fix:=20=E4=BD=BF=E7=94=A8=20redis=20?=
=?UTF-8?q?=E9=94=81=E9=81=BF=E5=85=8D=E5=87=BA=E7=8E=B0=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../constants/PaperLibraryConstants.java | 14 +++++++
.../constants/QuestionPaperConstants.java | 14 +++++++
.../impl/PaperQuestionLinkServiceImpl.java | 41 +++++++++++--------
.../impl/QuestionPaperServiceImpl.java | 31 +++++++++-----
.../constants/QuestionLibraryConstants.java | 16 ++++++++
.../service/impl/QuestionServiceImpl.java | 32 +++++++++------
.../mapper/question/ext/QuestionExtMapper.xml | 8 ++--
7 files changed, 112 insertions(+), 44 deletions(-)
create mode 100644 src/main/java/com/achobeta/domain/paper/constants/PaperLibraryConstants.java
create mode 100644 src/main/java/com/achobeta/domain/paper/constants/QuestionPaperConstants.java
create mode 100644 src/main/java/com/achobeta/domain/question/constants/QuestionLibraryConstants.java
diff --git a/src/main/java/com/achobeta/domain/paper/constants/PaperLibraryConstants.java b/src/main/java/com/achobeta/domain/paper/constants/PaperLibraryConstants.java
new file mode 100644
index 00000000..17446db6
--- /dev/null
+++ b/src/main/java/com/achobeta/domain/paper/constants/PaperLibraryConstants.java
@@ -0,0 +1,14 @@
+package com.achobeta.domain.paper.constants;
+
+/**
+ * Created With Intellij IDEA
+ * Description:
+ * User: 马拉圈
+ * Date: 2024-10-16
+ * Time: 21:24
+ */
+public interface PaperLibraryConstants {
+
+ String PAPER_LIBRARY_REFERENCE_PAPERS_LOCK = "paperLibraryReferencePapersLock:";
+
+}
diff --git a/src/main/java/com/achobeta/domain/paper/constants/QuestionPaperConstants.java b/src/main/java/com/achobeta/domain/paper/constants/QuestionPaperConstants.java
new file mode 100644
index 00000000..23176cbd
--- /dev/null
+++ b/src/main/java/com/achobeta/domain/paper/constants/QuestionPaperConstants.java
@@ -0,0 +1,14 @@
+package com.achobeta.domain.paper.constants;
+
+/**
+ * Created With Intellij IDEA
+ * Description:
+ * User: 马拉圈
+ * Date: 2024-10-16
+ * Time: 21:36
+ */
+public interface QuestionPaperConstants {
+
+ String PAPER_ADD_QUESTIONS_LOCK = "paperAddQuestionsLock:";
+
+}
diff --git a/src/main/java/com/achobeta/domain/paper/service/impl/PaperQuestionLinkServiceImpl.java b/src/main/java/com/achobeta/domain/paper/service/impl/PaperQuestionLinkServiceImpl.java
index 20b0aadf..6013dd4c 100644
--- a/src/main/java/com/achobeta/domain/paper/service/impl/PaperQuestionLinkServiceImpl.java
+++ b/src/main/java/com/achobeta/domain/paper/service/impl/PaperQuestionLinkServiceImpl.java
@@ -1,6 +1,7 @@
package com.achobeta.domain.paper.service.impl;
import com.achobeta.common.enums.GlobalServiceStatusCode;
+import com.achobeta.domain.paper.constants.QuestionPaperConstants;
import com.achobeta.domain.paper.model.dao.mapper.PaperQuestionLinkMapper;
import com.achobeta.domain.paper.model.dao.mapper.QuestionPaperLibraryMapper;
import com.achobeta.domain.paper.model.entity.PaperQuestionLink;
@@ -10,6 +11,8 @@
import com.achobeta.domain.paper.service.QuestionPaperService;
import com.achobeta.domain.question.model.vo.QuestionVO;
import com.achobeta.exception.GlobalServiceException;
+import com.achobeta.redis.lock.RedisLock;
+import com.achobeta.redis.lock.strategy.SimpleLockStrategy;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
@@ -17,10 +20,8 @@
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Optional;
-import java.util.Set;
+import java.util.*;
+import java.util.stream.Collectors;
/**
* @author 马拉圈
@@ -38,6 +39,10 @@ public class PaperQuestionLinkServiceImpl extends ServiceImpl getQuestionsOnPaper(Long paperId) {
return paperQuestionLinkMapper.getQuestionsOnPaper(paperId);
@@ -54,19 +59,21 @@ public Optional getPaperQuestionLink(Long paperId, Long quest
@Override
@Transactional
public void addQuestionsForPaper(Long paperId, List questionIds) {
- Set hash = new HashSet<>();
- // 获取试卷的所有题
- getQuestionsOnPaper(paperId).forEach(questionVO -> hash.add(questionVO.getId()));
- // 将不存在于原试卷的题滤出来
- List paperQuestionLinks = questionIds.stream()
- .filter(questionId -> !hash.contains(questionId))
- .map(questionId -> {
- PaperQuestionLink paperQuestionLink = new PaperQuestionLink();
- paperQuestionLink.setPaperId(paperId);
- paperQuestionLink.setQuestionId(questionId);
- return paperQuestionLink;
- }).toList();
- this.saveBatch(paperQuestionLinks);
+ redisLock.tryLockDoSomething(QuestionPaperConstants.PAPER_ADD_QUESTIONS_LOCK + paperId, () -> {
+ // 获取试卷的所有题
+ Set hash = getQuestionsOnPaper(paperId).stream().map(QuestionVO::getId).collect(Collectors.toSet());
+ // 将不存在于原试卷的题滤出来
+ List paperQuestionLinks = questionIds.stream()
+ .distinct()
+ .filter(questionId -> Objects.nonNull(questionId) && !hash.contains(questionId))
+ .map(questionId -> {
+ PaperQuestionLink paperQuestionLink = new PaperQuestionLink();
+ paperQuestionLink.setPaperId(paperId);
+ paperQuestionLink.setQuestionId(questionId);
+ return paperQuestionLink;
+ }).toList();
+ this.saveBatch(paperQuestionLinks);
+ }, () -> {}, simpleLockStrategy);
}
@Override
diff --git a/src/main/java/com/achobeta/domain/paper/service/impl/QuestionPaperServiceImpl.java b/src/main/java/com/achobeta/domain/paper/service/impl/QuestionPaperServiceImpl.java
index 51876914..213c9178 100644
--- a/src/main/java/com/achobeta/domain/paper/service/impl/QuestionPaperServiceImpl.java
+++ b/src/main/java/com/achobeta/domain/paper/service/impl/QuestionPaperServiceImpl.java
@@ -3,6 +3,7 @@
import com.achobeta.common.base.BasePageQuery;
import com.achobeta.common.base.BasePageResult;
import com.achobeta.common.enums.GlobalServiceStatusCode;
+import com.achobeta.domain.paper.constants.PaperLibraryConstants;
import com.achobeta.domain.paper.model.converter.QuestionPaperConverter;
import com.achobeta.domain.paper.model.dao.mapper.QuestionPaperMapper;
import com.achobeta.domain.paper.model.dto.PaperQueryDTO;
@@ -12,6 +13,8 @@
import com.achobeta.domain.paper.service.LibraryPaperLinkService;
import com.achobeta.domain.paper.service.QuestionPaperService;
import com.achobeta.exception.GlobalServiceException;
+import com.achobeta.redis.lock.RedisLock;
+import com.achobeta.redis.lock.strategy.SimpleLockStrategy;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
@@ -35,6 +38,10 @@ public class QuestionPaperServiceImpl extends ServiceImpl BasePageQuery -> page -> BasePageResult -> vo
* @param paperQueryDTO 分页参数
@@ -80,17 +87,19 @@ public Long addQuestionPaper(List libIds, String title, String description
@Override
public void referencePapers(Long libId, List paperIds) {
- Set hash = questionPaperMapper.getPapers(List.of(libId)).stream().map(QuestionPaper::getId).collect(Collectors.toSet());
- List libraryPaperLinkList = paperIds.stream()
- .distinct()
- .filter(paperId -> Objects.nonNull(paperId) && !hash.contains(paperId))
- .map(paperId -> {
- LibraryPaperLink libraryPaperLink = new LibraryPaperLink();
- libraryPaperLink.setPaperId(paperId);
- libraryPaperLink.setLibId(libId);
- return libraryPaperLink;
- }).toList();
- libraryPaperLinkService.saveBatch(libraryPaperLinkList);
+ redisLock.tryLockDoSomething(PaperLibraryConstants.PAPER_LIBRARY_REFERENCE_PAPERS_LOCK + libId, () -> {
+ Set hash = questionPaperMapper.getPapers(List.of(libId)).stream().map(QuestionPaper::getId).collect(Collectors.toSet());
+ List libraryPaperLinkList = paperIds.stream()
+ .distinct()
+ .filter(paperId -> Objects.nonNull(paperId) && !hash.contains(paperId))
+ .map(paperId -> {
+ LibraryPaperLink libraryPaperLink = new LibraryPaperLink();
+ libraryPaperLink.setPaperId(paperId);
+ libraryPaperLink.setLibId(libId);
+ return libraryPaperLink;
+ }).toList();
+ libraryPaperLinkService.saveBatch(libraryPaperLinkList);
+ }, () -> {}, simpleLockStrategy);
}
@Override
diff --git a/src/main/java/com/achobeta/domain/question/constants/QuestionLibraryConstants.java b/src/main/java/com/achobeta/domain/question/constants/QuestionLibraryConstants.java
new file mode 100644
index 00000000..1178386b
--- /dev/null
+++ b/src/main/java/com/achobeta/domain/question/constants/QuestionLibraryConstants.java
@@ -0,0 +1,16 @@
+package com.achobeta.domain.question.constants;
+
+import lombok.Data;
+
+/**
+ * Created With Intellij IDEA
+ * Description:
+ * User: 马拉圈
+ * Date: 2024-10-16
+ * Time: 21:30
+ */
+public interface QuestionLibraryConstants {
+
+ String QUESTION_LIBRARY_REFERENCE_QUESTIONS_LOCK = "questionLibraryReferenceQuestionsLock:";
+
+}
diff --git a/src/main/java/com/achobeta/domain/question/service/impl/QuestionServiceImpl.java b/src/main/java/com/achobeta/domain/question/service/impl/QuestionServiceImpl.java
index 52c14c82..c4dd241b 100644
--- a/src/main/java/com/achobeta/domain/question/service/impl/QuestionServiceImpl.java
+++ b/src/main/java/com/achobeta/domain/question/service/impl/QuestionServiceImpl.java
@@ -3,6 +3,7 @@
import com.achobeta.common.base.BasePageQuery;
import com.achobeta.common.base.BasePageResult;
import com.achobeta.common.enums.GlobalServiceStatusCode;
+import com.achobeta.domain.question.constants.QuestionLibraryConstants;
import com.achobeta.domain.question.model.converter.QuestionConverter;
import com.achobeta.domain.question.model.dao.mapper.QuestionLibraryMapper;
import com.achobeta.domain.question.model.dao.mapper.QuestionMapper;
@@ -19,6 +20,8 @@
import com.achobeta.domain.question.service.QuestionLibraryService;
import com.achobeta.domain.question.service.QuestionService;
import com.achobeta.exception.GlobalServiceException;
+import com.achobeta.redis.lock.RedisLock;
+import com.achobeta.redis.lock.strategy.SimpleLockStrategy;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
@@ -39,7 +42,6 @@
public class QuestionServiceImpl extends ServiceImpl
implements QuestionService{
-
private final QuestionMapper questionMapper;
private final QuestionLibraryMapper questionLibraryMapper;
@@ -48,6 +50,10 @@ public class QuestionServiceImpl extends ServiceImpl
private final LibraryQuestionLinkService libraryQuestionLinkService;
+ private final RedisLock redisLock;
+
+ private final SimpleLockStrategy simpleLockStrategy;
+
/**
* 流程:dto -> BasePageQuery -> page -> BasePageResult -> vo
* @param questionQueryDTO 分页参数
@@ -93,17 +99,19 @@ public Long addQuestion(List libIds, String title, String standard) {
@Override
public void referenceQuestions(Long libId, List questionIds) {
- Set hash = questionMapper.getQuestions(List.of(libId)).stream().map(Question::getId).collect(Collectors.toSet());
- List libraryQuestionLinkList = questionIds.stream()
- .distinct()
- .filter(questionId -> Objects.nonNull(questionId) && !hash.contains(questionId))
- .map(questionId -> {
- LibraryQuestionLink libraryQuestionLink = new LibraryQuestionLink();
- libraryQuestionLink.setQuestionId(questionId);
- libraryQuestionLink.setLibId(libId);
- return libraryQuestionLink;
- }).toList();
- libraryQuestionLinkService.saveBatch(libraryQuestionLinkList);
+ redisLock.tryLockDoSomething(QuestionLibraryConstants.QUESTION_LIBRARY_REFERENCE_QUESTIONS_LOCK + libId, () -> {
+ Set hash = questionMapper.getQuestions(List.of(libId)).stream().map(Question::getId).collect(Collectors.toSet());
+ List libraryQuestionLinkList = questionIds.stream()
+ .distinct()
+ .filter(questionId -> Objects.nonNull(questionId) && !hash.contains(questionId))
+ .map(questionId -> {
+ LibraryQuestionLink libraryQuestionLink = new LibraryQuestionLink();
+ libraryQuestionLink.setQuestionId(questionId);
+ libraryQuestionLink.setLibId(libId);
+ return libraryQuestionLink;
+ }).toList();
+ libraryQuestionLinkService.saveBatch(libraryQuestionLinkList);
+ }, () -> {}, simpleLockStrategy);
}
@Override
diff --git a/src/main/resources/mapper/question/ext/QuestionExtMapper.xml b/src/main/resources/mapper/question/ext/QuestionExtMapper.xml
index 927e36ec..293cbc0b 100644
--- a/src/main/resources/mapper/question/ext/QuestionExtMapper.xml
+++ b/src/main/resources/mapper/question/ext/QuestionExtMapper.xml
@@ -34,11 +34,11 @@
select
- -- 问题与题库多对多,在本条 sql 容易出现重复行
- distinct q.id, q.title, q.standard, q.create_time, q.update_time, lq.create_time lq_create_time
+ -- 问题与题库多对多,在本条 sql 容易出现重复行
+ distinct q.id, q.title, q.standard, q.create_time, q.update_time, lq.create_time lq_create_time
from question_library l
- left join library_question_link lq on l.id = lq.lib_id and l.is_deleted = 0 and lq.is_deleted = 0
- left join question q on q.id = lq.question_id and q.is_deleted = 0 and lq.is_deleted = 0
+ left join library_question_link lq on l.id = lq.lib_id and l.is_deleted = 0 and lq.is_deleted = 0
+ left join question q on q.id = lq.question_id and q.is_deleted = 0 and lq.is_deleted = 0
q.id is not null and l.is_deleted = 0
From 279cd3d13188f86e58bfe537e4c2fc6d7c74bead Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Wed, 16 Oct 2024 21:46:54 +0800
Subject: [PATCH 084/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../paper/service/impl/PaperQuestionLinkServiceImpl.java | 5 ++++-
.../domain/question/constants/QuestionLibraryConstants.java | 2 --
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/main/java/com/achobeta/domain/paper/service/impl/PaperQuestionLinkServiceImpl.java b/src/main/java/com/achobeta/domain/paper/service/impl/PaperQuestionLinkServiceImpl.java
index 6013dd4c..f8f9841f 100644
--- a/src/main/java/com/achobeta/domain/paper/service/impl/PaperQuestionLinkServiceImpl.java
+++ b/src/main/java/com/achobeta/domain/paper/service/impl/PaperQuestionLinkServiceImpl.java
@@ -20,7 +20,10 @@
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
-import java.util.*;
+import java.util.List;
+import java.util.Objects;
+import java.util.Optional;
+import java.util.Set;
import java.util.stream.Collectors;
/**
diff --git a/src/main/java/com/achobeta/domain/question/constants/QuestionLibraryConstants.java b/src/main/java/com/achobeta/domain/question/constants/QuestionLibraryConstants.java
index 1178386b..ebdb40fa 100644
--- a/src/main/java/com/achobeta/domain/question/constants/QuestionLibraryConstants.java
+++ b/src/main/java/com/achobeta/domain/question/constants/QuestionLibraryConstants.java
@@ -1,7 +1,5 @@
package com.achobeta.domain.question.constants;
-import lombok.Data;
-
/**
* Created With Intellij IDEA
* Description:
From b1aad579e20093a736057557113402fea900d52f Mon Sep 17 00:00:00 2001
From: Dbinggo <140064609+Dbinggo@users.noreply.github.com>
Date: Wed, 16 Oct 2024 22:24:40 +0800
Subject: [PATCH 085/104] Update docker-compose.yml
---
docker-compose.yml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/docker-compose.yml b/docker-compose.yml
index 3d1e1bcc..094196f9 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -124,8 +124,8 @@ services:
# 密码
MINIO_ROOT_PASSWORD: bitter-macaron
ports:
- - "9005:9005"
- - "19005:19005"
+ - "9005:9001"
+ - "19005:9000"
volumes:
- ./minio/data:/data
command: server /data
@@ -172,4 +172,4 @@ services:
networks:
my-network:
- driver: bridge
\ No newline at end of file
+ driver: bridge
From c5256356b36bebf99e116c0048ebb946859ad650 Mon Sep 17 00:00:00 2001
From: BanTanger <1290288968@qq.com>
Date: Thu, 17 Oct 2024 00:28:28 +0800
Subject: [PATCH 086/104] =?UTF-8?q?feat:=20docker=20=E5=9F=BA=E5=BB=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
build.sh | 4 +-
docker-compose.yml | 31 +++++++--------
docker/mysql/conf/my.conf | 57 ----------------------------
docker/mysql/db/recruitment-core.sql | 3 ++
docker/rabbitmq/enabled_plugins | 1 -
5 files changed, 21 insertions(+), 75 deletions(-)
delete mode 100644 docker/mysql/conf/my.conf
delete mode 100644 docker/rabbitmq/enabled_plugins
diff --git a/build.sh b/build.sh
index ff583106..9bf5b932 100644
--- a/build.sh
+++ b/build.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
# Be sure your script exits whenever encounter errors
-echo "--------------------------------"
+echo "---------------------------------"
echo "::: Welcome to AB-Recruitment :::"
set -e
@@ -10,7 +10,7 @@ export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
-#mvn clean install package -Dmaven.test.skip=true
+mvn clean install package -Dmaven.test.skip=true
# 普通镜像构建,随系统版本构建 amd/arm
diff --git a/docker-compose.yml b/docker-compose.yml
index 3d1e1bcc..b3541600 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -4,11 +4,13 @@ services:
mysql:
image: mysql:5.7
container_name: mysql
- command: --default-authentication-plugin=mysql_native_password
+ command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
restart: always
environment:
TZ: Asia/Shanghai
- MYSQL_ROOT_PASSWORD: bitter-macaron
+ MYSQL_ROOT_PASSWORD: achobeta666
+ MYSQL_USER: mms
+ MYSQL_PASSWORD: bitter-macaron
networks:
- my-network
depends_on:
@@ -16,8 +18,7 @@ services:
ports:
- "13306:3306"
volumes:
- - ./mysql/sql:/docker-entrypoint-initdb.d
- - ./mysql/conf/my.conf:/usr/local/etc/mysql/my.conf
+ - ./docker/mysql/db:/docker-entrypoint-initdb.d
healthcheck:
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ]
interval: 5s
@@ -38,11 +39,11 @@ services:
container_name: phpmyadmin
hostname: phpmyadmin
ports:
- - 8899:80
+ - "8899:80"
environment:
- PMA_HOST=mysql
- - PMA_PORT=13306
- - MYSQL_ROOT_PASSWORD=bitter-macaron
+ - PMA_PORT=3306
+ - MYSQL_ROOT_PASSWORD=achobeta666
depends_on:
mysql:
condition: service_healthy
@@ -59,7 +60,7 @@ services:
ports:
- "6379:6379"
volumes:
- - ./redis/conf/redis.conf:/usr/local/etc/redis/redis.conf
+ - ./docker/redis/conf/redis.conf:/usr/local/etc/redis/redis.conf
command: redis-server /usr/local/etc/redis/redis.conf
networks:
- my-network
@@ -105,8 +106,6 @@ services:
RABBITMQ_DEFAULT_USER: itcast
RABBITMQ_DEFAULT_PASS: 123321
command: rabbitmq-server
- volumes:
- - ./rabbitmq/enabled_plugins:/etc/rabbitmq/enabled_plugins
networks:
- my-network
@@ -124,8 +123,8 @@ services:
# 密码
MINIO_ROOT_PASSWORD: bitter-macaron
ports:
- - "9005:9005"
- - "19005:19005"
+ - "19005:9000"
+ - "9005:9001"
volumes:
- ./minio/data:/data
command: server /data
@@ -135,11 +134,11 @@ services:
ab-recruitment-app:
container_name: ab-recruitment-app
build:
- context: ../
+ context: ./
dockerfile: Dockerfile
restart: always
ports:
- - "9001:9001"
+ - "9001:19001"
environment:
- TZ=PRC
- SERVER_PORT=9001
@@ -147,7 +146,7 @@ services:
- APP_CONFIG_CROSS_ORIGIN=*
- SPRING_DATASOURCE_USERNAME=mms
- SPRING_DATASOURCE_PASSWORD=bitter-macaron
- - SPRING_DATASOURCE_URL=jdbc:mysql://mysql:13306/achobeta_recruitment?serverTimezone=UTC&characterEncoding=utf8&autoReconnect=true&serverTimezone=Asia/Shanghai
+ - SPRING_DATASOURCE_URL=jdbc:mysql://mysql:3306/achobeta_recruitment?serverTimezone=UTC&characterEncoding=utf8&autoReconnect=true&serverTimezone=Asia/Shanghai
- SPRING_DATASOURCE_DRIVER_CLASS_NAME=com.mysql.jdbc.Driver
- SPRING_HIKARI_POOL_NAME=Retail_HikariCP
- REDIS_SDK_CONFIG_HOST=redis
@@ -158,10 +157,12 @@ services:
- redis
- rabbitmq
- mysql
+ - minio
links:
- redis
- rabbitmq
- mysql
+ - minio
networks:
- my-network
logging:
diff --git a/docker/mysql/conf/my.conf b/docker/mysql/conf/my.conf
deleted file mode 100644
index e6ad824e..00000000
--- a/docker/mysql/conf/my.conf
+++ /dev/null
@@ -1,57 +0,0 @@
-[mysqld]
-# 设置13306端口
-port=13306
-
-# 设置mysql的安装目录
-basedir=/usr/local/mysql
-
-# 设置mysql数据库的数据的存放目录
-datadir=/usr/local/mysql/mysqldb
-
-# 允许最大连接数
-max_connections=1000
-
-# 允许连接失败的次数。这是为了防止有人从该主机试图攻击数据库系统
-max_connect_errors=100
-
-init_connect='SET collation_connection = utf8_unicode_ci'
-init_connect='SET NAMES utf8'
-
-# 服务端使用的字符集默认为UTF8
-character-set-server=utf8
-
-collation-server=utf8_unicode_ci
-skip-character-set-client-handshake
-
-# 创建新表时将使用的默认存储引擎
-default-storage-engine=INNODB
-
-# 默认使用“mysql_native_password”插件认证
-default_authentication_plugin=mysql_native_password
-
-#是否对sql语句大小写敏感,1表示不敏感
-lower_case_table_names = 1
-
-#MySQL连接闲置超过一定时间后(单位:秒)将会被强行关闭
-#MySQL默认的wait_timeout 值为8个小时, interactive_timeout参数需要同时配置才能生效
-interactive_timeout = 1800
-wait_timeout = 1800
-
-#Metadata Lock最大时长(秒), 一般用于控制 alter操作的最大时长sine mysql5.6
-#执行 DML操作时除了增加innodb事务锁外还增加Metadata Lock,其他alter(DDL)session将阻塞
-lock_wait_timeout = 3600
-
-#内部内存临时表的最大值。
-#比如大数据量的group by ,order by时可能用到临时表,
-#超过了这个值将写入磁盘,系统IO压力增大
-tmp_table_size = 64M
-max_heap_table_size = 64M
-
-[mysql]
-# 设置mysql客户端默认字符集
-default-character-set=utf8
-
-[client]
-# 设置mysql客户端连接服务端时默认使用的端口
-port=13306
-default-character-set=utf8
diff --git a/docker/mysql/db/recruitment-core.sql b/docker/mysql/db/recruitment-core.sql
index 71f99c13..f40e7965 100644
--- a/docker/mysql/db/recruitment-core.sql
+++ b/docker/mysql/db/recruitment-core.sql
@@ -1,3 +1,6 @@
+SET character_set_client = utf8;
+SET character_set_results = utf8;
+SET character_set_connection = utf8;
drop database if exists achobeta_recruitment;
create database achobeta_recruitment character set utf8mb4 collate utf8mb4_bin;
diff --git a/docker/rabbitmq/enabled_plugins b/docker/rabbitmq/enabled_plugins
deleted file mode 100644
index 90fdaa37..00000000
--- a/docker/rabbitmq/enabled_plugins
+++ /dev/null
@@ -1 +0,0 @@
-[rabbitmq_management].
\ No newline at end of file
From 4f1d5e974da98db5cccfa2fa26533a4386ab1e68 Mon Sep 17 00:00:00 2001
From: BanTanger <1290288968@qq.com>
Date: Thu, 17 Oct 2024 08:47:55 +0800
Subject: [PATCH 087/104] =?UTF-8?q?feat:=20=E6=B5=8B=E8=AF=95=20docker=20m?=
=?UTF-8?q?inio=20=E6=95=B0=E6=8D=AE=E5=8D=B7=E6=8C=82=E8=BD=BD=E8=83=BD?=
=?UTF-8?q?=E5=8A=9B=EF=BC=8C=E6=9B=B4=E6=96=B0=20minio=20=E7=89=88?=
=?UTF-8?q?=E6=9C=AC=E8=87=B3=202024?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.gitignore | 4 +++-
docker-compose.yml | 16 ++++++++++------
2 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/.gitignore b/.gitignore
index 4c305b49..d885a769 100644
--- a/.gitignore
+++ b/.gitignore
@@ -36,4 +36,6 @@ build/
### Mac OS ###
.DS_Store
-/.idea/
\ No newline at end of file
+/.idea/
+/docker/minio/data/.minio.sys/
+/docker/minio/data/achobeta-recruitment/
diff --git a/docker-compose.yml b/docker-compose.yml
index b3541600..d5b483d2 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -110,9 +110,8 @@ services:
- my-network
# minio
- # minio 的 docker 有问题,一直没法连接,只好先用旧服务器了
minio:
- image: minio/minio:RELEASE.2021-06-17T00-10-46Z
+ image: minio/minio:RELEASE.2024-09-13T20-26-02Z
container_name: minio
hostname: minio
privileged: true
@@ -123,13 +122,18 @@ services:
# 密码
MINIO_ROOT_PASSWORD: bitter-macaron
ports:
- - "19005:9000"
- - "9005:9001"
+ - "19005:19005"
+ - "9005:9005"
volumes:
- - ./minio/data:/data
- command: server /data
+ - ./docker/minio/data:/data
+ command: server /data --console-address ":19005"
networks:
- my-network
+ healthcheck:
+ test: ["CMD", "curl", "-f", "http://localhost:9005/minio/health/live"]
+ interval: 30s
+ timeout: 20s
+ retries: 3
ab-recruitment-app:
container_name: ab-recruitment-app
From 9a8c4160db7182853e6e470e233a02dfb75acaef Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Thu, 17 Oct 2024 12:24:38 +0800
Subject: [PATCH 088/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pom.xml | 12 ++++--
.../model/vo/InterviewExcelTemplate.java | 6 +++
.../achobeta/template/engine/HtmlEngine.java | 37 ++---------------
.../achobeta/template/util/MarkdownUtil.java | 41 +++++++++++++++++++
4 files changed, 60 insertions(+), 36 deletions(-)
create mode 100644 src/main/java/com/achobeta/template/util/MarkdownUtil.java
diff --git a/pom.xml b/pom.xml
index 35fa158d..de8aaa07 100644
--- a/pom.xml
+++ b/pom.xml
@@ -173,9 +173,15 @@
- com.vladsch.flexmark
- flexmark-all
- 0.64.8
+ org.commonmark
+ commonmark
+ 0.23.0
+
+
+
+ org.commonmark
+ commonmark-ext-gfm-tables
+ 0.23.0
diff --git a/src/main/java/com/achobeta/domain/interview/model/vo/InterviewExcelTemplate.java b/src/main/java/com/achobeta/domain/interview/model/vo/InterviewExcelTemplate.java
index f098ac90..18443734 100644
--- a/src/main/java/com/achobeta/domain/interview/model/vo/InterviewExcelTemplate.java
+++ b/src/main/java/com/achobeta/domain/interview/model/vo/InterviewExcelTemplate.java
@@ -22,6 +22,12 @@ public class InterviewExcelTemplate {
@Excel(name = "状态", width = 20)
private InterviewStatus status;
+ @Excel(name = "说明", width = 50)
+ private String description;
+
+ @Excel(name = "地址", width = 50)
+ private String address;
+
@ExcelEntity(name = "面试预约")
private ScheduleVO scheduleVO;
diff --git a/src/main/java/com/achobeta/template/engine/HtmlEngine.java b/src/main/java/com/achobeta/template/engine/HtmlEngine.java
index 74a6bcc5..31376695 100644
--- a/src/main/java/com/achobeta/template/engine/HtmlEngine.java
+++ b/src/main/java/com/achobeta/template/engine/HtmlEngine.java
@@ -2,14 +2,8 @@
import com.achobeta.template.model.po.ReplaceResource;
import com.achobeta.template.model.po.Resource;
+import com.achobeta.template.util.MarkdownUtil;
import com.achobeta.template.util.TemplateUtil;
-import com.vladsch.flexmark.ext.tables.TablesExtension;
-import com.vladsch.flexmark.ext.toc.TocExtension;
-import com.vladsch.flexmark.html.HtmlRenderer;
-import com.vladsch.flexmark.parser.Parser;
-import com.vladsch.flexmark.parser.ParserEmulationProfile;
-import com.vladsch.flexmark.util.ast.Node;
-import com.vladsch.flexmark.util.data.MutableDataSet;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;
import org.thymeleaf.TemplateEngine;
@@ -41,29 +35,6 @@ public HtmlBuilder builder() {
public class HtmlBuilder {
- private final static MutableDataSet OPTIONS;
-
- private final static Parser PARSER;
-
- private final static HtmlRenderer HTML_RENDERER;
-
- static {
- OPTIONS = new MutableDataSet()
- .setFrom(ParserEmulationProfile.MARKDOWN)
- // 支持 [TOC]目录 以及 表格
- .set(Parser.EXTENSIONS, List.of(TocExtension.create(), TablesExtension.create()))
- ;
- PARSER = Parser.builder(OPTIONS).build();
- HTML_RENDERER = HtmlRenderer.builder(OPTIONS).build();
- }
-
- private String markdownToHtml(String markdown) {
- // 解析 Markdown 文本为节点
- Node document = PARSER.parse(markdown);
- // 将 Markdown 节点渲染为 HTML
- return HTML_RENDERER.render(document);
- }
-
private final StringBuffer htmlBuffer = new StringBuffer();
public String build() {
@@ -104,7 +75,7 @@ public HtmlBuilder append(List resourceList) {
// md -> html 追加
public HtmlBuilder appendMarkdown(String markdown) {
- String html = markdownToHtml(markdown);
+ String html = MarkdownUtil.markdownToHtml(markdown);
return append(html);
}
@@ -156,7 +127,7 @@ public HtmlBuilder replace(List resourceList) {
* 3. 紧接着调用 replaceMarkdown,传入 uniqueSymbol 和原 markdown 文本,文本转换为 html 并替换 uniqueSymbol 的位置
*/
public HtmlBuilder replaceMarkdown(String target, String markdown) {
- String html = markdownToHtml(markdown);
+ String html = MarkdownUtil.markdownToHtml(markdown);
return replace(target, html);
}
@@ -167,7 +138,7 @@ public HtmlBuilder replaceMarkdown(ReplaceResource resource) {
// md 转化为 html 替换对应的 target
public HtmlBuilder replaceMarkdown(List resourceList) {
- String finalHtml = TemplateUtil.replaceSafely(build(), resourceList, this::markdownToHtml);
+ String finalHtml = TemplateUtil.replaceSafely(build(), resourceList, MarkdownUtil::markdownToHtml);
return reset(finalHtml);
}
diff --git a/src/main/java/com/achobeta/template/util/MarkdownUtil.java b/src/main/java/com/achobeta/template/util/MarkdownUtil.java
new file mode 100644
index 00000000..6447b3e3
--- /dev/null
+++ b/src/main/java/com/achobeta/template/util/MarkdownUtil.java
@@ -0,0 +1,41 @@
+package com.achobeta.template.util;
+
+import lombok.Data;
+import org.commonmark.Extension;
+import org.commonmark.ext.gfm.tables.TablesExtension;
+import org.commonmark.node.Node;
+import org.commonmark.parser.Parser;
+import org.commonmark.renderer.html.HtmlRenderer;
+
+import java.util.List;
+
+/**
+ * Created With Intellij IDEA
+ * Description:
+ * User: 马拉圈
+ * Date: 2024-10-17
+ * Time: 11:16
+ */
+@Data
+public class MarkdownUtil {
+
+ private final static List OPTIONS;
+
+ private final static Parser PARSER;
+
+ private final static HtmlRenderer HTML_RENDERER;
+
+ static {
+ OPTIONS = List.of(TablesExtension.create());
+ PARSER = Parser.builder().extensions(OPTIONS).build();
+ HTML_RENDERER = HtmlRenderer.builder().extensions(OPTIONS).build();
+ }
+
+ public static String markdownToHtml(String markdown) {
+ // 解析 Markdown 文本为节点
+ Node document = PARSER.parse(markdown);
+ // 将 Markdown 节点渲染为 HTML
+ return HTML_RENDERER.render(document);
+ }
+
+}
From 61981a300ff481ecf716d85d207adc7ea79c1518 Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Thu, 17 Oct 2024 13:17:27 +0800
Subject: [PATCH 089/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pom.xml | 20 +++++++++++++++++++
.../achobeta/template/util/MarkdownUtil.java | 12 ++++++++++-
2 files changed, 31 insertions(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index de8aaa07..06b1809e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -183,6 +183,26 @@
commonmark-ext-gfm-tables0.23.0
+
+ org.commonmark
+ commonmark-ext-autolink
+ 0.23.0
+
+
+ org.commonmark
+ commonmark-ext-gfm-strikethrough
+ 0.23.0
+
+
+ org.commonmark
+ commonmark-ext-footnotes
+ 0.23.0
+
+
+ org.commonmark
+ commonmark-ext-task-list-items
+ 0.23.0
+
diff --git a/src/main/java/com/achobeta/template/util/MarkdownUtil.java b/src/main/java/com/achobeta/template/util/MarkdownUtil.java
index 6447b3e3..1c0eb506 100644
--- a/src/main/java/com/achobeta/template/util/MarkdownUtil.java
+++ b/src/main/java/com/achobeta/template/util/MarkdownUtil.java
@@ -2,7 +2,11 @@
import lombok.Data;
import org.commonmark.Extension;
+import org.commonmark.ext.autolink.AutolinkExtension;
+import org.commonmark.ext.footnotes.FootnotesExtension;
+import org.commonmark.ext.gfm.strikethrough.StrikethroughExtension;
import org.commonmark.ext.gfm.tables.TablesExtension;
+import org.commonmark.ext.task.list.items.TaskListItemsExtension;
import org.commonmark.node.Node;
import org.commonmark.parser.Parser;
import org.commonmark.renderer.html.HtmlRenderer;
@@ -26,7 +30,13 @@ public class MarkdownUtil {
private final static HtmlRenderer HTML_RENDERER;
static {
- OPTIONS = List.of(TablesExtension.create());
+ OPTIONS = List.of(
+ TablesExtension.create(),
+ AutolinkExtension.create(),
+ StrikethroughExtension.create(),
+ FootnotesExtension.create(),
+ TaskListItemsExtension.create()
+ );
PARSER = Parser.builder().extensions(OPTIONS).build();
HTML_RENDERER = HtmlRenderer.builder().extensions(OPTIONS).build();
}
From 1d0f86bc40cb09bb6b522dcaeebf7d0417bb7cb5 Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Thu, 17 Oct 2024 13:47:32 +0800
Subject: [PATCH 090/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pom.xml | 32 ++----------
.../achobeta/template/util/MarkdownUtil.java | 49 +++++++++++--------
2 files changed, 31 insertions(+), 50 deletions(-)
diff --git a/pom.xml b/pom.xml
index 06b1809e..35fa158d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -173,35 +173,9 @@
- org.commonmark
- commonmark
- 0.23.0
-
-
-
- org.commonmark
- commonmark-ext-gfm-tables
- 0.23.0
-
-
- org.commonmark
- commonmark-ext-autolink
- 0.23.0
-
-
- org.commonmark
- commonmark-ext-gfm-strikethrough
- 0.23.0
-
-
- org.commonmark
- commonmark-ext-footnotes
- 0.23.0
-
-
- org.commonmark
- commonmark-ext-task-list-items
- 0.23.0
+ com.vladsch.flexmark
+ flexmark-all
+ 0.64.8
diff --git a/src/main/java/com/achobeta/template/util/MarkdownUtil.java b/src/main/java/com/achobeta/template/util/MarkdownUtil.java
index 1c0eb506..19167f86 100644
--- a/src/main/java/com/achobeta/template/util/MarkdownUtil.java
+++ b/src/main/java/com/achobeta/template/util/MarkdownUtil.java
@@ -1,15 +1,19 @@
package com.achobeta.template.util;
-import lombok.Data;
-import org.commonmark.Extension;
-import org.commonmark.ext.autolink.AutolinkExtension;
-import org.commonmark.ext.footnotes.FootnotesExtension;
-import org.commonmark.ext.gfm.strikethrough.StrikethroughExtension;
-import org.commonmark.ext.gfm.tables.TablesExtension;
-import org.commonmark.ext.task.list.items.TaskListItemsExtension;
-import org.commonmark.node.Node;
-import org.commonmark.parser.Parser;
-import org.commonmark.renderer.html.HtmlRenderer;
+
+
+import com.vladsch.flexmark.ext.autolink.AutolinkExtension;
+import com.vladsch.flexmark.ext.footnotes.FootnoteExtension;
+import com.vladsch.flexmark.ext.gfm.strikethrough.StrikethroughExtension;
+import com.vladsch.flexmark.ext.gfm.tasklist.TaskListExtension;
+import com.vladsch.flexmark.ext.ins.InsExtension;
+import com.vladsch.flexmark.ext.tables.TablesExtension;
+import com.vladsch.flexmark.ext.toc.TocExtension;
+import com.vladsch.flexmark.ext.yaml.front.matter.YamlFrontMatterExtension;
+import com.vladsch.flexmark.html.HtmlRenderer;
+import com.vladsch.flexmark.parser.Parser;
+import com.vladsch.flexmark.util.ast.Node;
+import com.vladsch.flexmark.util.data.MutableDataSet;
import java.util.List;
@@ -20,25 +24,28 @@
* Date: 2024-10-17
* Time: 11:16
*/
-@Data
public class MarkdownUtil {
- private final static List OPTIONS;
+ private final static MutableDataSet OPTIONS;
private final static Parser PARSER;
private final static HtmlRenderer HTML_RENDERER;
static {
- OPTIONS = List.of(
- TablesExtension.create(),
- AutolinkExtension.create(),
- StrikethroughExtension.create(),
- FootnotesExtension.create(),
- TaskListItemsExtension.create()
- );
- PARSER = Parser.builder().extensions(OPTIONS).build();
- HTML_RENDERER = HtmlRenderer.builder().extensions(OPTIONS).build();
+ OPTIONS = new MutableDataSet()
+ .set(Parser.EXTENSIONS, List.of(
+ TablesExtension.create(),
+ AutolinkExtension.create(),
+ StrikethroughExtension.create(),
+ FootnoteExtension.create(),
+ TaskListExtension.create(),
+ InsExtension.create(),
+ TocExtension.create()
+ ));
+
+ PARSER = Parser.builder(OPTIONS).build();
+ HTML_RENDERER = HtmlRenderer.builder(OPTIONS).build();
}
public static String markdownToHtml(String markdown) {
From dc4bcfb99a21d1826075a085542ae67b60115dc8 Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Thu, 17 Oct 2024 16:52:28 +0800
Subject: [PATCH 091/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../controller/ResumeStateController.java | 2 +-
.../service/impl/ResumeStateServiceImpl.java | 2 +-
.../service/impl/StuResumeServiceImpl.java | 2 +-
.../achobeta/template/util/MarkdownUtil.java | 19 +++++++++++++------
4 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/src/main/java/com/achobeta/domain/resumestate/controller/ResumeStateController.java b/src/main/java/com/achobeta/domain/resumestate/controller/ResumeStateController.java
index d8600e89..72fe08ec 100644
--- a/src/main/java/com/achobeta/domain/resumestate/controller/ResumeStateController.java
+++ b/src/main/java/com/achobeta/domain/resumestate/controller/ResumeStateController.java
@@ -73,7 +73,7 @@ public SystemJsonResponse executeEvent(@PathVariable("resumeId") @NotNull Long r
Long managerId = BaseContext.getCurrentUser().getUserId();
log.warn("管理员更新简历 {} 为 {} 状态", managerId, resumeStatus);
// 不相等则更新
- if(!currentStatus.equals(resumeStatus)) {
+ if(currentStatus != resumeStatus) {
resumeStateService.switchResumeState(resumeId, resumeStatus, ResumeEvent.NEXT);
}
return SystemJsonResponse.SYSTEM_SUCCESS();
diff --git a/src/main/java/com/achobeta/domain/resumestate/service/impl/ResumeStateServiceImpl.java b/src/main/java/com/achobeta/domain/resumestate/service/impl/ResumeStateServiceImpl.java
index b104da31..5238773e 100644
--- a/src/main/java/com/achobeta/domain/resumestate/service/impl/ResumeStateServiceImpl.java
+++ b/src/main/java/com/achobeta/domain/resumestate/service/impl/ResumeStateServiceImpl.java
@@ -87,7 +87,7 @@ public List getProcessByResumeId(StuResume currentResume)
ResumeStatus currentStatus = currentResume.getStatus();
List statusProcesses = resumeStatusProcessService.getProcessByResumeId(resumeId);
// 如果没有节点或者最后一个节点不是当前状态,则推进到当前状态
- if(CollectionUtils.isEmpty(statusProcesses) || !currentStatus.equals(statusProcesses.getLast().getResumeStatus())) {
+ if(CollectionUtils.isEmpty(statusProcesses) || currentStatus != statusProcesses.getLast().getResumeStatus()) {
ResumeStatusProcess process = resumeStatusProcessService.createResumeStatusProcess(resumeId, currentStatus, ResumeEvent.NEXT);
statusProcesses.add(process);
}
diff --git a/src/main/java/com/achobeta/domain/student/service/impl/StuResumeServiceImpl.java b/src/main/java/com/achobeta/domain/student/service/impl/StuResumeServiceImpl.java
index 90a98790..cbc22604 100644
--- a/src/main/java/com/achobeta/domain/student/service/impl/StuResumeServiceImpl.java
+++ b/src/main/java/com/achobeta/domain/student/service/impl/StuResumeServiceImpl.java
@@ -158,7 +158,7 @@ private StuResume getStuResume(QueryResumeDTO queryResumeDTO) {
@Transactional
public void updateResumeInfo(StuResume stuResume, StuSimpleResumeDTO resumeDTO) {
ResumeStatus resumeStatus = stuResume.getStatus();
- if (Objects.isNull(resumeStatus) || ResumeStatus.DRAFT.equals(resumeStatus)) {
+ if (Objects.isNull(resumeStatus) || ResumeStatus.DRAFT == resumeStatus) {
//简历状态若为草稿则更新为待筛选
stuResume.setStatus(ResumeStatus.PENDING_SELECTION);
// 添加一个简历过程节点
diff --git a/src/main/java/com/achobeta/template/util/MarkdownUtil.java b/src/main/java/com/achobeta/template/util/MarkdownUtil.java
index 19167f86..758a6d86 100644
--- a/src/main/java/com/achobeta/template/util/MarkdownUtil.java
+++ b/src/main/java/com/achobeta/template/util/MarkdownUtil.java
@@ -1,17 +1,19 @@
package com.achobeta.template.util;
-
+import com.vladsch.flexmark.ext.abbreviation.AbbreviationExtension;
import com.vladsch.flexmark.ext.autolink.AutolinkExtension;
+import com.vladsch.flexmark.ext.definition.DefinitionExtension;
import com.vladsch.flexmark.ext.footnotes.FootnoteExtension;
import com.vladsch.flexmark.ext.gfm.strikethrough.StrikethroughExtension;
import com.vladsch.flexmark.ext.gfm.tasklist.TaskListExtension;
import com.vladsch.flexmark.ext.ins.InsExtension;
import com.vladsch.flexmark.ext.tables.TablesExtension;
import com.vladsch.flexmark.ext.toc.TocExtension;
-import com.vladsch.flexmark.ext.yaml.front.matter.YamlFrontMatterExtension;
+import com.vladsch.flexmark.ext.typographic.TypographicExtension;
import com.vladsch.flexmark.html.HtmlRenderer;
import com.vladsch.flexmark.parser.Parser;
+import com.vladsch.flexmark.parser.ParserEmulationProfile;
import com.vladsch.flexmark.util.ast.Node;
import com.vladsch.flexmark.util.data.MutableDataSet;
@@ -34,16 +36,21 @@ public class MarkdownUtil {
static {
OPTIONS = new MutableDataSet()
- .set(Parser.EXTENSIONS, List.of(
+ // 指定 Markdown 标准为 COMMONMARK(使用 ParserEmulationProfile.MARKDOWN 可能会有一些语法失效!)
+ .setFrom(ParserEmulationProfile.COMMONMARK)
+ .set(Parser.EXTENSIONS, List.of(new Parser.ParserExtension[]{
+ // 设置一些常见的扩展
+ TocExtension.create(),
TablesExtension.create(),
AutolinkExtension.create(),
StrikethroughExtension.create(),
FootnoteExtension.create(),
TaskListExtension.create(),
InsExtension.create(),
- TocExtension.create()
- ));
-
+ TypographicExtension.create(),
+ DefinitionExtension.create(),
+ AbbreviationExtension.create(),
+ })).set(HtmlRenderer.SOFT_BREAK, " \n");
PARSER = Parser.builder(OPTIONS).build();
HTML_RENDERER = HtmlRenderer.builder(OPTIONS).build();
}
From 95330f45a976693b2e9323c40fe0c717f8d12a32 Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Thu, 17 Oct 2024 17:15:38 +0800
Subject: [PATCH 092/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/main/java/com/achobeta/template/util/MarkdownUtil.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/main/java/com/achobeta/template/util/MarkdownUtil.java b/src/main/java/com/achobeta/template/util/MarkdownUtil.java
index 758a6d86..ce3d8ed2 100644
--- a/src/main/java/com/achobeta/template/util/MarkdownUtil.java
+++ b/src/main/java/com/achobeta/template/util/MarkdownUtil.java
@@ -6,8 +6,11 @@
import com.vladsch.flexmark.ext.definition.DefinitionExtension;
import com.vladsch.flexmark.ext.footnotes.FootnoteExtension;
import com.vladsch.flexmark.ext.gfm.strikethrough.StrikethroughExtension;
+import com.vladsch.flexmark.ext.gfm.strikethrough.StrikethroughSubscriptExtension;
+import com.vladsch.flexmark.ext.gfm.strikethrough.SubscriptExtension;
import com.vladsch.flexmark.ext.gfm.tasklist.TaskListExtension;
import com.vladsch.flexmark.ext.ins.InsExtension;
+import com.vladsch.flexmark.ext.superscript.SuperscriptExtension;
import com.vladsch.flexmark.ext.tables.TablesExtension;
import com.vladsch.flexmark.ext.toc.TocExtension;
import com.vladsch.flexmark.ext.typographic.TypographicExtension;
@@ -43,7 +46,8 @@ public class MarkdownUtil {
TocExtension.create(),
TablesExtension.create(),
AutolinkExtension.create(),
- StrikethroughExtension.create(),
+ SuperscriptExtension.create(),
+ StrikethroughSubscriptExtension.create(),
FootnoteExtension.create(),
TaskListExtension.create(),
InsExtension.create(),
From 922552f5436ec425cf259966c95cea4d1bf8fe28 Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Thu, 17 Oct 2024 17:15:52 +0800
Subject: [PATCH 093/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/main/java/com/achobeta/template/util/MarkdownUtil.java | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/main/java/com/achobeta/template/util/MarkdownUtil.java b/src/main/java/com/achobeta/template/util/MarkdownUtil.java
index ce3d8ed2..3aaaa458 100644
--- a/src/main/java/com/achobeta/template/util/MarkdownUtil.java
+++ b/src/main/java/com/achobeta/template/util/MarkdownUtil.java
@@ -5,9 +5,7 @@
import com.vladsch.flexmark.ext.autolink.AutolinkExtension;
import com.vladsch.flexmark.ext.definition.DefinitionExtension;
import com.vladsch.flexmark.ext.footnotes.FootnoteExtension;
-import com.vladsch.flexmark.ext.gfm.strikethrough.StrikethroughExtension;
import com.vladsch.flexmark.ext.gfm.strikethrough.StrikethroughSubscriptExtension;
-import com.vladsch.flexmark.ext.gfm.strikethrough.SubscriptExtension;
import com.vladsch.flexmark.ext.gfm.tasklist.TaskListExtension;
import com.vladsch.flexmark.ext.ins.InsExtension;
import com.vladsch.flexmark.ext.superscript.SuperscriptExtension;
From f5443fe4d6ad873f5f387d64c1f8dc0fef7114d9 Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Thu, 17 Oct 2024 21:34:35 +0800
Subject: [PATCH 094/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../impl/InterviewQuestionScoreServiceImpl.java | 10 +++++++---
.../message/service/impl/MessageServiceImpl.java | 8 +++++---
.../service/impl/PaperQuestionLinkServiceImpl.java | 2 ++
.../ext/RemoveQuestionFromPaperPQLinkHandler.java | 2 +-
.../model/condition/allmatch/StatusCondition.java | 5 ++---
.../model/condition/anymatch/GradeCondition.java | 5 ++---
.../model/condition/anymatch/UserIdCondition.java | 5 ++---
.../impl/ActivityParticipationServiceImpl.java | 3 +++
.../service/impl/InterviewScheduleServiceImpl.java | 5 +++--
.../service/impl/InterviewerServiceImpl.java | 2 ++
.../student/service/impl/StuResumeServiceImpl.java | 2 ++
.../achobeta/email/provider/EmailSenderProvider.java | 12 ++++--------
src/main/java/com/achobeta/util/ObjectUtil.java | 4 ++++
.../evaluate/ext/InterviewQuestionScoreExtMapper.xml | 2 +-
.../evaluate/ext/InterviewSummaryExtMapper.xml | 4 ++--
15 files changed, 42 insertions(+), 29 deletions(-)
diff --git a/src/main/java/com/achobeta/domain/evaluate/service/impl/InterviewQuestionScoreServiceImpl.java b/src/main/java/com/achobeta/domain/evaluate/service/impl/InterviewQuestionScoreServiceImpl.java
index 58214554..4e314f25 100644
--- a/src/main/java/com/achobeta/domain/evaluate/service/impl/InterviewQuestionScoreServiceImpl.java
+++ b/src/main/java/com/achobeta/domain/evaluate/service/impl/InterviewQuestionScoreServiceImpl.java
@@ -14,9 +14,11 @@
import com.achobeta.domain.question.model.vo.QuestionVO;
import com.achobeta.redis.lock.RedisLock;
import com.achobeta.redis.lock.strategy.SimpleLockStrategy;
+import com.achobeta.util.ObjectUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
@@ -67,9 +69,11 @@ public List getQuestionScoresByInterviewId(Long intervie
@Override
public List getAverageQuestions(List questionIds) {
- return Optional.ofNullable(questionIds)
- .map(ids -> interviewQuestionScoreMapper.getAverageQuestions(questionIds))
- .orElseGet(ArrayList::new);
+ questionIds = ObjectUtil.distinctNonNullStream(questionIds).toList();
+ if(CollectionUtils.isEmpty(questionIds)) {
+ return new ArrayList<>();
+ }
+ return interviewQuestionScoreMapper.getAverageQuestions(questionIds);
}
@Override
diff --git a/src/main/java/com/achobeta/domain/message/service/impl/MessageServiceImpl.java b/src/main/java/com/achobeta/domain/message/service/impl/MessageServiceImpl.java
index 4821c7a6..3a289c2b 100644
--- a/src/main/java/com/achobeta/domain/message/service/impl/MessageServiceImpl.java
+++ b/src/main/java/com/achobeta/domain/message/service/impl/MessageServiceImpl.java
@@ -25,7 +25,10 @@
import org.springframework.util.CollectionUtils;
import org.springframework.web.multipart.MultipartFile;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Objects;
import java.util.concurrent.CopyOnWriteArraySet;
/**
@@ -61,8 +64,7 @@ public QueryStuListVO queryStuListByCondition(QueryStuListDTO queryStuDTO) {
@Override
public List queryStuList(Long batchId, List userIds) {
- List stuIds = Optional.ofNullable(userIds).stream().flatMap(Collection::stream).distinct().filter(Objects::nonNull).toList();
- List stuResumeList = stuResumeService.queryStuList(batchId, stuIds);
+ List stuResumeList = stuResumeService.queryStuList(batchId, userIds);
return messageConverter.stuResumeListToStuBaseInfoDTOList(stuResumeList);
}
diff --git a/src/main/java/com/achobeta/domain/paper/service/impl/PaperQuestionLinkServiceImpl.java b/src/main/java/com/achobeta/domain/paper/service/impl/PaperQuestionLinkServiceImpl.java
index f8f9841f..85cc55e3 100644
--- a/src/main/java/com/achobeta/domain/paper/service/impl/PaperQuestionLinkServiceImpl.java
+++ b/src/main/java/com/achobeta/domain/paper/service/impl/PaperQuestionLinkServiceImpl.java
@@ -13,6 +13,7 @@
import com.achobeta.exception.GlobalServiceException;
import com.achobeta.redis.lock.RedisLock;
import com.achobeta.redis.lock.strategy.SimpleLockStrategy;
+import com.achobeta.util.ObjectUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
@@ -81,6 +82,7 @@ public void addQuestionsForPaper(Long paperId, List questionIds) {
@Override
public void removeQuestionsFromPaper(Long paperId, List questionIds) {
+ questionIds = ObjectUtil.distinctNonNullStream(questionIds).toList();
if(!CollectionUtils.isEmpty(questionIds)) {
this.lambdaUpdate()
.eq(PaperQuestionLink::getPaperId, paperId)
diff --git a/src/main/java/com/achobeta/domain/recruit/handler/ext/RemoveQuestionFromPaperPQLinkHandler.java b/src/main/java/com/achobeta/domain/recruit/handler/ext/RemoveQuestionFromPaperPQLinkHandler.java
index d0014805..61a8eff7 100644
--- a/src/main/java/com/achobeta/domain/recruit/handler/ext/RemoveQuestionFromPaperPQLinkHandler.java
+++ b/src/main/java/com/achobeta/domain/recruit/handler/ext/RemoveQuestionFromPaperPQLinkHandler.java
@@ -28,7 +28,7 @@ public class RemoveQuestionFromPaperPQLinkHandler extends RemoveQuestionFromPape
@Override
public void handle(Long paperId, List questionIds) {
List participationIds = activityParticipationService.getParticipationIdsByPaperId(paperId);
- if(!CollectionUtils.isEmpty(participationIds)) {
+ if(!CollectionUtils.isEmpty(participationIds) && !CollectionUtils.isEmpty(questionIds)) {
// 删除对应的行
participationQuestionLinkService.lambdaUpdate()
.in(ParticipationQuestionLink::getParticipationId, participationIds)
diff --git a/src/main/java/com/achobeta/domain/recruit/model/condition/allmatch/StatusCondition.java b/src/main/java/com/achobeta/domain/recruit/model/condition/allmatch/StatusCondition.java
index ee796a67..d075ab78 100644
--- a/src/main/java/com/achobeta/domain/recruit/model/condition/allmatch/StatusCondition.java
+++ b/src/main/java/com/achobeta/domain/recruit/model/condition/allmatch/StatusCondition.java
@@ -2,9 +2,9 @@
import com.achobeta.domain.recruit.model.condition.function.StudentCondition;
import com.achobeta.domain.student.model.entity.StuResume;
+import com.achobeta.util.ObjectUtil;
import java.util.ArrayList;
-import java.util.Objects;
import java.util.function.Predicate;
/**
@@ -18,8 +18,7 @@ public class StatusCondition extends ArrayList implements StudentCondit
@Override
public Predicate predicate() {
- return stuResume -> this.stream()
- .filter(Objects::nonNull)
+ return stuResume -> ObjectUtil.distinctNonNullStream(this)
.anyMatch(status -> status.equals(stuResume.getStatus().getCode()));
}
diff --git a/src/main/java/com/achobeta/domain/recruit/model/condition/anymatch/GradeCondition.java b/src/main/java/com/achobeta/domain/recruit/model/condition/anymatch/GradeCondition.java
index b9e5fddf..8bd56780 100644
--- a/src/main/java/com/achobeta/domain/recruit/model/condition/anymatch/GradeCondition.java
+++ b/src/main/java/com/achobeta/domain/recruit/model/condition/anymatch/GradeCondition.java
@@ -2,9 +2,9 @@
import com.achobeta.domain.recruit.model.condition.function.StudentCondition;
import com.achobeta.domain.student.model.entity.StuResume;
+import com.achobeta.util.ObjectUtil;
import java.util.ArrayList;
-import java.util.Objects;
import java.util.function.Predicate;
/**
@@ -18,8 +18,7 @@ public class GradeCondition extends ArrayList implements StudentConditi
@Override
public Predicate predicate() {
- return stuResume -> this.stream()
- .filter(Objects::nonNull)
+ return stuResume -> ObjectUtil.distinctNonNullStream(this)
.anyMatch(grade -> grade.equals(stuResume.getGrade()));
}
}
diff --git a/src/main/java/com/achobeta/domain/recruit/model/condition/anymatch/UserIdCondition.java b/src/main/java/com/achobeta/domain/recruit/model/condition/anymatch/UserIdCondition.java
index 54953fbb..bdb2c5fe 100644
--- a/src/main/java/com/achobeta/domain/recruit/model/condition/anymatch/UserIdCondition.java
+++ b/src/main/java/com/achobeta/domain/recruit/model/condition/anymatch/UserIdCondition.java
@@ -2,9 +2,9 @@
import com.achobeta.domain.recruit.model.condition.function.StudentCondition;
import com.achobeta.domain.student.model.entity.StuResume;
+import com.achobeta.util.ObjectUtil;
import java.util.ArrayList;
-import java.util.Objects;
import java.util.function.Predicate;
/**
@@ -18,8 +18,7 @@ public class UserIdCondition extends ArrayList implements StudentCondition
@Override
public Predicate predicate() {
- return stuResume -> this.stream()
- .filter(Objects::nonNull)
+ return stuResume -> ObjectUtil.distinctNonNullStream(this)
.anyMatch(userId -> userId.equals(stuResume.getUserId()));
}
}
diff --git a/src/main/java/com/achobeta/domain/recruit/service/impl/ActivityParticipationServiceImpl.java b/src/main/java/com/achobeta/domain/recruit/service/impl/ActivityParticipationServiceImpl.java
index 67036178..247e3252 100644
--- a/src/main/java/com/achobeta/domain/recruit/service/impl/ActivityParticipationServiceImpl.java
+++ b/src/main/java/com/achobeta/domain/recruit/service/impl/ActivityParticipationServiceImpl.java
@@ -14,6 +14,7 @@
import com.achobeta.redis.lock.RedisLock;
import com.achobeta.redis.lock.strategy.ReadLockStrategy;
import com.achobeta.redis.lock.strategy.SimpleLockStrategy;
+import com.achobeta.util.ObjectUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
@@ -103,6 +104,7 @@ public List getParticipationIdsByPaperId(Long paperId) {
@Override
public List getParticipationPeriods(List participationIds) {
+ participationIds = ObjectUtil.distinctNonNullStream(participationIds).toList();
if(CollectionUtils.isEmpty(participationIds)) {
return new ArrayList<>();
}
@@ -111,6 +113,7 @@ public List getParticipationPeriods(List participat
@Override
public List getParticipationQuestions(List participationIds) {
+ participationIds = ObjectUtil.distinctNonNullStream(participationIds).toList();
if(CollectionUtils.isEmpty(participationIds)) {
return new ArrayList<>();
}
diff --git a/src/main/java/com/achobeta/domain/schedule/service/impl/InterviewScheduleServiceImpl.java b/src/main/java/com/achobeta/domain/schedule/service/impl/InterviewScheduleServiceImpl.java
index 1f5cd44b..faa76fea 100644
--- a/src/main/java/com/achobeta/domain/schedule/service/impl/InterviewScheduleServiceImpl.java
+++ b/src/main/java/com/achobeta/domain/schedule/service/impl/InterviewScheduleServiceImpl.java
@@ -31,6 +31,7 @@
import com.achobeta.exception.GlobalServiceException;
import com.achobeta.redis.lock.RedisLock;
import com.achobeta.redis.lock.strategy.SimpleLockStrategy;
+import com.achobeta.util.ObjectUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lark.oapi.service.vc.v1.model.ApplyReserveRespBody;
import lombok.RequiredArgsConstructor;
@@ -121,8 +122,6 @@ public List getInterviewScheduleList(Long managerId, Interview
*/
@Override
public UserSituationVO querySituations(SituationQueryDTO situationQueryDTO) {
- List statusList = Optional.ofNullable(situationQueryDTO.getStatusList()).stream().flatMap(Collection::stream).filter(Objects::nonNull).toList();
- situationQueryDTO.setStatusList(statusList);
// periodId --> 时间段计数器
Map countMap = timePeriodService.getTimePeriodsByActId(situationQueryDTO.getActId())
.stream()
@@ -132,6 +131,8 @@ public UserSituationVO querySituations(SituationQueryDTO situationQueryDTO) {
(oldData, newData) -> newData)
);
// participationId --> 用户预约情况
+ List statusList = ObjectUtil.distinctNonNullStream(situationQueryDTO.getStatusList()).toList();
+ situationQueryDTO.setStatusList(statusList);
Map userParticipationVOMap = interviewScheduleMapper.querySituations(situationQueryDTO)
.stream()
.collect(Collectors.toMap(
diff --git a/src/main/java/com/achobeta/domain/schedule/service/impl/InterviewerServiceImpl.java b/src/main/java/com/achobeta/domain/schedule/service/impl/InterviewerServiceImpl.java
index d59a737e..584d8c48 100644
--- a/src/main/java/com/achobeta/domain/schedule/service/impl/InterviewerServiceImpl.java
+++ b/src/main/java/com/achobeta/domain/schedule/service/impl/InterviewerServiceImpl.java
@@ -6,6 +6,7 @@
import com.achobeta.domain.schedule.model.vo.ScheduleInterviewerVO;
import com.achobeta.domain.schedule.service.InterviewerService;
import com.achobeta.exception.GlobalServiceException;
+import com.achobeta.util.ObjectUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
@@ -44,6 +45,7 @@ public List getInterviewersByScheduleId(Long scheduleId) {
@Override
public List getInterviewersByScheduleIds(List scheduleIds) {
+ scheduleIds = ObjectUtil.distinctNonNullStream(scheduleIds).toList();
if(CollectionUtils.isEmpty(scheduleIds)) {
return new ArrayList<>();
}
diff --git a/src/main/java/com/achobeta/domain/student/service/impl/StuResumeServiceImpl.java b/src/main/java/com/achobeta/domain/student/service/impl/StuResumeServiceImpl.java
index cbc22604..673bce5d 100644
--- a/src/main/java/com/achobeta/domain/student/service/impl/StuResumeServiceImpl.java
+++ b/src/main/java/com/achobeta/domain/student/service/impl/StuResumeServiceImpl.java
@@ -18,6 +18,7 @@
import com.achobeta.exception.GlobalServiceException;
import com.achobeta.redis.lock.RedisLock;
import com.achobeta.redis.lock.strategy.SimpleLockStrategy;
+import com.achobeta.util.ObjectUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
@@ -236,6 +237,7 @@ public StuResume checkResumeSubmitCount(StuSimpleResumeDTO resumeDTO, Long userI
@Override
public List queryStuList(Long batchId, List userIds) {
+ userIds = ObjectUtil.distinctNonNullStream(userIds).toList();
if(CollectionUtils.isEmpty(userIds)) {
return new ArrayList<>();
}
diff --git a/src/main/java/com/achobeta/email/provider/EmailSenderProvider.java b/src/main/java/com/achobeta/email/provider/EmailSenderProvider.java
index c2942f63..fcff7b6c 100644
--- a/src/main/java/com/achobeta/email/provider/EmailSenderProvider.java
+++ b/src/main/java/com/achobeta/email/provider/EmailSenderProvider.java
@@ -3,18 +3,16 @@
import cn.hutool.extra.spring.SpringUtil;
import com.achobeta.common.enums.GlobalServiceStatusCode;
import com.achobeta.email.config.EmailSenderConfig;
-import com.achobeta.email.config.EmailSenderProperties;
import com.achobeta.email.provider.strategy.ProvideStrategy;
import com.achobeta.exception.GlobalServiceException;
+import com.achobeta.util.ObjectUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.mail.javamail.JavaMailSenderImpl;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
-import java.util.ArrayList;
import java.util.List;
-import java.util.Optional;
/**
* Created With Intellij IDEA
@@ -36,9 +34,7 @@ public class EmailSenderProvider implements InitializingBean {
@Override
public void afterPropertiesSet() throws Exception {
// 构造邮件发送器实现
- this.senderList = new ArrayList<>();
- List senders = emailSenderConfig.getSenders();
- Optional.ofNullable(senders).stream().flatMap(List::stream).forEach(sender -> {
+ this.senderList = ObjectUtil.distinctNonNullStream(emailSenderConfig.getSenders()).map(sender -> {
// 邮件发送者
JavaMailSenderImpl javaMailSender = new JavaMailSenderImpl();
javaMailSender.setHost(sender.getHost());
@@ -48,8 +44,8 @@ public void afterPropertiesSet() throws Exception {
javaMailSender.setProtocol(sender.getProtocol());
javaMailSender.setDefaultEncoding(sender.getDefaultEncoding());
javaMailSender.setJavaMailProperties(sender.getProperties());
- senderList.add(javaMailSender);
- });
+ return javaMailSender;
+ }).toList();
// 若不存在一个实现则抛出异常(启动项目时)
if(CollectionUtils.isEmpty(this.senderList)) {
throw new GlobalServiceException(GlobalServiceStatusCode.EMAIL_SENDER_NOT_EXISTS);
diff --git a/src/main/java/com/achobeta/util/ObjectUtil.java b/src/main/java/com/achobeta/util/ObjectUtil.java
index 295575d8..f87db997 100644
--- a/src/main/java/com/achobeta/util/ObjectUtil.java
+++ b/src/main/java/com/achobeta/util/ObjectUtil.java
@@ -88,4 +88,8 @@ public static void forEach(C object, Class fieldClazz, Consumer con
.forEach(consumer);
}
+ public static Stream distinctNonNullStream(Collection collection) {
+ return stream(collection).distinct().filter(Objects::nonNull);
+ }
+
}
diff --git a/src/main/resources/mapper/evaluate/ext/InterviewQuestionScoreExtMapper.xml b/src/main/resources/mapper/evaluate/ext/InterviewQuestionScoreExtMapper.xml
index d406f29a..97c36ea7 100644
--- a/src/main/resources/mapper/evaluate/ext/InterviewQuestionScoreExtMapper.xml
+++ b/src/main/resources/mapper/evaluate/ext/InterviewQuestionScoreExtMapper.xml
@@ -14,7 +14,7 @@
select
q.id, q.title, q.standard, q.create_time, q.update_time, avg(s.score) average
from question q
- left join interview_question_score s on q.id = s.question_id and s.is_deleted = 0 and q.is_deleted = 0 and s.score != -1
+ left join interview_question_score s on q.id = s.question_id and s.is_deleted = 0 and q.is_deleted = 0 and s.score >= 0
q.id is not null and q.is_deleted = 0
diff --git a/src/main/resources/mapper/evaluate/ext/InterviewSummaryExtMapper.xml b/src/main/resources/mapper/evaluate/ext/InterviewSummaryExtMapper.xml
index 2af42994..5158bc45 100644
--- a/src/main/resources/mapper/evaluate/ext/InterviewSummaryExtMapper.xml
+++ b/src/main/resources/mapper/evaluate/ext/InterviewSummaryExtMapper.xml
@@ -16,7 +16,7 @@
select
- s.id summary_id, s.basis + s.coding + s.thinking + s.express sum,
+ s.id summary_id, s.basis + s.coding + s.thinking + s.express sum, s.update_time update_time,
i.id interview_id, i.title title, i.status status,
from recruitment_batch b
@@ -36,7 +36,7 @@
and a.id = #{condition.actId,jdbcType=BIGINT}
- order by sum desc
+ order by sum desc, status desc, update_time asc
From f68e2c66033f9f89c5d739a0febe51284da942d5 Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Thu, 17 Oct 2024 22:11:32 +0800
Subject: [PATCH 095/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../{IsAccessible.java => Accessible.java} | 6 ++--
.../common/annotation/MobilePhone.java | 27 ++++++++++++++++++
...alidator.java => AccessibleValidator.java} | 4 +--
.../handler/MobilePhoneValidator.java | 28 +++++++++++++++++++
.../model/dto/InterviewSummaryDTO.java | 4 +--
.../domain/login/model/dto/SmsLoginDTO.java | 4 +--
.../InterviewScheduleController.java | 4 +--
.../controller/ShortLinkController.java | 4 +--
.../student/model/dto/StuSimpleResumeDTO.java | 3 +-
9 files changed, 70 insertions(+), 14 deletions(-)
rename src/main/java/com/achobeta/common/annotation/{IsAccessible.java => Accessible.java} (80%)
create mode 100644 src/main/java/com/achobeta/common/annotation/MobilePhone.java
rename src/main/java/com/achobeta/common/annotation/handler/{IsAccessibleValidator.java => AccessibleValidator.java} (86%)
create mode 100644 src/main/java/com/achobeta/common/annotation/handler/MobilePhoneValidator.java
diff --git a/src/main/java/com/achobeta/common/annotation/IsAccessible.java b/src/main/java/com/achobeta/common/annotation/Accessible.java
similarity index 80%
rename from src/main/java/com/achobeta/common/annotation/IsAccessible.java
rename to src/main/java/com/achobeta/common/annotation/Accessible.java
index c8321048..cd3a03a7 100644
--- a/src/main/java/com/achobeta/common/annotation/IsAccessible.java
+++ b/src/main/java/com/achobeta/common/annotation/Accessible.java
@@ -1,6 +1,6 @@
package com.achobeta.common.annotation;
-import com.achobeta.common.annotation.handler.IsAccessibleValidator;
+import com.achobeta.common.annotation.handler.AccessibleValidator;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;
@@ -14,10 +14,10 @@
* Time: 23:50
*/
@Documented
-@Constraint(validatedBy = {IsAccessibleValidator.class})
+@Constraint(validatedBy = {AccessibleValidator.class})
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER, ElementType.TYPE_USE})
@Retention(RetentionPolicy.RUNTIME)
-public @interface IsAccessible {
+public @interface Accessible {
String message() default "url 无法访问"; // 默认消息
diff --git a/src/main/java/com/achobeta/common/annotation/MobilePhone.java b/src/main/java/com/achobeta/common/annotation/MobilePhone.java
new file mode 100644
index 00000000..5cf8ac13
--- /dev/null
+++ b/src/main/java/com/achobeta/common/annotation/MobilePhone.java
@@ -0,0 +1,27 @@
+package com.achobeta.common.annotation;
+
+import com.achobeta.common.annotation.handler.MobilePhoneValidator;
+import jakarta.validation.Constraint;
+import jakarta.validation.Payload;
+
+import java.lang.annotation.*;
+
+/**
+ * Created With Intellij IDEA
+ * Description:
+ * User: 马拉圈
+ * Date: 2024-10-17
+ * Time: 21:59
+ */
+@Documented
+@Constraint(validatedBy = {MobilePhoneValidator.class})
+@Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER, ElementType.TYPE_USE})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface MobilePhone {
+
+ String message() default "手机号非法"; // 默认消息
+
+ Class>[] groups() default {}; // 分组校验
+
+ Class extends Payload>[] payload() default {}; // 负载信息
+}
diff --git a/src/main/java/com/achobeta/common/annotation/handler/IsAccessibleValidator.java b/src/main/java/com/achobeta/common/annotation/handler/AccessibleValidator.java
similarity index 86%
rename from src/main/java/com/achobeta/common/annotation/handler/IsAccessibleValidator.java
rename to src/main/java/com/achobeta/common/annotation/handler/AccessibleValidator.java
index 485a4f68..393917b3 100644
--- a/src/main/java/com/achobeta/common/annotation/handler/IsAccessibleValidator.java
+++ b/src/main/java/com/achobeta/common/annotation/handler/AccessibleValidator.java
@@ -1,6 +1,6 @@
package com.achobeta.common.annotation.handler;
-import com.achobeta.common.annotation.IsAccessible;
+import com.achobeta.common.annotation.Accessible;
import com.achobeta.util.HttpRequestUtil;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;
@@ -10,7 +10,7 @@
import java.util.Optional;
@Slf4j
-public class IsAccessibleValidator implements ConstraintValidator {
+public class AccessibleValidator implements ConstraintValidator {
@Override
public boolean isValid(String s, ConstraintValidatorContext constraintValidatorContext) {
diff --git a/src/main/java/com/achobeta/common/annotation/handler/MobilePhoneValidator.java b/src/main/java/com/achobeta/common/annotation/handler/MobilePhoneValidator.java
new file mode 100644
index 00000000..94bd15f5
--- /dev/null
+++ b/src/main/java/com/achobeta/common/annotation/handler/MobilePhoneValidator.java
@@ -0,0 +1,28 @@
+package com.achobeta.common.annotation.handler;
+
+import com.achobeta.common.annotation.MobilePhone;
+import jakarta.validation.ConstraintValidator;
+import jakarta.validation.ConstraintValidatorContext;
+
+import java.util.Optional;
+import java.util.regex.Pattern;
+
+/**
+ * Created With Intellij IDEA
+ * Description:
+ * User: 马拉圈
+ * Date: 2024-10-17
+ * Time: 22:00
+ */
+public class MobilePhoneValidator implements ConstraintValidator {
+
+ private final static Pattern MOBILE_PHONE_PATTERN = Pattern.compile("^1[3-9]\\d{9}$");
+
+ @Override
+ public boolean isValid(String phone, ConstraintValidatorContext constraintValidatorContext) {
+ return Optional.ofNullable(phone)
+ .map(s -> MOBILE_PHONE_PATTERN.matcher(s).matches())
+ .orElse(Boolean.TRUE);
+ }
+
+}
diff --git a/src/main/java/com/achobeta/domain/evaluate/model/dto/InterviewSummaryDTO.java b/src/main/java/com/achobeta/domain/evaluate/model/dto/InterviewSummaryDTO.java
index c2793e2f..a5941986 100644
--- a/src/main/java/com/achobeta/domain/evaluate/model/dto/InterviewSummaryDTO.java
+++ b/src/main/java/com/achobeta/domain/evaluate/model/dto/InterviewSummaryDTO.java
@@ -1,7 +1,7 @@
package com.achobeta.domain.evaluate.model.dto;
+import com.achobeta.common.annotation.Accessible;
import com.achobeta.common.annotation.IntRange;
-import com.achobeta.common.annotation.IsAccessible;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
@@ -44,7 +44,7 @@ public class InterviewSummaryDTO {
private String suggest;
// @NotBlank(message = "回放不能为空")
- @IsAccessible(message = "回放链接不可访问")
+ @Accessible(message = "回放链接不可访问")
private String playback;
}
diff --git a/src/main/java/com/achobeta/domain/login/model/dto/SmsLoginDTO.java b/src/main/java/com/achobeta/domain/login/model/dto/SmsLoginDTO.java
index 99dc0eb2..492e7f93 100644
--- a/src/main/java/com/achobeta/domain/login/model/dto/SmsLoginDTO.java
+++ b/src/main/java/com/achobeta/domain/login/model/dto/SmsLoginDTO.java
@@ -1,7 +1,7 @@
package com.achobeta.domain.login.model.dto;
+import com.achobeta.common.annotation.MobilePhone;
import jakarta.validation.constraints.NotBlank;
-import jakarta.validation.constraints.Pattern;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
@@ -25,7 +25,7 @@ public class SmsLoginDTO implements Serializable {
* 手机号
*/
@NotBlank(message = "手机号不能为空")
- @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号非法")
+ @MobilePhone
private String phoneNumber;
/**
diff --git a/src/main/java/com/achobeta/domain/schedule/controller/InterviewScheduleController.java b/src/main/java/com/achobeta/domain/schedule/controller/InterviewScheduleController.java
index 8261f478..8529a910 100644
--- a/src/main/java/com/achobeta/domain/schedule/controller/InterviewScheduleController.java
+++ b/src/main/java/com/achobeta/domain/schedule/controller/InterviewScheduleController.java
@@ -2,6 +2,7 @@
import com.achobeta.common.SystemJsonResponse;
import com.achobeta.common.annotation.Intercept;
+import com.achobeta.common.annotation.MobilePhone;
import com.achobeta.common.enums.UserTypeEnum;
import com.achobeta.domain.interview.model.dto.InterviewConditionDTO;
import com.achobeta.domain.interview.model.vo.InterviewReserveVO;
@@ -22,7 +23,6 @@
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
-import jakarta.validation.constraints.Pattern;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
@@ -172,7 +172,7 @@ public SystemJsonResponse getParticipationDetail(@PathVariable("participationId"
@GetMapping("/reserve/{scheduleId}")
public SystemJsonResponse interviewReserveApply(@PathVariable("scheduleId") @NotNull Long scheduleId,
@RequestParam("title") @NotBlank(message = "标题不能为空") String title,
- @RequestParam(name = "mobile", required = false) @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号非法") String mobile) {
+ @RequestParam(name = "mobile", required = false) @MobilePhone String mobile) {
// 检查
interviewScheduleService.checkInterviewScheduleExists(scheduleId);
// 当前管理员
diff --git a/src/main/java/com/achobeta/domain/shortlink/controller/ShortLinkController.java b/src/main/java/com/achobeta/domain/shortlink/controller/ShortLinkController.java
index d5fb70c8..5f3d0b72 100644
--- a/src/main/java/com/achobeta/domain/shortlink/controller/ShortLinkController.java
+++ b/src/main/java/com/achobeta/domain/shortlink/controller/ShortLinkController.java
@@ -1,8 +1,8 @@
package com.achobeta.domain.shortlink.controller;
import com.achobeta.common.SystemJsonResponse;
+import com.achobeta.common.annotation.Accessible;
import com.achobeta.common.annotation.Intercept;
-import com.achobeta.common.annotation.IsAccessible;
import com.achobeta.common.enums.UserTypeEnum;
import com.achobeta.domain.shortlink.model.dto.ShortLinkQueryDTO;
import com.achobeta.domain.shortlink.model.vo.ShortLinkQueryVO;
@@ -51,7 +51,7 @@ public RedirectView getShortLink(@PathVariable("code") @NotBlank String code) {
*/
@PostMapping("/trans")
public SystemJsonResponse transferAndSaveShortLink(HttpServletRequest request,
- @RequestParam("url") @NotBlank @IsAccessible(message = "链接不可访问") String url) {
+ @RequestParam("url") @NotBlank @Accessible(message = "链接不可访问") String url) {
// 转化
String shortLinkURL = shortLinkService.transShortLinkURL(request, url);
log.info("原链接:{} -> 短链接:{}", url, shortLinkURL);
diff --git a/src/main/java/com/achobeta/domain/student/model/dto/StuSimpleResumeDTO.java b/src/main/java/com/achobeta/domain/student/model/dto/StuSimpleResumeDTO.java
index 59658c8a..7b90253f 100644
--- a/src/main/java/com/achobeta/domain/student/model/dto/StuSimpleResumeDTO.java
+++ b/src/main/java/com/achobeta/domain/student/model/dto/StuSimpleResumeDTO.java
@@ -1,6 +1,7 @@
package com.achobeta.domain.student.model.dto;
import com.achobeta.common.annotation.IntRange;
+import com.achobeta.common.annotation.MobilePhone;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
@@ -45,7 +46,7 @@ public class StuSimpleResumeDTO implements Serializable {
private String email;
@NotBlank(message = "手机号不能为空")
- @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号非法")
+ @MobilePhone
private String phoneNumber;
@NotBlank(message = "加入ab理由不能为空")
From 7a1275a3da7df4a51426f660d1286fa623f22292 Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Fri, 18 Oct 2024 00:20:50 +0800
Subject: [PATCH 096/104] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=B8=80?=
=?UTF-8?q?=E4=B8=AA=20bug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../evaluate/service/impl/InterviewSummaryServiceImpl.java | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/main/java/com/achobeta/domain/evaluate/service/impl/InterviewSummaryServiceImpl.java b/src/main/java/com/achobeta/domain/evaluate/service/impl/InterviewSummaryServiceImpl.java
index fd4a3656..ffe7bd09 100644
--- a/src/main/java/com/achobeta/domain/evaluate/service/impl/InterviewSummaryServiceImpl.java
+++ b/src/main/java/com/achobeta/domain/evaluate/service/impl/InterviewSummaryServiceImpl.java
@@ -65,6 +65,8 @@ public void summaryInterview(InterviewSummaryDTO interviewSummaryDTO) {
getInterviewSummaryByInterviewId(interviewId).map(InterviewSummary::getId).ifPresentOrElse(summaryId -> {
this.lambdaUpdate()
.eq(InterviewSummary::getId, summaryId)
+ .set(InterviewSummary::getPlayback, Optional.ofNullable(interviewSummary.getPlayback()).orElse(""))
+ .set(InterviewSummary::getSuggest, Optional.ofNullable(interviewSummary.getSuggest()).orElse(""))
.update(interviewSummary);
}, () -> {
this.save(interviewSummary);
From bbd7f4ad1c51f6a8a13e01142a4699b0407acaf9 Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Fri, 18 Oct 2024 16:49:59 +0800
Subject: [PATCH 097/104] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=B8=80?=
=?UTF-8?q?=E4=B8=AA=20bug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../domain/paper/controller/PaperLibraryController.java | 2 ++
.../domain/question/controller/QuestionLibraryController.java | 2 ++
2 files changed, 4 insertions(+)
diff --git a/src/main/java/com/achobeta/domain/paper/controller/PaperLibraryController.java b/src/main/java/com/achobeta/domain/paper/controller/PaperLibraryController.java
index 20ec0aad..682bb666 100644
--- a/src/main/java/com/achobeta/domain/paper/controller/PaperLibraryController.java
+++ b/src/main/java/com/achobeta/domain/paper/controller/PaperLibraryController.java
@@ -45,6 +45,8 @@ public SystemJsonResponse createPaperLibrary(@RequestParam("libType") @NotBlank
@PostMapping("/reference")
public SystemJsonResponse referencePapers(@Valid @RequestBody LibraryReferencePaperDTO libraryReferencePaperDTO) {
+ Long libId = libraryReferencePaperDTO.getLibId();
+ questionPaperLibraryService.checkPaperLibraryExists(libId);
// 引用
questionPaperService.referencePapers(libraryReferencePaperDTO.getLibId(), libraryReferencePaperDTO.getPaperIds());
return SystemJsonResponse.SYSTEM_SUCCESS();
diff --git a/src/main/java/com/achobeta/domain/question/controller/QuestionLibraryController.java b/src/main/java/com/achobeta/domain/question/controller/QuestionLibraryController.java
index 03bf1c28..ee253f51 100644
--- a/src/main/java/com/achobeta/domain/question/controller/QuestionLibraryController.java
+++ b/src/main/java/com/achobeta/domain/question/controller/QuestionLibraryController.java
@@ -45,6 +45,8 @@ public SystemJsonResponse createQuestionLibrary(@RequestParam("libType") @NotBla
@PostMapping("/reference")
public SystemJsonResponse referenceQuestions(@Valid @RequestBody LibraryReferenceQuestionDTO libraryReferenceQuestionDTO) {
+ Long libId = libraryReferenceQuestionDTO.getLibId();
+ questionLibraryService.checkQuestionLibraryExists(libId);
// 引用
questionService.referenceQuestions(libraryReferenceQuestionDTO.getLibId(), libraryReferenceQuestionDTO.getQuestionIds());
return SystemJsonResponse.SYSTEM_SUCCESS();
From d3e253ed579af6cc3212d1116c86f15fee870c74 Mon Sep 17 00:00:00 2001
From: "s:103" <2040484356@qq.com>
Date: Sat, 19 Oct 2024 11:40:45 +0800
Subject: [PATCH 098/104] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../achobeta/common/annotation/HttpUrl.java | 27 ++++++++++++++++
.../annotation/handler/HttpUrlValidator.java | 27 ++++++++++++++++
.../model/dto/InterviewSummaryDTO.java | 3 +-
.../achobeta/template/util/MarkdownUtil.java | 32 ++++++++++++++++++-
.../templates/interview-experience-model.html | 4 +--
5 files changed, 89 insertions(+), 4 deletions(-)
create mode 100644 src/main/java/com/achobeta/common/annotation/HttpUrl.java
create mode 100644 src/main/java/com/achobeta/common/annotation/handler/HttpUrlValidator.java
diff --git a/src/main/java/com/achobeta/common/annotation/HttpUrl.java b/src/main/java/com/achobeta/common/annotation/HttpUrl.java
new file mode 100644
index 00000000..3eddd77e
--- /dev/null
+++ b/src/main/java/com/achobeta/common/annotation/HttpUrl.java
@@ -0,0 +1,27 @@
+package com.achobeta.common.annotation;
+
+import com.achobeta.common.annotation.handler.AccessibleValidator;
+import jakarta.validation.Constraint;
+import jakarta.validation.Payload;
+
+import java.lang.annotation.*;
+
+/**
+ * Created With Intellij IDEA
+ * Description:
+ * User: 马拉圈
+ * Date: 2024-10-19
+ * Time: 11:35
+ */
+@Documented
+@Constraint(validatedBy = {AccessibleValidator.class})
+@Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER, ElementType.TYPE_USE})
+@Retention(RetentionPolicy.RUNTIME)
+public @interface HttpUrl {
+
+ String message() default "链接非法"; // 默认消息
+
+ Class>[] groups() default {}; // 分组校验
+
+ Class extends Payload>[] payload() default {}; // 负载信息
+}
diff --git a/src/main/java/com/achobeta/common/annotation/handler/HttpUrlValidator.java b/src/main/java/com/achobeta/common/annotation/handler/HttpUrlValidator.java
new file mode 100644
index 00000000..cec25d8b
--- /dev/null
+++ b/src/main/java/com/achobeta/common/annotation/handler/HttpUrlValidator.java
@@ -0,0 +1,27 @@
+package com.achobeta.common.annotation.handler;
+
+import com.achobeta.common.annotation.HttpUrl;
+import jakarta.validation.ConstraintValidator;
+import jakarta.validation.ConstraintValidatorContext;
+
+import java.util.Optional;
+import java.util.regex.Pattern;
+
+/**
+ * Created With Intellij IDEA
+ * Description:
+ * User: 马拉圈
+ * Date: 2024-10-19
+ * Time: 11:35
+ */
+public class HttpUrlValidator implements ConstraintValidator {
+
+ private static final Pattern HTTP_URL_PATTERN = Pattern.compile("^(?i)(http|https):(//(([^@\\[/?#]*)@)?(\\[[\\p{XDigit}:.]*[%\\p{Alnum}]*]|[^\\[/?#:]*)(:(\\{[^}]+\\}?|[^/?#]*))?)?([^?#]*)(\\?([^#]*))?(#(.*))?");
+
+ @Override
+ public boolean isValid(String url, ConstraintValidatorContext constraintValidatorContext) {
+ return Optional.ofNullable(url)
+ .map(s -> HTTP_URL_PATTERN.matcher(s).matches())
+ .orElse(Boolean.TRUE);
+ }
+}
diff --git a/src/main/java/com/achobeta/domain/evaluate/model/dto/InterviewSummaryDTO.java b/src/main/java/com/achobeta/domain/evaluate/model/dto/InterviewSummaryDTO.java
index a5941986..9da9e592 100644
--- a/src/main/java/com/achobeta/domain/evaluate/model/dto/InterviewSummaryDTO.java
+++ b/src/main/java/com/achobeta/domain/evaluate/model/dto/InterviewSummaryDTO.java
@@ -1,6 +1,7 @@
package com.achobeta.domain.evaluate.model.dto;
import com.achobeta.common.annotation.Accessible;
+import com.achobeta.common.annotation.HttpUrl;
import com.achobeta.common.annotation.IntRange;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
@@ -44,7 +45,7 @@ public class InterviewSummaryDTO {
private String suggest;
// @NotBlank(message = "回放不能为空")
- @Accessible(message = "回放链接不可访问")
+ @HttpUrl
private String playback;
}
diff --git a/src/main/java/com/achobeta/template/util/MarkdownUtil.java b/src/main/java/com/achobeta/template/util/MarkdownUtil.java
index 3aaaa458..413bbbbe 100644
--- a/src/main/java/com/achobeta/template/util/MarkdownUtil.java
+++ b/src/main/java/com/achobeta/template/util/MarkdownUtil.java
@@ -2,17 +2,28 @@
import com.vladsch.flexmark.ext.abbreviation.AbbreviationExtension;
+import com.vladsch.flexmark.ext.admonition.AdmonitionExtension;
+import com.vladsch.flexmark.ext.anchorlink.AnchorLinkExtension;
+import com.vladsch.flexmark.ext.aside.AsideExtension;
import com.vladsch.flexmark.ext.autolink.AutolinkExtension;
import com.vladsch.flexmark.ext.definition.DefinitionExtension;
+import com.vladsch.flexmark.ext.emoji.EmojiExtension;
import com.vladsch.flexmark.ext.footnotes.FootnoteExtension;
+import com.vladsch.flexmark.ext.gfm.issues.GfmIssuesExtension;
import com.vladsch.flexmark.ext.gfm.strikethrough.StrikethroughSubscriptExtension;
import com.vladsch.flexmark.ext.gfm.tasklist.TaskListExtension;
+import com.vladsch.flexmark.ext.gfm.users.GfmUsersExtension;
+import com.vladsch.flexmark.ext.gitlab.GitLabExtension;
import com.vladsch.flexmark.ext.ins.InsExtension;
+import com.vladsch.flexmark.ext.media.tags.MediaTagsExtension;
+import com.vladsch.flexmark.ext.resizable.image.ResizableImageExtension;
import com.vladsch.flexmark.ext.superscript.SuperscriptExtension;
import com.vladsch.flexmark.ext.tables.TablesExtension;
import com.vladsch.flexmark.ext.toc.TocExtension;
import com.vladsch.flexmark.ext.typographic.TypographicExtension;
+import com.vladsch.flexmark.ext.wikilink.WikiLinkExtension;
import com.vladsch.flexmark.html.HtmlRenderer;
+import com.vladsch.flexmark.html2md.converter.FlexmarkHtmlConverter;
import com.vladsch.flexmark.parser.Parser;
import com.vladsch.flexmark.parser.ParserEmulationProfile;
import com.vladsch.flexmark.util.ast.Node;
@@ -35,26 +46,40 @@ public class MarkdownUtil {
private final static HtmlRenderer HTML_RENDERER;
+ private final static FlexmarkHtmlConverter HTML_CONVERTER;
+
static {
OPTIONS = new MutableDataSet()
// 指定 Markdown 标准为 COMMONMARK(使用 ParserEmulationProfile.MARKDOWN 可能会有一些语法失效!)
.setFrom(ParserEmulationProfile.COMMONMARK)
.set(Parser.EXTENSIONS, List.of(new Parser.ParserExtension[]{
- // 设置一些常见的扩展
+ // 设置一些常扩展
TocExtension.create(),
TablesExtension.create(),
+ AbbreviationExtension.create(),
AutolinkExtension.create(),
+ AnchorLinkExtension.create(),
+ AsideExtension.create(),
+ AdmonitionExtension.create(),
+ GfmIssuesExtension.create(),
+ GfmUsersExtension.create(),
SuperscriptExtension.create(),
StrikethroughSubscriptExtension.create(),
+ GitLabExtension.create(),
FootnoteExtension.create(),
TaskListExtension.create(),
InsExtension.create(),
TypographicExtension.create(),
DefinitionExtension.create(),
AbbreviationExtension.create(),
+ ResizableImageExtension.create(),
+ MediaTagsExtension.create(),
+ EmojiExtension.create(),
+ WikiLinkExtension.create(),
})).set(HtmlRenderer.SOFT_BREAK, " \n");
PARSER = Parser.builder(OPTIONS).build();
HTML_RENDERER = HtmlRenderer.builder(OPTIONS).build();
+ HTML_CONVERTER = FlexmarkHtmlConverter.builder(OPTIONS).build();
}
public static String markdownToHtml(String markdown) {
@@ -64,4 +89,9 @@ public static String markdownToHtml(String markdown) {
return HTML_RENDERER.render(document);
}
+ public static String htmlToMarkdown(String html) {
+ // 将 HTML 转化为 Markdown
+ return HTML_CONVERTER.convert(html);
+ }
+
}
diff --git a/src/main/resources/templates/interview-experience-model.html b/src/main/resources/templates/interview-experience-model.html
index bdc63846..20480f96 100644
--- a/src/main/resources/templates/interview-experience-model.html
+++ b/src/main/resources/templates/interview-experience-model.html
@@ -30,8 +30,8 @@
-