diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
index 3018bff..38ff681 100644
--- a/.idea/inspectionProfiles/Project_Default.xml
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -32,5 +32,12 @@
+
\ No newline at end of file
diff --git a/backend-main/backend-web/pom.xml b/backend-main/backend-web/pom.xml
index 694d298..54e75bb 100644
--- a/backend-main/backend-web/pom.xml
+++ b/backend-main/backend-web/pom.xml
@@ -40,6 +40,11 @@
spring-cloud-starter-openfeign
${feign.version}
+
+ org.springframework.boot
+ spring-boot-configuration-processor
+ true
+
cn.wustlinghang.wusthelper
@@ -64,10 +69,10 @@
-
- org.graalvm.buildtools
- native-maven-plugin
-
+
+
+
+
org.springframework.boot
spring-boot-maven-plugin
diff --git a/backend-main/backend-web/src/main/java/wusthelper/WebBackendMain.java b/backend-main/backend-web/src/main/java/wusthelper/WebBackendMain.java
index aa37ac8..cccba7b 100644
--- a/backend-main/backend-web/src/main/java/wusthelper/WebBackendMain.java
+++ b/backend-main/backend-web/src/main/java/wusthelper/WebBackendMain.java
@@ -9,13 +9,13 @@ import org.springframework.scheduling.annotation.EnableScheduling;
@EnableAsync
@EnableScheduling
-@EnableFeignClients(basePackages = {"cn.wustlinghang.wusthelper.web.rpc"})
+@EnableFeignClients(basePackages = {"wusthelper.web.rpc"})
@SpringBootApplication(scanBasePackages = {
// 指定springboot的bean扫描路径,有新增请及时更新
- "cn.wustlinghang.wusthelper.data",
- "cn.wustlinghang.wusthelper.web",
+ "wusthelper.data",
+ "wusthelper.web",
})
-@MapperScan("cn.wustlinghang.wusthelper.data.dao.mapper")
+@MapperScan("wusthelper.data.dao.mapper")
public class WebBackendMain {
public static void main(String[] args) {
SpringApplication.run(WebBackendMain.class);
diff --git a/backend-main/backend-web/src/main/java/wusthelper/web/api/v2/Token.java b/backend-main/backend-web/src/main/java/wusthelper/web/api/v2/TokenTool.java
similarity index 98%
rename from backend-main/backend-web/src/main/java/wusthelper/web/api/v2/Token.java
rename to backend-main/backend-web/src/main/java/wusthelper/web/api/v2/TokenTool.java
index 0f1772f..ba9a7f1 100644
--- a/backend-main/backend-web/src/main/java/wusthelper/web/api/v2/Token.java
+++ b/backend-main/backend-web/src/main/java/wusthelper/web/api/v2/TokenTool.java
@@ -9,7 +9,7 @@ import java.time.Duration;
import java.util.Date;
@Slf4j
-public class Token {
+public class TokenTool {
private final static String SECRET = "LingHangStudio.WustHelper";
diff --git a/backend-main/backend-web/src/main/java/wusthelper/web/api/v2/dto/response/CombineLoginResponse.java b/backend-main/backend-web/src/main/java/wusthelper/web/api/v2/dto/response/CombineLoginResponse.java
new file mode 100644
index 0000000..b6aa63b
--- /dev/null
+++ b/backend-main/backend-web/src/main/java/wusthelper/web/api/v2/dto/response/CombineLoginResponse.java
@@ -0,0 +1,12 @@
+package wusthelper.web.api.v2.dto.response;
+
+import cn.wustlinghang.mywust.data.global.Course;
+
+import java.util.List;
+
+public record CombineLoginResponse(
+ String token,
+ List courses,
+ StudentInfoResponse studentInfoResponse
+) {
+}
diff --git a/backend-main/backend-web/src/main/java/wusthelper/web/api/v2/dto/response/CourseResponse.java b/backend-main/backend-web/src/main/java/wusthelper/web/api/v2/dto/response/CourseResponse.java
new file mode 100644
index 0000000..b90f844
--- /dev/null
+++ b/backend-main/backend-web/src/main/java/wusthelper/web/api/v2/dto/response/CourseResponse.java
@@ -0,0 +1,55 @@
+package wusthelper.web.api.v2.dto.response;
+
+import cn.wustlinghang.mywust.data.global.Course;
+import lombok.Data;
+
+@Data
+public class CourseResponse {
+ /**
+ * 课程名称
+ */
+ private String className;
+ /**
+ * 教学班
+ */
+ private String teachClass;
+ /**
+ * 教师
+ */
+ private String teacher;
+ /**
+ * 开始周次
+ */
+ private Integer startWeek;
+ /**
+ * 结束周
+ */
+ private Integer endWeek;
+ /**
+ * 节数
+ */
+ private Integer section;
+ /**
+ * 星期
+ */
+ private Integer weekDay;
+ /**
+ * 教室
+ */
+ private String classroom;
+
+ public static CourseResponse from(Course course) {
+ CourseResponse courseResponse = new CourseResponse();
+ courseResponse.setClassName(course.getName());
+ courseResponse.setTeachClass(course.getTeachClass());
+ courseResponse.setTeacher(course.getTeacher());
+ courseResponse.setStartWeek(course.getStartWeek());
+ courseResponse.setEndWeek(course.getEndWeek());
+ courseResponse.setSection((course.getStartSection() + 1) / 2);
+ courseResponse.setWeekDay(course.getWeekDay());
+ courseResponse.setClassroom(course.getClassroom().getRoom());
+
+ return courseResponse;
+
+ }
+}
diff --git a/backend-main/backend-web/src/main/java/wusthelper/web/api/v2/dto/response/ScoreResponse.java b/backend-main/backend-web/src/main/java/wusthelper/web/api/v2/dto/response/ScoreResponse.java
new file mode 100644
index 0000000..bac8220
--- /dev/null
+++ b/backend-main/backend-web/src/main/java/wusthelper/web/api/v2/dto/response/ScoreResponse.java
@@ -0,0 +1,128 @@
+package wusthelper.web.api.v2.dto.response;
+
+import cn.wustlinghang.mywust.data.global.Score;
+import lombok.Data;
+import wusthelper.web.util.StringUtil;
+
+@Data
+public class ScoreResponse {
+ /**
+ * 课程编号
+ */
+ private String courseNum;
+ /**
+ * 课程名称
+ */
+ private String courseName;
+ /**
+ * 成绩
+ */
+ private String grade;
+ /**
+ * 学分
+ */
+ private Float courseCredit;
+ /**
+ * 总学时
+ */
+ private Float courseHours;
+ /**
+ * 绩点
+ */
+ private Float gradePoint;
+ /**
+ * 考核方式
+ */
+ private String evaluationMode;
+ /**
+ * 考试性质
+ */
+ private String examNature;
+ /**
+ * 课程性质
+ */
+ private String courseNature;
+ /**
+ * 开课学期
+ */
+ private String schoolTerm;
+ /**
+ * 重修标记 0--未重修 1--重修
+ */
+ private Integer rebuildTag;
+ /**
+ * 补考标记 0--正常考试 1--补考
+ */
+ private Integer reExamTag;
+ /**
+ * 缺考/缓考标记 0--正常 1--缺考 2--缓考
+ */
+ private Integer missExamTag;
+
+ public static ScoreResponse from(Score score) {
+ ScoreResponse scoreResponse = new ScoreResponse();
+ scoreResponse.setCourseNum(score.getCourseName());
+ scoreResponse.setCourseName(score.getCourseName());
+ scoreResponse.setGrade(score.getScore());
+ //学分
+ if ("".equals(score.getCredit())) {
+ scoreResponse.setCourseCredit(0.0F);
+ } else {
+ scoreResponse.setCourseCredit(Float.parseFloat(score.getCredit()));
+ }
+
+ //总学时
+ if ("".equals(score.getCourseHours())) {
+ scoreResponse.setCourseHours(0.0F);
+ } else {
+ scoreResponse.setCourseHours(Float.parseFloat(score.getCourseHours()));
+ }
+
+ //绩点
+ if (StringUtil.isPositiveNumber(score.getGradePoint())) {
+ scoreResponse.setGradePoint(Float.parseFloat(score.getGradePoint()));
+ } else {
+ scoreResponse.setGradePoint(convertGradePoint(score.getScore()));
+ }
+
+ scoreResponse.setEvaluationMode(score.getEvaluateMethod());
+ scoreResponse.setExamNature(score.getKind());
+ scoreResponse.setCourseNature(score.getCourseKind());
+ scoreResponse.setSchoolTerm(score.getTerm());
+// scoreResponse.setRebuildTag();
+// scoreResponse.setReExamTag();
+// scoreResponse.setMissExamTag();
+ //补考判断 0--正常考试 1--补考
+
+ scoreResponse.setReExamTag(0);
+ if (score.getFlag().contains("补考") || score.getKind().contains("补考")) {
+ scoreResponse.setReExamTag(1);
+ }
+ //缓考/缺考判断 0--正常 1--缺考 2--缓考
+ scoreResponse.setMissExamTag(0);
+ if (score.getFlag().contains("缺考") || score.getKind().contains("缺考")) {
+ scoreResponse.setMissExamTag(1);
+ }
+ if (score.getFlag().contains("缓考") || score.getKind().contains("缓考")) {
+ scoreResponse.setMissExamTag(2);
+ }
+
+ scoreResponse.setRebuildTag(0);
+
+ return scoreResponse;
+ }
+
+ /**
+ * 转换成绩为学分,支持数字成绩和等级成绩
+ *
+ * @param gradeStr 成绩字符串
+ * @return 换算后的学分
+ */
+ private static float convertGradePoint(String gradeStr) {
+ if (StringUtil.isPositiveNumber(gradeStr)) {
+ return StringUtil.numberGradeToGradePoint(gradeStr);
+ } else {
+ return StringUtil.levelGradeToGradePoint(gradeStr);
+ }
+ }
+}
diff --git a/backend-main/backend-web/src/main/java/wusthelper/web/api/v2/dto/response/StudentInfoResponse.java b/backend-main/backend-web/src/main/java/wusthelper/web/api/v2/dto/response/StudentInfoResponse.java
new file mode 100644
index 0000000..b5f5b1e
--- /dev/null
+++ b/backend-main/backend-web/src/main/java/wusthelper/web/api/v2/dto/response/StudentInfoResponse.java
@@ -0,0 +1,31 @@
+package wusthelper.web.api.v2.dto.response;
+
+import cn.wustlinghang.mywust.data.global.StudentInfo;
+import lombok.Data;
+
+@Data
+public class StudentInfoResponse {
+ private String stuNum;
+
+ private String stuName;
+
+ private String nickName;
+
+ private String college;
+
+ private String major;
+
+ private String classes;
+
+ public static StudentInfoResponse from(StudentInfo studentInfo) {
+ StudentInfoResponse studentInfoResponse = new StudentInfoResponse();
+ studentInfoResponse.setStuNum(studentInfo.getStudentNumber());
+ studentInfoResponse.setStuName(studentInfo.getName());
+ studentInfoResponse.setNickName("");
+ studentInfoResponse.setCollege(studentInfo.getCollege());
+ studentInfoResponse.setMajor(studentInfo.getMajor());
+ studentInfoResponse.setClasses(studentInfo.getClazz());
+
+ return studentInfoResponse;
+ }
+}
\ No newline at end of file
diff --git a/backend-main/backend-web/src/main/java/wusthelper/web/api/v2/handler/GlobalExceptionHandler.java b/backend-main/backend-web/src/main/java/wusthelper/web/api/v2/handler/GlobalExceptionHandler.java
new file mode 100644
index 0000000..41ac441
--- /dev/null
+++ b/backend-main/backend-web/src/main/java/wusthelper/web/api/v2/handler/GlobalExceptionHandler.java
@@ -0,0 +1,127 @@
+package wusthelper.web.api.v2.handler;
+
+import cn.wustlinghang.mywust.exception.ApiException;
+import cn.wustlinghang.mywust.exception.ParseException;
+import com.fasterxml.jackson.databind.JsonMappingException;
+import feign.FeignException;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.http.converter.HttpMessageNotReadableException;
+import org.springframework.web.HttpMediaTypeNotSupportedException;
+import org.springframework.web.HttpRequestMethodNotSupportedException;
+import org.springframework.web.bind.MissingServletRequestParameterException;
+import org.springframework.web.bind.annotation.ControllerAdvice;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException;
+import wusthelper.code.ServiceCode;
+import wusthelper.web.exception.ServiceException;
+import wusthelper.web.response.Response;
+
+@Slf4j
+@ControllerAdvice
+public class GlobalExceptionHandler {
+ @ResponseBody
+ @ExceptionHandler(ServiceException.class)
+ public Response