From be03878e9467bd7f93cc2dbd97a0c4dc526def0c Mon Sep 17 00:00:00 2001 From: lensferno Date: Sat, 15 Jul 2023 12:09:19 +0800 Subject: [PATCH] aaa --- .idea/encodings.xml | 8 +- README.md | 49 +++++++++ backend-main/{web => backend-data}/.gitignore | 0 backend-main/{web => backend-data}/pom.xml | 18 +-- .../main/java/cn/wustlinghang/data}/Main.java | 2 +- .../{web => backend-web}/.flattened-pom.xml | 82 +++++++------- backend-main/backend-web/.gitignore | 38 +++++++ backend-main/backend-web/pom.xml | 98 +++++++++++++++++ backend-main/pom.xml | 3 +- .../src/main/java/cn/wustlinghang/Main.java | 7 -- .../rpc}/exception/GraduateRpcException.java | 4 +- .../rpc}/exception/LibraryRpcException.java | 10 +- .../rpc}/exception/PhysicsRpcException.java | 4 +- .../rpc/exception/RpcException.java | 2 +- .../rpc}/exception/UndergradRpcException.java | 8 +- .../rpc/response/ResponseCode.java | 104 +++++++----------- .../rpc/response/RpcResponse.java | 2 +- .../{ => internal}/rpc/util/EnumUtil.java | 2 +- .../wusthelper/rpc/request/RpcRequest.java | 20 ---- external-library/mywust | 2 +- pom.xml | 2 +- .../internal/graduate/api/http/CookieApi.java | 2 +- .../graduate/api/http/CourseTableApi.java | 2 +- .../internal/graduate/api/http/ScoreApi.java | 2 +- .../graduate/api/http/StudentInfoApi.java | 2 +- .../graduate/api/http/TrainingPlanApi.java | 2 +- .../http/handler/BaseExceptionHandler.java | 4 +- .../http/handler/DefaultExceptionHandler.java | 2 +- .../api/http/handler/IOExceptionHandler.java | 2 +- .../http/handler/ParseExceptionHandler.java | 2 +- .../api/http/handler/RpcExceptionHandler.java | 2 +- .../handler/ValidationExceptionHandler.java | 2 +- .../WebApplicationExceptionHandler.java | 4 +- .../ResponseWrapperInterceptor.java | 2 +- .../graduate/services/BaseService.java | 2 +- .../graduate/services/CourseTableService.java | 4 +- .../graduate/services/LoginService.java | 3 +- .../graduate/services/ScoreService.java | 4 +- .../graduate/services/StudentInfoService.java | 4 +- .../services/TrainingPlanService.java | 4 +- sub-services/library/.flattened-pom.xml | 4 +- .../library/api/http/BookCoverImageApi.java | 2 +- .../library/api/http/BookDetailApi.java | 2 +- .../library/api/http/BookHoldingApi.java | 2 +- .../internal/library/api/http/CookieApi.java | 2 +- .../library/api/http/CurrentLoanApi.java | 2 +- .../library/api/http/LoanHistoryApi.java | 3 +- .../library/api/http/OverdueSoonApi.java | 2 +- .../internal/library/api/http/SearchApi.java | 2 +- .../http/handler/BaseExceptionHandler.java | 4 +- .../http/handler/DefaultExceptionHandler.java | 2 +- .../api/http/handler/IOExceptionHandler.java | 2 +- .../http/handler/ParseExceptionHandler.java | 2 +- .../api/http/handler/RpcExceptionHandler.java | 2 +- .../handler/ValidationExceptionHandler.java | 2 +- .../WebApplicationExceptionHandler.java | 4 +- .../ResponseWrapperInterceptor.java | 2 +- .../library/bean/MywustRequestAgentBeans.java | 2 +- .../library/services/BaseService.java | 10 +- .../services/BookCoverImageUrlService.java | 12 +- .../library/services/BookDetailService.java | 8 +- .../library/services/BookHoldingService.java | 10 +- .../library/services/CurrentLoanService.java | 10 +- .../library/services/LoanHistoryService.java | 11 +- .../library/services/LoginService.java | 2 +- .../library/services/OverdueSoonService.java | 10 +- .../library/services/ParseService.java | 8 -- .../library/services/SearchService.java | 10 +- .../internal/physics/api/http/CookieApi.java | 2 +- .../physics/api/http/CourseTableApi.java | 2 +- .../internal/physics/api/http/ScoreApi.java | 2 +- .../http/handler/BaseExceptionHandler.java | 4 +- .../http/handler/DefaultExceptionHandler.java | 2 +- .../api/http/handler/IOExceptionHandler.java | 2 +- .../http/handler/ParseExceptionHandler.java | 2 +- .../api/http/handler/RpcExceptionHandler.java | 2 +- .../handler/ValidationExceptionHandler.java | 2 +- .../WebApplicationExceptionHandler.java | 4 +- .../ResponseWrapperInterceptor.java | 2 +- .../physics/services/BaseService.java | 2 +- .../physics/services/CourseTableService.java | 4 +- .../physics/services/LoginService.java | 2 +- .../physics/services/ScoreService.java | 4 +- sub-services/pom.xml | 2 +- .../undergrad/api/http/CookieApi.java | 2 +- .../undergrad/api/http/CourseTableApi.java | 2 +- .../undergrad/api/http/CreditStatusApi.java | 2 +- .../undergrad/api/http/ExamActivitiesApi.java | 2 +- .../api/http/ExamDelayApplicationApi.java | 2 +- .../internal/undergrad/api/http/ScoreApi.java | 2 +- .../undergrad/api/http/StudentInfoApi.java | 2 +- .../undergrad/api/http/TrainingPlanApi.java | 2 +- .../http/handler/BaseExceptionHandler.java | 4 +- .../http/handler/DefaultExceptionHandler.java | 2 +- .../api/http/handler/IOExceptionHandler.java | 2 +- .../http/handler/ParseExceptionHandler.java | 2 +- .../api/http/handler/RpcExceptionHandler.java | 2 +- .../handler/ValidationExceptionHandler.java | 2 +- .../WebApplicationExceptionHandler.java | 4 +- .../ResponseWrapperInterceptor.java | 2 +- .../undergrad/services/BaseService.java | 2 +- .../services/CourseTableService.java | 4 +- .../services/CreditStatusService.java | 4 +- .../services/ExamActivitiesService.java | 4 +- .../services/ExamDelayApplicationService.java | 4 +- .../undergrad/services/LoginService.java | 2 +- .../undergrad/services/ScoreService.java | 4 +- .../services/StudentInfoService.java | 4 +- .../services/TrainingPlanService.java | 4 +- 109 files changed, 431 insertions(+), 327 deletions(-) create mode 100644 README.md rename backend-main/{web => backend-data}/.gitignore (100%) rename backend-main/{web => backend-data}/pom.xml (50%) rename backend-main/{src/main/java/cn/wustlinghang => backend-data/src/main/java/cn/wustlinghang/data}/Main.java (78%) rename backend-main/{web => backend-web}/.flattened-pom.xml (97%) create mode 100644 backend-main/backend-web/.gitignore create mode 100644 backend-main/backend-web/pom.xml delete mode 100644 backend-main/web/src/main/java/cn/wustlinghang/Main.java rename {sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate => common/src/main/java/cn/wustlinghang/wusthelper/internal/rpc}/exception/GraduateRpcException.java (92%) rename {sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library => common/src/main/java/cn/wustlinghang/wusthelper/internal/rpc}/exception/LibraryRpcException.java (87%) rename {sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics => common/src/main/java/cn/wustlinghang/wusthelper/internal/rpc}/exception/PhysicsRpcException.java (92%) rename common/src/main/java/cn/wustlinghang/wusthelper/{ => internal}/rpc/exception/RpcException.java (94%) rename {sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad => common/src/main/java/cn/wustlinghang/wusthelper/internal/rpc}/exception/UndergradRpcException.java (89%) rename common/src/main/java/cn/wustlinghang/wusthelper/{ => internal}/rpc/response/ResponseCode.java (74%) rename common/src/main/java/cn/wustlinghang/wusthelper/{ => internal}/rpc/response/RpcResponse.java (90%) rename common/src/main/java/cn/wustlinghang/wusthelper/{ => internal}/rpc/util/EnumUtil.java (73%) delete mode 100644 common/src/main/java/cn/wustlinghang/wusthelper/rpc/request/RpcRequest.java delete mode 100644 sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/ParseService.java diff --git a/.idea/encodings.xml b/.idea/encodings.xml index f4e9c15..894ba69 100644 --- a/.idea/encodings.xml +++ b/.idea/encodings.xml @@ -1,10 +1,14 @@ + + + + + + - - diff --git a/README.md b/README.md new file mode 100644 index 0000000..8b2863e --- /dev/null +++ b/README.md @@ -0,0 +1,49 @@ +# Wusthelper-backend + +武科大助手后端项目 + +应该是第三代后端了吧。 + +新的重写过的后端,其实在这版正式出来之前已经有很多个实验性的原型版本了,但是都因为效果不如意胎死腹中给砍了,没有继续写下去(其实这个readme也是曾经最早的一个原型版本改来的) + +这代后端结构与前面的有很大不同,使用了真·多模块的方式运行部署,部分独立模块以不同的程序运行,子模块部署在内网时,可以自动注册frpc进行服务远程转发,主服务和子服务通过http进行通信调用,各模块可以部署在不同的服务器或容器中,当然,也可以挤在一起跑。 + +因为基于http的json通信,因此可以跨语言语言进行调用这些子服务,若某个模块使用某种语言有比较大的优势(如网关服务可用go或node等进行开发),可以尝试直接用其他语言进行替换,只需要开发时遵循文档即可 +~~(虽然现在并没有什么文档之类的(但是以后会补上来的啦))~~。 + +当某模块更新或下线时,可以在不重启整个项目的情况下进行更新,同时如果有多个实例部署,可及时切换到可用节点上,从而避免整个项目的完全重启而导致服务完全中断,只要对外api网关模块仍在运行,就可使用仍在运行的模块继续提供一定的服务,提高可用性,同时由于各个模块被拆分,因此相较于以前更为轻量,在模块更新或重启时也能更快的恢复服务 + +该项目意在探索新技术,同时提高后端服务的可用性 + +@lensferno + +--- + +## 环境要求 + +包管理和构建: +Maven 3.8.2+ +- 后续可能会看情况转用Gradle + +Java版本: +Java 17+ + +--- + +## 项目模块结构 + +### agent-service + +--- + +## 关于Mywust库的导入问题 + +--- + +## 文档 + +详见[doc](/doc) + +--- + +就先这样吧,手累了 \ No newline at end of file diff --git a/backend-main/web/.gitignore b/backend-main/backend-data/.gitignore similarity index 100% rename from backend-main/web/.gitignore rename to backend-main/backend-data/.gitignore diff --git a/backend-main/web/pom.xml b/backend-main/backend-data/pom.xml similarity index 50% rename from backend-main/web/pom.xml rename to backend-main/backend-data/pom.xml index 4ba8d4d..15ca3e0 100644 --- a/backend-main/web/pom.xml +++ b/backend-main/backend-data/pom.xml @@ -6,29 +6,15 @@ cn.wustlinghang.wusthelper backend-main - ${revision} + 0.0.1-SNAPSHOT - web + backend-data 17 17 UTF-8 - - 3.1.1 - - - - - org.springframework.boot - spring-boot-dependencies - ${springboot.version} - pom - import - - - \ No newline at end of file diff --git a/backend-main/src/main/java/cn/wustlinghang/Main.java b/backend-main/backend-data/src/main/java/cn/wustlinghang/data/Main.java similarity index 78% rename from backend-main/src/main/java/cn/wustlinghang/Main.java rename to backend-main/backend-data/src/main/java/cn/wustlinghang/data/Main.java index 5841a4a..87fe5b7 100644 --- a/backend-main/src/main/java/cn/wustlinghang/Main.java +++ b/backend-main/backend-data/src/main/java/cn/wustlinghang/data/Main.java @@ -1,4 +1,4 @@ -package cn.wustlinghang; +package cn.wustlinghang.data; public class Main { public static void main(String[] args) { diff --git a/backend-main/web/.flattened-pom.xml b/backend-main/backend-web/.flattened-pom.xml similarity index 97% rename from backend-main/web/.flattened-pom.xml rename to backend-main/backend-web/.flattened-pom.xml index 5ea72be..c493442 100644 --- a/backend-main/web/.flattened-pom.xml +++ b/backend-main/backend-web/.flattened-pom.xml @@ -1,41 +1,41 @@ - - - 4.0.0 - cn.wustlinghang.wusthelper - web - 0.0.1-SNAPSHOT - - - jakarta.annotation - jakarta.annotation-api - 2.1.1 - compile - - - javax.annotation - javax.annotation-api - 1.3.2 - compile - - - org.projectlombok - lombok - 1.18.26 - provided - - - - - central - https://repo1.maven.org/maven2 - - - - true - - github - https://maven.pkg.github.com/LingHangStudio/mywust - - - + + + 4.0.0 + cn.wustlinghang.wusthelper + web + 0.0.1-SNAPSHOT + + + jakarta.annotation + jakarta.annotation-api + 2.1.1 + compile + + + javax.annotation + javax.annotation-api + 1.3.2 + compile + + + org.projectlombok + lombok + 1.18.26 + provided + + + + + central + https://repo1.maven.org/maven2 + + + + true + + github + https://maven.pkg.github.com/LingHangStudio/mywust + + + diff --git a/backend-main/backend-web/.gitignore b/backend-main/backend-web/.gitignore new file mode 100644 index 0000000..5ff6309 --- /dev/null +++ b/backend-main/backend-web/.gitignore @@ -0,0 +1,38 @@ +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### IntelliJ IDEA ### +.idea/modules.xml +.idea/jarRepositories.xml +.idea/compiler.xml +.idea/libraries/ +*.iws +*.iml +*.ipr + +### Eclipse ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ + +### Mac OS ### +.DS_Store \ No newline at end of file diff --git a/backend-main/backend-web/pom.xml b/backend-main/backend-web/pom.xml new file mode 100644 index 0000000..08a96b2 --- /dev/null +++ b/backend-main/backend-web/pom.xml @@ -0,0 +1,98 @@ + + + 4.0.0 + + cn.wustlinghang.wusthelper + backend-main + ${revision} + + + backend-web + + + 17 + 17 + UTF-8 + + 3.1.1 + 2.0 + 4.0.3 + + + + + + + org.springframework.boot + spring-boot-dependencies + ${springboot.version} + pom + import + + + + + + + + org.yaml + snakeyaml + ${snakeyaml.version} + + + + org.springframework.boot + spring-boot-starter-validation + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.cloud + spring-cloud-starter-openfeign + ${feign.version} + + + + com.mysql + mysql-connector-j + runtime + + + org.projectlombok + lombok + true + provided + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.graalvm.buildtools + native-maven-plugin + + + org.springframework.boot + spring-boot-maven-plugin + + + + org.projectlombok + lombok + + + + + + + \ No newline at end of file diff --git a/backend-main/pom.xml b/backend-main/pom.xml index 40a31ca..2150a77 100644 --- a/backend-main/pom.xml +++ b/backend-main/pom.xml @@ -12,7 +12,8 @@ backend-main pom - web + backend-web + backend-data diff --git a/backend-main/web/src/main/java/cn/wustlinghang/Main.java b/backend-main/web/src/main/java/cn/wustlinghang/Main.java deleted file mode 100644 index 5841a4a..0000000 --- a/backend-main/web/src/main/java/cn/wustlinghang/Main.java +++ /dev/null @@ -1,7 +0,0 @@ -package cn.wustlinghang; - -public class Main { - public static void main(String[] args) { - System.out.println("Hello world!"); - } -} \ No newline at end of file diff --git a/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/exception/GraduateRpcException.java b/common/src/main/java/cn/wustlinghang/wusthelper/internal/rpc/exception/GraduateRpcException.java similarity index 92% rename from sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/exception/GraduateRpcException.java rename to common/src/main/java/cn/wustlinghang/wusthelper/internal/rpc/exception/GraduateRpcException.java index 55fdacb..a8518b4 100644 --- a/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/exception/GraduateRpcException.java +++ b/common/src/main/java/cn/wustlinghang/wusthelper/internal/rpc/exception/GraduateRpcException.java @@ -1,6 +1,4 @@ -package cn.wustlinghang.wusthelper.internal.graduate.exception; - -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +package cn.wustlinghang.wusthelper.internal.rpc.exception; import java.util.StringJoiner; diff --git a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/exception/LibraryRpcException.java b/common/src/main/java/cn/wustlinghang/wusthelper/internal/rpc/exception/LibraryRpcException.java similarity index 87% rename from sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/exception/LibraryRpcException.java rename to common/src/main/java/cn/wustlinghang/wusthelper/internal/rpc/exception/LibraryRpcException.java index 61e49d5..9b1c3a4 100644 --- a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/exception/LibraryRpcException.java +++ b/common/src/main/java/cn/wustlinghang/wusthelper/internal/rpc/exception/LibraryRpcException.java @@ -1,6 +1,4 @@ -package cn.wustlinghang.wusthelper.internal.library.exception; - -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +package cn.wustlinghang.wusthelper.internal.rpc.exception; import java.util.StringJoiner; @@ -42,7 +40,9 @@ public class LibraryRpcException extends RpcException { * 子模块编码 */ public enum SubModuleCode { - COMMON, AUTH, PUBLIC_API, PERSONAL_API + COMMON, AUTH, + COVER_IMAGE, BOOK_DETAIL, BOOK_HOLDING, SEARCH, + CURRENT_LOAN, LOAN_HISTORY, OVERDUE_SOON, } /** @@ -62,7 +62,7 @@ public class LibraryRpcException extends RpcException { AUTH_USER_BANNED, // 用户账号禁用 AUTH_USER_DISABLED, - // 用户账号需要更改 + // 用户密码需要更改 AUTH_NEED_CHANGE_PASSWORD, AUTH_UNKNOWN_ERROR } diff --git a/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/exception/PhysicsRpcException.java b/common/src/main/java/cn/wustlinghang/wusthelper/internal/rpc/exception/PhysicsRpcException.java similarity index 92% rename from sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/exception/PhysicsRpcException.java rename to common/src/main/java/cn/wustlinghang/wusthelper/internal/rpc/exception/PhysicsRpcException.java index c368ff8..826e30c 100644 --- a/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/exception/PhysicsRpcException.java +++ b/common/src/main/java/cn/wustlinghang/wusthelper/internal/rpc/exception/PhysicsRpcException.java @@ -1,6 +1,4 @@ -package cn.wustlinghang.wusthelper.internal.physics.exception; - -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +package cn.wustlinghang.wusthelper.internal.rpc.exception; import java.util.StringJoiner; diff --git a/common/src/main/java/cn/wustlinghang/wusthelper/rpc/exception/RpcException.java b/common/src/main/java/cn/wustlinghang/wusthelper/internal/rpc/exception/RpcException.java similarity index 94% rename from common/src/main/java/cn/wustlinghang/wusthelper/rpc/exception/RpcException.java rename to common/src/main/java/cn/wustlinghang/wusthelper/internal/rpc/exception/RpcException.java index dedc48a..62742fe 100644 --- a/common/src/main/java/cn/wustlinghang/wusthelper/rpc/exception/RpcException.java +++ b/common/src/main/java/cn/wustlinghang/wusthelper/internal/rpc/exception/RpcException.java @@ -1,4 +1,4 @@ -package cn.wustlinghang.wusthelper.rpc.exception; +package cn.wustlinghang.wusthelper.internal.rpc.exception; public class RpcException extends RuntimeException { protected final int code; diff --git a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/exception/UndergradRpcException.java b/common/src/main/java/cn/wustlinghang/wusthelper/internal/rpc/exception/UndergradRpcException.java similarity index 89% rename from sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/exception/UndergradRpcException.java rename to common/src/main/java/cn/wustlinghang/wusthelper/internal/rpc/exception/UndergradRpcException.java index c652ff6..b48e091 100644 --- a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/exception/UndergradRpcException.java +++ b/common/src/main/java/cn/wustlinghang/wusthelper/internal/rpc/exception/UndergradRpcException.java @@ -1,6 +1,4 @@ -package cn.wustlinghang.wusthelper.internal.undergrad.exception; - -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +package cn.wustlinghang.wusthelper.internal.rpc.exception; import java.util.StringJoiner; @@ -66,9 +64,9 @@ public class UndergradRpcException extends RpcException { AUTH_USER_BANNED, // 用户账号禁用 AUTH_USER_DISABLED, - // 用户账号需要更改 + // 用户密码需要更改 AUTH_NEED_CHANGE_PASSWORD, - // 专属选课时间段账号被禁用(--> _ -->) + // 专属选课时间段账号被禁用(--> _ --) AUTH_BANNED_IN_EXCLUSIVE_TIME, AUTH_UNKNOWN_ERROR } diff --git a/common/src/main/java/cn/wustlinghang/wusthelper/rpc/response/ResponseCode.java b/common/src/main/java/cn/wustlinghang/wusthelper/internal/rpc/response/ResponseCode.java similarity index 74% rename from common/src/main/java/cn/wustlinghang/wusthelper/rpc/response/ResponseCode.java rename to common/src/main/java/cn/wustlinghang/wusthelper/internal/rpc/response/ResponseCode.java index 1c30660..d882257 100644 --- a/common/src/main/java/cn/wustlinghang/wusthelper/rpc/response/ResponseCode.java +++ b/common/src/main/java/cn/wustlinghang/wusthelper/internal/rpc/response/ResponseCode.java @@ -1,63 +1,43 @@ -/* - * Class created by lensfrex. - */ - -package cn.wustlinghang.wusthelper.rpc.response; - -public enum ResponseCode { - SUCCESS(20000, "成功"), - REQUEST_TOO_FAST(20001, "技能冷却中..."), - INVALID_REQUEST(30000, "非法请求"), - PARAM_WRONG(30001, "参数错误"), - PERMISSION_DENIED(40000, "权限不足"), - TOKEN_EXPIRED(40001, "token过期"), - TOKEN_INVALID(40002, "token无效"), - SERVER_INTERNAL_ERROR(50000, "服务器内部错误"), - API_NOT_IMPLEMENT(0, "接口未实现"), - - STUDENT_ID_DOES_NOT_EXISTS(60001,"学生学号不存在"), - USER_WAS_BANNED_PUBLISH(60201, "用户被禁止发布告示信息"), - IMAGE_FORMAT_WORN(60202, "上传的图片格式有误"), - NOTICE_WAS_INTERCEPT(60203, "消息被系统拦截发布"), - - USER_DOES_NOT_MATCH_PUBLISHER(60301, "请求用户与告示发表者不匹配"), - - REQUEST_FILE_DOES_NOT_EXIST(60701, "请求的文件不存在"); - - private final int code; - - private final String message; - - ResponseCode(int code, String message) { - this.code = code; - this.message = message; - } - - public int getCode() { - return code; - } - - public String getMessage() { - return message; - } -} - - -enum Code { - Success, Fail, Wron -} - -class Singleton { - private static Singleton instance; - - private Singleton() { - } - - public static Singleton getInstance() { - if (instance == null) { - instance = new Singleton(); - } - - return instance; - } +/* + * Class created by lensfrex. + */ + +package cn.wustlinghang.wusthelper.internal.rpc.response; + +public enum ResponseCode { + SUCCESS(20000, "成功"), + REQUEST_TOO_FAST(20001, "技能冷却中..."), + INVALID_REQUEST(30000, "非法请求"), + PARAM_WRONG(30001, "参数错误"), + PERMISSION_DENIED(40000, "权限不足"), + TOKEN_EXPIRED(40001, "token过期"), + TOKEN_INVALID(40002, "token无效"), + SERVER_INTERNAL_ERROR(50000, "服务器内部错误"), + API_NOT_IMPLEMENT(0, "接口未实现"), + + STUDENT_ID_DOES_NOT_EXISTS(60001,"学生学号不存在"), + USER_WAS_BANNED_PUBLISH(60201, "用户被禁止发布告示信息"), + IMAGE_FORMAT_WORN(60202, "上传的图片格式有误"), + NOTICE_WAS_INTERCEPT(60203, "消息被系统拦截发布"), + + USER_DOES_NOT_MATCH_PUBLISHER(60301, "请求用户与告示发表者不匹配"), + + REQUEST_FILE_DOES_NOT_EXIST(60701, "请求的文件不存在"); + + private final int code; + + private final String message; + + ResponseCode(int code, String message) { + this.code = code; + this.message = message; + } + + public int getCode() { + return code; + } + + public String getMessage() { + return message; + } } \ No newline at end of file diff --git a/common/src/main/java/cn/wustlinghang/wusthelper/rpc/response/RpcResponse.java b/common/src/main/java/cn/wustlinghang/wusthelper/internal/rpc/response/RpcResponse.java similarity index 90% rename from common/src/main/java/cn/wustlinghang/wusthelper/rpc/response/RpcResponse.java rename to common/src/main/java/cn/wustlinghang/wusthelper/internal/rpc/response/RpcResponse.java index 8d89dfa..bd394c8 100644 --- a/common/src/main/java/cn/wustlinghang/wusthelper/rpc/response/RpcResponse.java +++ b/common/src/main/java/cn/wustlinghang/wusthelper/internal/rpc/response/RpcResponse.java @@ -1,4 +1,4 @@ -package cn.wustlinghang.wusthelper.rpc.response; +package cn.wustlinghang.wusthelper.internal.rpc.response; public record RpcResponse(int code, String msg, T data) { public static RpcResponse success(T data) { diff --git a/common/src/main/java/cn/wustlinghang/wusthelper/rpc/util/EnumUtil.java b/common/src/main/java/cn/wustlinghang/wusthelper/internal/rpc/util/EnumUtil.java similarity index 73% rename from common/src/main/java/cn/wustlinghang/wusthelper/rpc/util/EnumUtil.java rename to common/src/main/java/cn/wustlinghang/wusthelper/internal/rpc/util/EnumUtil.java index 344700d..129cf4b 100644 --- a/common/src/main/java/cn/wustlinghang/wusthelper/rpc/util/EnumUtil.java +++ b/common/src/main/java/cn/wustlinghang/wusthelper/internal/rpc/util/EnumUtil.java @@ -1,4 +1,4 @@ -package cn.wustlinghang.wusthelper.rpc.util; +package cn.wustlinghang.wusthelper.internal.rpc.util; public class EnumUtil { public static > boolean equal(int value, Enum e) { diff --git a/common/src/main/java/cn/wustlinghang/wusthelper/rpc/request/RpcRequest.java b/common/src/main/java/cn/wustlinghang/wusthelper/rpc/request/RpcRequest.java deleted file mode 100644 index 9eabf59..0000000 --- a/common/src/main/java/cn/wustlinghang/wusthelper/rpc/request/RpcRequest.java +++ /dev/null @@ -1,20 +0,0 @@ -package cn.wustlinghang.wusthelper.rpc.request; - -import lombok.Data; - -import java.util.HashMap; -import java.util.Map; - -@Data -public class RpcRequest { - private final Map arg; - - public RpcRequest() { - this.arg = new HashMap<>(); - } - - public RpcRequest addArg(String key, String value) { - this.arg.put(key, value); - return this; - } -} \ No newline at end of file diff --git a/external-library/mywust b/external-library/mywust index a18aa81..965562b 160000 --- a/external-library/mywust +++ b/external-library/mywust @@ -1 +1 @@ -Subproject commit a18aa81d71123f54e959866e93c7ceb56b03ade4 +Subproject commit 965562b69e35d445fb5c58b2e2afd9cdf27d3146 diff --git a/pom.xml b/pom.xml index afb8ad4..47c81b0 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ 17 UTF-8 - 0.0.2-SNAPSHOT + 0.0.2-beta 1.18.26 5.8.20 diff --git a/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/CookieApi.java b/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/CookieApi.java index f2a7385..cdf2f9b 100644 --- a/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/CookieApi.java +++ b/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/CookieApi.java @@ -1,7 +1,7 @@ package cn.wustlinghang.wusthelper.internal.graduate.api.http; import cn.wustlinghang.wusthelper.internal.graduate.services.LoginService; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.validation.constraints.NotNull; import jakarta.ws.rs.GET; import jakarta.ws.rs.Path; diff --git a/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/CourseTableApi.java b/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/CourseTableApi.java index bccd401..664b8c1 100644 --- a/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/CourseTableApi.java +++ b/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/CourseTableApi.java @@ -2,7 +2,7 @@ package cn.wustlinghang.wusthelper.internal.graduate.api.http; import cn.wustlinghang.mywust.data.global.Course; import cn.wustlinghang.wusthelper.internal.graduate.services.CourseTableService; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.enterprise.context.ApplicationScoped; import jakarta.validation.constraints.NotNull; import jakarta.ws.rs.GET; diff --git a/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/ScoreApi.java b/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/ScoreApi.java index 15a9b74..8bc1095 100644 --- a/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/ScoreApi.java +++ b/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/ScoreApi.java @@ -2,7 +2,7 @@ package cn.wustlinghang.wusthelper.internal.graduate.api.http; import cn.wustlinghang.mywust.data.global.Score; import cn.wustlinghang.wusthelper.internal.graduate.services.ScoreService; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.enterprise.context.ApplicationScoped; import jakarta.validation.constraints.NotNull; import jakarta.ws.rs.GET; diff --git a/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/StudentInfoApi.java b/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/StudentInfoApi.java index 0d037c8..68512a9 100644 --- a/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/StudentInfoApi.java +++ b/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/StudentInfoApi.java @@ -2,7 +2,7 @@ package cn.wustlinghang.wusthelper.internal.graduate.api.http; import cn.wustlinghang.mywust.data.global.StudentInfo; import cn.wustlinghang.wusthelper.internal.graduate.services.StudentInfoService; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.enterprise.context.ApplicationScoped; import jakarta.validation.constraints.NotNull; import jakarta.ws.rs.GET; diff --git a/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/TrainingPlanApi.java b/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/TrainingPlanApi.java index ec10ece..e9247bc 100644 --- a/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/TrainingPlanApi.java +++ b/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/TrainingPlanApi.java @@ -1,7 +1,7 @@ package cn.wustlinghang.wusthelper.internal.graduate.api.http; import cn.wustlinghang.wusthelper.internal.graduate.services.TrainingPlanService; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.enterprise.context.ApplicationScoped; import jakarta.validation.constraints.NotNull; import jakarta.ws.rs.GET; diff --git a/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/handler/BaseExceptionHandler.java b/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/handler/BaseExceptionHandler.java index 90099e9..98279aa 100644 --- a/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/handler/BaseExceptionHandler.java +++ b/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/handler/BaseExceptionHandler.java @@ -1,7 +1,7 @@ package cn.wustlinghang.wusthelper.internal.graduate.api.http.handler; -import cn.wustlinghang.wusthelper.rpc.response.ResponseCode; -import cn.wustlinghang.wusthelper.rpc.response.RpcResponse; +import cn.wustlinghang.wusthelper.internal.rpc.response.ResponseCode; +import cn.wustlinghang.wusthelper.internal.rpc.response.RpcResponse; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import jakarta.ws.rs.core.MediaType; diff --git a/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/handler/DefaultExceptionHandler.java b/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/handler/DefaultExceptionHandler.java index 91517e7..3d30dd5 100644 --- a/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/handler/DefaultExceptionHandler.java +++ b/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/handler/DefaultExceptionHandler.java @@ -1,6 +1,6 @@ package cn.wustlinghang.wusthelper.internal.graduate.api.http.handler; -import cn.wustlinghang.wusthelper.rpc.response.ResponseCode; +import cn.wustlinghang.wusthelper.internal.rpc.response.ResponseCode; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.Provider; diff --git a/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/handler/IOExceptionHandler.java b/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/handler/IOExceptionHandler.java index 4a2c037..a4bc6c3 100644 --- a/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/handler/IOExceptionHandler.java +++ b/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/handler/IOExceptionHandler.java @@ -1,6 +1,6 @@ package cn.wustlinghang.wusthelper.internal.graduate.api.http.handler; -import cn.wustlinghang.wusthelper.rpc.response.ResponseCode; +import cn.wustlinghang.wusthelper.internal.rpc.response.ResponseCode; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.Provider; diff --git a/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/handler/ParseExceptionHandler.java b/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/handler/ParseExceptionHandler.java index cf2e10b..3f7c90c 100644 --- a/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/handler/ParseExceptionHandler.java +++ b/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/handler/ParseExceptionHandler.java @@ -1,7 +1,7 @@ package cn.wustlinghang.wusthelper.internal.graduate.api.http.handler; import cn.wustlinghang.mywust.exception.ParseException; -import cn.wustlinghang.wusthelper.rpc.response.ResponseCode; +import cn.wustlinghang.wusthelper.internal.rpc.response.ResponseCode; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.Provider; diff --git a/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/handler/RpcExceptionHandler.java b/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/handler/RpcExceptionHandler.java index e9da549..97f6ac6 100644 --- a/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/handler/RpcExceptionHandler.java +++ b/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/handler/RpcExceptionHandler.java @@ -1,6 +1,6 @@ package cn.wustlinghang.wusthelper.internal.graduate.api.http.handler; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.Provider; diff --git a/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/handler/ValidationExceptionHandler.java b/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/handler/ValidationExceptionHandler.java index 1a613dc..f08ab67 100644 --- a/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/handler/ValidationExceptionHandler.java +++ b/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/handler/ValidationExceptionHandler.java @@ -1,6 +1,6 @@ package cn.wustlinghang.wusthelper.internal.graduate.api.http.handler; -import cn.wustlinghang.wusthelper.rpc.response.ResponseCode; +import cn.wustlinghang.wusthelper.internal.rpc.response.ResponseCode; import jakarta.validation.ValidationException; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.ext.ExceptionMapper; diff --git a/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/handler/WebApplicationExceptionHandler.java b/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/handler/WebApplicationExceptionHandler.java index 67efa90..91482a3 100644 --- a/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/handler/WebApplicationExceptionHandler.java +++ b/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/handler/WebApplicationExceptionHandler.java @@ -1,7 +1,7 @@ package cn.wustlinghang.wusthelper.internal.graduate.api.http.handler; -import cn.wustlinghang.wusthelper.internal.graduate.exception.GraduateRpcException; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.GraduateRpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.ext.ExceptionMapper; diff --git a/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/interceptor/ResponseWrapperInterceptor.java b/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/interceptor/ResponseWrapperInterceptor.java index d885d6a..4ecf0cd 100644 --- a/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/interceptor/ResponseWrapperInterceptor.java +++ b/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/interceptor/ResponseWrapperInterceptor.java @@ -1,7 +1,7 @@ package cn.wustlinghang.wusthelper.internal.graduate.api.http.interceptor; import cn.wustlinghang.wusthelper.internal.graduate.api.http.handler.BaseExceptionHandler; -import cn.wustlinghang.wusthelper.rpc.response.RpcResponse; +import cn.wustlinghang.wusthelper.internal.rpc.response.RpcResponse; import com.fasterxml.jackson.databind.ObjectMapper; import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.core.HttpHeaders; diff --git a/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/services/BaseService.java b/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/services/BaseService.java index b429d4f..e1a4f2d 100644 --- a/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/services/BaseService.java +++ b/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/services/BaseService.java @@ -1,7 +1,7 @@ package cn.wustlinghang.wusthelper.internal.graduate.services; import cn.wustlinghang.mywust.exception.ApiException; -import cn.wustlinghang.wusthelper.internal.graduate.exception.GraduateRpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.GraduateRpcException; import lombok.extern.slf4j.Slf4j; @Slf4j diff --git a/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/services/CourseTableService.java b/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/services/CourseTableService.java index c054238..75f1cad 100644 --- a/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/services/CourseTableService.java +++ b/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/services/CourseTableService.java @@ -5,8 +5,8 @@ import cn.wustlinghang.mywust.core.request.service.graduate.GraduateCourseTableA import cn.wustlinghang.mywust.data.global.Course; import cn.wustlinghang.mywust.exception.ApiException; import cn.wustlinghang.mywust.network.RequestClientOption; -import cn.wustlinghang.wusthelper.internal.graduate.exception.GraduateRpcException; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.GraduateRpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.enterprise.context.ApplicationScoped; import java.io.IOException; diff --git a/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/services/LoginService.java b/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/services/LoginService.java index babfa3b..42e4cdf 100644 --- a/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/services/LoginService.java +++ b/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/services/LoginService.java @@ -3,10 +3,9 @@ package cn.wustlinghang.wusthelper.internal.graduate.services; import cn.wustlinghang.mywust.core.request.service.auth.GraduateLogin; import cn.wustlinghang.mywust.exception.ApiException; import cn.wustlinghang.mywust.network.RequestClientOption; -import cn.wustlinghang.wusthelper.internal.graduate.exception.GraduateRpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.GraduateRpcException; import jakarta.enterprise.context.ApplicationScoped; import lombok.extern.slf4j.Slf4j; -import org.eclipse.microprofile.config.inject.ConfigProperties; import org.eclipse.microprofile.config.inject.ConfigProperty; import java.io.IOException; diff --git a/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/services/ScoreService.java b/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/services/ScoreService.java index 2fcf478..efe438e 100644 --- a/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/services/ScoreService.java +++ b/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/services/ScoreService.java @@ -5,8 +5,8 @@ import cn.wustlinghang.mywust.core.request.service.graduate.GraduateScoreApiServ import cn.wustlinghang.mywust.data.global.Score; import cn.wustlinghang.mywust.exception.ApiException; import cn.wustlinghang.mywust.network.RequestClientOption; -import cn.wustlinghang.wusthelper.internal.graduate.exception.GraduateRpcException; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.GraduateRpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.enterprise.context.ApplicationScoped; import java.io.IOException; diff --git a/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/services/StudentInfoService.java b/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/services/StudentInfoService.java index 429cedd..e5edc94 100644 --- a/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/services/StudentInfoService.java +++ b/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/services/StudentInfoService.java @@ -5,8 +5,8 @@ import cn.wustlinghang.mywust.core.request.service.graduate.GraduateStudentInfoA import cn.wustlinghang.mywust.data.global.StudentInfo; import cn.wustlinghang.mywust.exception.ApiException; import cn.wustlinghang.mywust.network.RequestClientOption; -import cn.wustlinghang.wusthelper.internal.graduate.exception.GraduateRpcException; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.GraduateRpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.enterprise.context.ApplicationScoped; import java.io.IOException; diff --git a/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/services/TrainingPlanService.java b/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/services/TrainingPlanService.java index 908141a..4730f5e 100644 --- a/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/services/TrainingPlanService.java +++ b/sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/services/TrainingPlanService.java @@ -4,8 +4,8 @@ import cn.wustlinghang.mywust.core.parser.graduate.GraduateTrainingPlanPageParse import cn.wustlinghang.mywust.core.request.service.graduate.GraduateTrainingPlanApiService; import cn.wustlinghang.mywust.exception.ApiException; import cn.wustlinghang.mywust.network.RequestClientOption; -import cn.wustlinghang.wusthelper.internal.graduate.exception.GraduateRpcException; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.GraduateRpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.enterprise.context.ApplicationScoped; import java.io.IOException; diff --git a/sub-services/library/.flattened-pom.xml b/sub-services/library/.flattened-pom.xml index ff849b8..351cbe3 100644 --- a/sub-services/library/.flattened-pom.xml +++ b/sub-services/library/.flattened-pom.xml @@ -33,13 +33,13 @@ cn.wustlinghang.mywust mywust-core - 0.0.2-SNAPSHOT + 0.0.2-beta compile cn.wustlinghang.mywust mywust-network-okhttp - 0.0.2-SNAPSHOT + 0.0.2-beta compile diff --git a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/BookCoverImageApi.java b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/BookCoverImageApi.java index f3b11c5..dfd95cd 100644 --- a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/BookCoverImageApi.java +++ b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/BookCoverImageApi.java @@ -1,7 +1,7 @@ package cn.wustlinghang.wusthelper.internal.library.api.http; import cn.wustlinghang.wusthelper.internal.library.services.BookCoverImageUrlService; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.enterprise.context.ApplicationScoped; import jakarta.validation.constraints.NotNull; import jakarta.ws.rs.GET; diff --git a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/BookDetailApi.java b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/BookDetailApi.java index 7631cca..554cf95 100644 --- a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/BookDetailApi.java +++ b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/BookDetailApi.java @@ -2,7 +2,7 @@ package cn.wustlinghang.wusthelper.internal.library.api.http; import cn.wustlinghang.mywust.data.library.parsed.BookDetail; import cn.wustlinghang.wusthelper.internal.library.services.BookDetailService; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.enterprise.context.ApplicationScoped; import jakarta.validation.constraints.NotNull; import jakarta.ws.rs.GET; diff --git a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/BookHoldingApi.java b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/BookHoldingApi.java index e4a1687..ef3ecd0 100644 --- a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/BookHoldingApi.java +++ b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/BookHoldingApi.java @@ -2,7 +2,7 @@ package cn.wustlinghang.wusthelper.internal.library.api.http; import cn.wustlinghang.mywust.data.library.parsed.BookHolding; import cn.wustlinghang.wusthelper.internal.library.services.BookHoldingService; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.enterprise.context.ApplicationScoped; import jakarta.validation.constraints.NotNull; import jakarta.ws.rs.GET; diff --git a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/CookieApi.java b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/CookieApi.java index 5dcde27..2e996c7 100644 --- a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/CookieApi.java +++ b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/CookieApi.java @@ -1,7 +1,7 @@ package cn.wustlinghang.wusthelper.internal.library.api.http; import cn.wustlinghang.wusthelper.internal.library.services.LoginService; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.validation.constraints.NotNull; import jakarta.ws.rs.GET; import jakarta.ws.rs.Path; diff --git a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/CurrentLoanApi.java b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/CurrentLoanApi.java index 8810de8..33a75d1 100644 --- a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/CurrentLoanApi.java +++ b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/CurrentLoanApi.java @@ -3,7 +3,7 @@ package cn.wustlinghang.wusthelper.internal.library.api.http; import cn.wustlinghang.mywust.data.library.PagingResult; import cn.wustlinghang.mywust.data.library.origin.CurrentLoanBook; import cn.wustlinghang.wusthelper.internal.library.services.CurrentLoanService; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.enterprise.context.ApplicationScoped; import jakarta.validation.constraints.NotNull; import jakarta.ws.rs.DefaultValue; diff --git a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/LoanHistoryApi.java b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/LoanHistoryApi.java index c00e6d8..04dd283 100644 --- a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/LoanHistoryApi.java +++ b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/LoanHistoryApi.java @@ -1,10 +1,9 @@ package cn.wustlinghang.wusthelper.internal.library.api.http; import cn.wustlinghang.mywust.data.library.PagingResult; -import cn.wustlinghang.mywust.data.library.origin.BaseLoanBook; import cn.wustlinghang.mywust.data.library.origin.HistoryLoanBook; import cn.wustlinghang.wusthelper.internal.library.services.LoanHistoryService; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.enterprise.context.ApplicationScoped; import jakarta.validation.constraints.NotNull; import jakarta.ws.rs.DefaultValue; diff --git a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/OverdueSoonApi.java b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/OverdueSoonApi.java index 0701949..5d67f94 100644 --- a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/OverdueSoonApi.java +++ b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/OverdueSoonApi.java @@ -3,7 +3,7 @@ package cn.wustlinghang.wusthelper.internal.library.api.http; import cn.wustlinghang.mywust.data.library.PagingResult; import cn.wustlinghang.mywust.data.library.origin.BaseLoanBook; import cn.wustlinghang.wusthelper.internal.library.services.OverdueSoonService; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.enterprise.context.ApplicationScoped; import jakarta.validation.constraints.NotNull; import jakarta.ws.rs.DefaultValue; diff --git a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/SearchApi.java b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/SearchApi.java index 1c6fa6f..125f0fa 100644 --- a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/SearchApi.java +++ b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/SearchApi.java @@ -3,7 +3,7 @@ package cn.wustlinghang.wusthelper.internal.library.api.http; import cn.wustlinghang.mywust.data.library.PagingResult; import cn.wustlinghang.mywust.data.library.origin.BookSearchResult; import cn.wustlinghang.wusthelper.internal.library.services.SearchService; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.enterprise.context.ApplicationScoped; import jakarta.validation.constraints.NotNull; import jakarta.ws.rs.DefaultValue; diff --git a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/handler/BaseExceptionHandler.java b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/handler/BaseExceptionHandler.java index 6e4971c..45e8259 100644 --- a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/handler/BaseExceptionHandler.java +++ b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/handler/BaseExceptionHandler.java @@ -1,7 +1,7 @@ package cn.wustlinghang.wusthelper.internal.library.api.http.handler; -import cn.wustlinghang.wusthelper.rpc.response.ResponseCode; -import cn.wustlinghang.wusthelper.rpc.response.RpcResponse; +import cn.wustlinghang.wusthelper.internal.rpc.response.ResponseCode; +import cn.wustlinghang.wusthelper.internal.rpc.response.RpcResponse; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import jakarta.ws.rs.core.MediaType; diff --git a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/handler/DefaultExceptionHandler.java b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/handler/DefaultExceptionHandler.java index 28a065d..22bfe4f 100644 --- a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/handler/DefaultExceptionHandler.java +++ b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/handler/DefaultExceptionHandler.java @@ -1,6 +1,6 @@ package cn.wustlinghang.wusthelper.internal.library.api.http.handler; -import cn.wustlinghang.wusthelper.rpc.response.ResponseCode; +import cn.wustlinghang.wusthelper.internal.rpc.response.ResponseCode; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.Provider; diff --git a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/handler/IOExceptionHandler.java b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/handler/IOExceptionHandler.java index 3cede13..e8444e9 100644 --- a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/handler/IOExceptionHandler.java +++ b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/handler/IOExceptionHandler.java @@ -1,6 +1,6 @@ package cn.wustlinghang.wusthelper.internal.library.api.http.handler; -import cn.wustlinghang.wusthelper.rpc.response.ResponseCode; +import cn.wustlinghang.wusthelper.internal.rpc.response.ResponseCode; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.Provider; diff --git a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/handler/ParseExceptionHandler.java b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/handler/ParseExceptionHandler.java index 6886d5d..879292f 100644 --- a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/handler/ParseExceptionHandler.java +++ b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/handler/ParseExceptionHandler.java @@ -1,7 +1,7 @@ package cn.wustlinghang.wusthelper.internal.library.api.http.handler; import cn.wustlinghang.mywust.exception.ParseException; -import cn.wustlinghang.wusthelper.rpc.response.ResponseCode; +import cn.wustlinghang.wusthelper.internal.rpc.response.ResponseCode; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.Provider; diff --git a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/handler/RpcExceptionHandler.java b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/handler/RpcExceptionHandler.java index 46c8084..bd83eb4 100644 --- a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/handler/RpcExceptionHandler.java +++ b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/handler/RpcExceptionHandler.java @@ -1,6 +1,6 @@ package cn.wustlinghang.wusthelper.internal.library.api.http.handler; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.Provider; diff --git a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/handler/ValidationExceptionHandler.java b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/handler/ValidationExceptionHandler.java index 67b9559..25f4fb7 100644 --- a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/handler/ValidationExceptionHandler.java +++ b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/handler/ValidationExceptionHandler.java @@ -1,6 +1,6 @@ package cn.wustlinghang.wusthelper.internal.library.api.http.handler; -import cn.wustlinghang.wusthelper.rpc.response.ResponseCode; +import cn.wustlinghang.wusthelper.internal.rpc.response.ResponseCode; import jakarta.validation.ValidationException; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.ext.ExceptionMapper; diff --git a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/handler/WebApplicationExceptionHandler.java b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/handler/WebApplicationExceptionHandler.java index 95ee7ef..9600689 100644 --- a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/handler/WebApplicationExceptionHandler.java +++ b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/handler/WebApplicationExceptionHandler.java @@ -1,7 +1,7 @@ package cn.wustlinghang.wusthelper.internal.library.api.http.handler; -import cn.wustlinghang.wusthelper.internal.library.exception.LibraryRpcException; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.LibraryRpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.ext.ExceptionMapper; diff --git a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/interceptor/ResponseWrapperInterceptor.java b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/interceptor/ResponseWrapperInterceptor.java index aa4591a..5ce4fcc 100644 --- a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/interceptor/ResponseWrapperInterceptor.java +++ b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/interceptor/ResponseWrapperInterceptor.java @@ -1,7 +1,7 @@ package cn.wustlinghang.wusthelper.internal.library.api.http.interceptor; import cn.wustlinghang.wusthelper.internal.library.api.http.handler.BaseExceptionHandler; -import cn.wustlinghang.wusthelper.rpc.response.RpcResponse; +import cn.wustlinghang.wusthelper.internal.rpc.response.RpcResponse; import com.fasterxml.jackson.databind.ObjectMapper; import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.core.HttpHeaders; diff --git a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/bean/MywustRequestAgentBeans.java b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/bean/MywustRequestAgentBeans.java index ebc0b5b..c2132c5 100644 --- a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/bean/MywustRequestAgentBeans.java +++ b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/bean/MywustRequestAgentBeans.java @@ -16,7 +16,7 @@ public class MywustRequestAgentBeans { .port(8080) .build(); RequestClientOption option = new RequestClientOption(); - option.setProxy(proxy); +// option.setProxy(proxy); return option; } diff --git a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/BaseService.java b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/BaseService.java index 9dce075..dc0a8ae 100644 --- a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/BaseService.java +++ b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/BaseService.java @@ -1,17 +1,9 @@ package cn.wustlinghang.wusthelper.internal.library.services; -import cn.wustlinghang.mywust.data.library.parsed.BookHolding; import cn.wustlinghang.mywust.exception.ApiException; -import cn.wustlinghang.wusthelper.internal.library.exception.LibraryRpcException; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.JsonDeserializer; +import cn.wustlinghang.wusthelper.internal.rpc.exception.LibraryRpcException; import lombok.extern.slf4j.Slf4j; -import java.io.IOException; -import java.util.List; - @Slf4j public abstract class BaseService { protected LibraryRpcException wrapApiException(ApiException e, LibraryRpcException.SubModuleCode subModuleCode) { diff --git a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/BookCoverImageUrlService.java b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/BookCoverImageUrlService.java index 6d303d6..f737a12 100644 --- a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/BookCoverImageUrlService.java +++ b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/BookCoverImageUrlService.java @@ -2,8 +2,8 @@ package cn.wustlinghang.wusthelper.internal.library.services; import cn.wustlinghang.mywust.core.request.service.library.BookCoverImageUrlApiService; import cn.wustlinghang.mywust.exception.ApiException; -import cn.wustlinghang.wusthelper.internal.library.exception.LibraryRpcException; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.LibraryRpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.enterprise.context.ApplicationScoped; import java.io.IOException; @@ -22,11 +22,11 @@ public class BookCoverImageUrlService extends BaseService { try { return api.getBookCoverImageUrl(isbn); } catch (ApiException e) { - throw wrapApiException(e, LibraryRpcException.SubModuleCode.PUBLIC_API); + throw wrapApiException(e, LibraryRpcException.SubModuleCode.COVER_IMAGE); } catch (IOException e) { throw new LibraryRpcException( LibraryRpcException.TypeCode.NETWORK_EXCEPTION, - LibraryRpcException.SubModuleCode.PUBLIC_API, + LibraryRpcException.SubModuleCode.COVER_IMAGE, LibraryRpcException.ErrorCode.NETWORK_ERROR ); } @@ -36,11 +36,11 @@ public class BookCoverImageUrlService extends BaseService { try { return api.getBookCoverImageUrl(isbnList); } catch (ApiException e) { - throw wrapApiException(e, LibraryRpcException.SubModuleCode.PUBLIC_API); + throw wrapApiException(e, LibraryRpcException.SubModuleCode.COVER_IMAGE); } catch (IOException e) { throw new LibraryRpcException( LibraryRpcException.TypeCode.NETWORK_EXCEPTION, - LibraryRpcException.SubModuleCode.PUBLIC_API, + LibraryRpcException.SubModuleCode.COVER_IMAGE, LibraryRpcException.ErrorCode.NETWORK_ERROR ); } diff --git a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/BookDetailService.java b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/BookDetailService.java index 370b9f3..609b5b6 100644 --- a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/BookDetailService.java +++ b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/BookDetailService.java @@ -3,8 +3,8 @@ package cn.wustlinghang.wusthelper.internal.library.services; import cn.wustlinghang.mywust.core.request.service.library.BookDetailApiService; import cn.wustlinghang.mywust.data.library.parsed.BookDetail; import cn.wustlinghang.mywust.exception.ApiException; -import cn.wustlinghang.wusthelper.internal.library.exception.LibraryRpcException; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.LibraryRpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.enterprise.context.ApplicationScoped; import java.io.IOException; @@ -21,11 +21,11 @@ public class BookDetailService extends BaseService { try { return api.getBookDetail(bookId); } catch (ApiException e) { - throw wrapApiException(e, LibraryRpcException.SubModuleCode.PUBLIC_API); + throw wrapApiException(e, LibraryRpcException.SubModuleCode.BOOK_DETAIL); } catch (IOException e) { throw new LibraryRpcException( LibraryRpcException.TypeCode.NETWORK_EXCEPTION, - LibraryRpcException.SubModuleCode.PUBLIC_API, + LibraryRpcException.SubModuleCode.BOOK_DETAIL, LibraryRpcException.ErrorCode.NETWORK_ERROR ); } diff --git a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/BookHoldingService.java b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/BookHoldingService.java index 20bfa34..46ea3a4 100644 --- a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/BookHoldingService.java +++ b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/BookHoldingService.java @@ -4,8 +4,8 @@ import cn.wustlinghang.mywust.core.request.service.library.BookHoldingApiService import cn.wustlinghang.mywust.data.library.parsed.BookHolding; import cn.wustlinghang.mywust.exception.ApiException; import cn.wustlinghang.mywust.exception.ParseException; -import cn.wustlinghang.wusthelper.internal.library.exception.LibraryRpcException; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.LibraryRpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.enterprise.context.ApplicationScoped; import java.io.IOException; @@ -24,17 +24,17 @@ public class BookHoldingService extends BaseService { try { return api.getHoldingList(id); } catch (ApiException e) { - throw wrapApiException(e, LibraryRpcException.SubModuleCode.PERSONAL_API); + throw wrapApiException(e, LibraryRpcException.SubModuleCode.BOOK_HOLDING); } catch (IOException e) { throw new LibraryRpcException( LibraryRpcException.TypeCode.NETWORK_EXCEPTION, - LibraryRpcException.SubModuleCode.PERSONAL_API, + LibraryRpcException.SubModuleCode.BOOK_HOLDING, LibraryRpcException.ErrorCode.NETWORK_ERROR ); } catch (ParseException e) { throw new LibraryRpcException( LibraryRpcException.TypeCode.PARSE_EXCEPTION, - LibraryRpcException.SubModuleCode.PERSONAL_API, + LibraryRpcException.SubModuleCode.BOOK_HOLDING, LibraryRpcException.ErrorCode.PARSE_ERROR ); } diff --git a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/CurrentLoanService.java b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/CurrentLoanService.java index 950c84a..a4682e2 100644 --- a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/CurrentLoanService.java +++ b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/CurrentLoanService.java @@ -5,8 +5,8 @@ import cn.wustlinghang.mywust.data.library.PagingResult; import cn.wustlinghang.mywust.data.library.origin.CurrentLoanBook; import cn.wustlinghang.mywust.exception.ApiException; import cn.wustlinghang.mywust.exception.ParseException; -import cn.wustlinghang.wusthelper.internal.library.exception.LibraryRpcException; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.LibraryRpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.enterprise.context.ApplicationScoped; import java.io.IOException; @@ -25,17 +25,17 @@ public class CurrentLoanService extends BaseService { try { return api.getCurrentLoan(cookie, page, pageSize); } catch (ApiException e) { - throw wrapApiException(e, LibraryRpcException.SubModuleCode.PERSONAL_API); + throw wrapApiException(e, LibraryRpcException.SubModuleCode.CURRENT_LOAN); } catch (IOException e) { throw new LibraryRpcException( LibraryRpcException.TypeCode.NETWORK_EXCEPTION, - LibraryRpcException.SubModuleCode.PERSONAL_API, + LibraryRpcException.SubModuleCode.CURRENT_LOAN, LibraryRpcException.ErrorCode.NETWORK_ERROR ); } catch (ParseException e) { throw new LibraryRpcException( LibraryRpcException.TypeCode.PARSE_EXCEPTION, - LibraryRpcException.SubModuleCode.PERSONAL_API, + LibraryRpcException.SubModuleCode.CURRENT_LOAN, LibraryRpcException.ErrorCode.PARSE_ERROR ); } diff --git a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/LoanHistoryService.java b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/LoanHistoryService.java index 1475ae1..0dbe1f3 100644 --- a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/LoanHistoryService.java +++ b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/LoanHistoryService.java @@ -2,12 +2,11 @@ package cn.wustlinghang.wusthelper.internal.library.services; import cn.wustlinghang.mywust.core.request.service.library.LoanHistoryApiService; import cn.wustlinghang.mywust.data.library.PagingResult; -import cn.wustlinghang.mywust.data.library.origin.BaseLoanBook; import cn.wustlinghang.mywust.data.library.origin.HistoryLoanBook; import cn.wustlinghang.mywust.exception.ApiException; import cn.wustlinghang.mywust.exception.ParseException; -import cn.wustlinghang.wusthelper.internal.library.exception.LibraryRpcException; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.LibraryRpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.enterprise.context.ApplicationScoped; import lombok.extern.slf4j.Slf4j; @@ -28,18 +27,18 @@ public class LoanHistoryService extends BaseService { try { return api.getLoanHistory(cookie, page, pageSize); } catch (ApiException e) { - throw wrapApiException(e, LibraryRpcException.SubModuleCode.PERSONAL_API); + throw wrapApiException(e, LibraryRpcException.SubModuleCode.LOAN_HISTORY); } catch (IOException e) { throw new LibraryRpcException( LibraryRpcException.TypeCode.NETWORK_EXCEPTION, - LibraryRpcException.SubModuleCode.PERSONAL_API, + LibraryRpcException.SubModuleCode.LOAN_HISTORY, LibraryRpcException.ErrorCode.NETWORK_ERROR ); } catch (ParseException e) { log.error("解析错误:", e); throw new LibraryRpcException( LibraryRpcException.TypeCode.PARSE_EXCEPTION, - LibraryRpcException.SubModuleCode.PERSONAL_API, + LibraryRpcException.SubModuleCode.LOAN_HISTORY, LibraryRpcException.ErrorCode.PARSE_ERROR ); } diff --git a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/LoginService.java b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/LoginService.java index cc90a1f..6b299d8 100644 --- a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/LoginService.java +++ b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/LoginService.java @@ -3,7 +3,7 @@ package cn.wustlinghang.wusthelper.internal.library.services; import cn.wustlinghang.mywust.core.request.service.auth.LibraryLogin; import cn.wustlinghang.mywust.exception.ApiException; import cn.wustlinghang.mywust.network.RequestClientOption; -import cn.wustlinghang.wusthelper.internal.library.exception.LibraryRpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.LibraryRpcException; import jakarta.enterprise.context.ApplicationScoped; import lombok.extern.slf4j.Slf4j; diff --git a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/OverdueSoonService.java b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/OverdueSoonService.java index c39dfb1..e57211f 100644 --- a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/OverdueSoonService.java +++ b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/OverdueSoonService.java @@ -5,8 +5,8 @@ import cn.wustlinghang.mywust.data.library.PagingResult; import cn.wustlinghang.mywust.data.library.origin.BaseLoanBook; import cn.wustlinghang.mywust.exception.ApiException; import cn.wustlinghang.mywust.exception.ParseException; -import cn.wustlinghang.wusthelper.internal.library.exception.LibraryRpcException; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.LibraryRpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.enterprise.context.ApplicationScoped; import java.io.IOException; @@ -25,17 +25,17 @@ public class OverdueSoonService extends BaseService { try { return api.getOverdueSoon(cookie, page, pageSize); } catch (ApiException e) { - throw wrapApiException(e, LibraryRpcException.SubModuleCode.PERSONAL_API); + throw wrapApiException(e, LibraryRpcException.SubModuleCode.OVERDUE_SOON); } catch (IOException e) { throw new LibraryRpcException( LibraryRpcException.TypeCode.NETWORK_EXCEPTION, - LibraryRpcException.SubModuleCode.PERSONAL_API, + LibraryRpcException.SubModuleCode.OVERDUE_SOON, LibraryRpcException.ErrorCode.NETWORK_ERROR ); } catch (ParseException e) { throw new LibraryRpcException( LibraryRpcException.TypeCode.PARSE_EXCEPTION, - LibraryRpcException.SubModuleCode.PERSONAL_API, + LibraryRpcException.SubModuleCode.OVERDUE_SOON, LibraryRpcException.ErrorCode.PARSE_ERROR ); } diff --git a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/ParseService.java b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/ParseService.java deleted file mode 100644 index 86cd95c..0000000 --- a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/ParseService.java +++ /dev/null @@ -1,8 +0,0 @@ -package cn.wustlinghang.wusthelper.internal.library.services; - -import jakarta.enterprise.context.ApplicationScoped; - -@ApplicationScoped -public class ParseService { - -} diff --git a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/SearchService.java b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/SearchService.java index 465c551..e607bb0 100644 --- a/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/SearchService.java +++ b/sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/SearchService.java @@ -5,8 +5,8 @@ import cn.wustlinghang.mywust.data.library.PagingResult; import cn.wustlinghang.mywust.data.library.origin.BookSearchResult; import cn.wustlinghang.mywust.exception.ApiException; import cn.wustlinghang.mywust.exception.ParseException; -import cn.wustlinghang.wusthelper.internal.library.exception.LibraryRpcException; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.LibraryRpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.enterprise.context.ApplicationScoped; import java.io.IOException; @@ -25,17 +25,17 @@ public class SearchService extends BaseService { try { return api.search(keyword, page, pageSize); } catch (ApiException e) { - throw wrapApiException(e, LibraryRpcException.SubModuleCode.PUBLIC_API); + throw wrapApiException(e, LibraryRpcException.SubModuleCode.SEARCH); } catch (IOException e) { throw new LibraryRpcException( LibraryRpcException.TypeCode.NETWORK_EXCEPTION, - LibraryRpcException.SubModuleCode.PUBLIC_API, + LibraryRpcException.SubModuleCode.SEARCH, LibraryRpcException.ErrorCode.NETWORK_ERROR ); } catch (ParseException e) { throw new LibraryRpcException( LibraryRpcException.TypeCode.PARSE_EXCEPTION, - LibraryRpcException.SubModuleCode.PERSONAL_API, + LibraryRpcException.SubModuleCode.SEARCH, LibraryRpcException.ErrorCode.PARSE_ERROR ); } diff --git a/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/CookieApi.java b/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/CookieApi.java index 7db2654..a651847 100644 --- a/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/CookieApi.java +++ b/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/CookieApi.java @@ -1,7 +1,7 @@ package cn.wustlinghang.wusthelper.internal.physics.api.http; import cn.wustlinghang.wusthelper.internal.physics.services.LoginService; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.validation.constraints.NotNull; import jakarta.ws.rs.GET; import jakarta.ws.rs.Path; diff --git a/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/CourseTableApi.java b/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/CourseTableApi.java index bf32dd5..dd26de8 100644 --- a/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/CourseTableApi.java +++ b/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/CourseTableApi.java @@ -2,7 +2,7 @@ package cn.wustlinghang.wusthelper.internal.physics.api.http; import cn.wustlinghang.mywust.data.physics.PhysicsCourse; import cn.wustlinghang.wusthelper.internal.physics.services.CourseTableService; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.enterprise.context.ApplicationScoped; import jakarta.validation.constraints.NotNull; import jakarta.ws.rs.GET; diff --git a/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/ScoreApi.java b/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/ScoreApi.java index c506a11..6677f85 100644 --- a/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/ScoreApi.java +++ b/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/ScoreApi.java @@ -2,7 +2,7 @@ package cn.wustlinghang.wusthelper.internal.physics.api.http; import cn.wustlinghang.mywust.data.global.Score; import cn.wustlinghang.wusthelper.internal.physics.services.ScoreService; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.enterprise.context.ApplicationScoped; import jakarta.validation.constraints.NotNull; import jakarta.ws.rs.GET; diff --git a/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/handler/BaseExceptionHandler.java b/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/handler/BaseExceptionHandler.java index 58ed838..6ee8f5c 100644 --- a/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/handler/BaseExceptionHandler.java +++ b/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/handler/BaseExceptionHandler.java @@ -1,7 +1,7 @@ package cn.wustlinghang.wusthelper.internal.physics.api.http.handler; -import cn.wustlinghang.wusthelper.rpc.response.ResponseCode; -import cn.wustlinghang.wusthelper.rpc.response.RpcResponse; +import cn.wustlinghang.wusthelper.internal.rpc.response.ResponseCode; +import cn.wustlinghang.wusthelper.internal.rpc.response.RpcResponse; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import jakarta.ws.rs.core.MediaType; diff --git a/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/handler/DefaultExceptionHandler.java b/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/handler/DefaultExceptionHandler.java index fb89811..b13cdab 100644 --- a/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/handler/DefaultExceptionHandler.java +++ b/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/handler/DefaultExceptionHandler.java @@ -1,6 +1,6 @@ package cn.wustlinghang.wusthelper.internal.physics.api.http.handler; -import cn.wustlinghang.wusthelper.rpc.response.ResponseCode; +import cn.wustlinghang.wusthelper.internal.rpc.response.ResponseCode; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.Provider; diff --git a/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/handler/IOExceptionHandler.java b/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/handler/IOExceptionHandler.java index 4a096d5..18e3019 100644 --- a/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/handler/IOExceptionHandler.java +++ b/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/handler/IOExceptionHandler.java @@ -1,6 +1,6 @@ package cn.wustlinghang.wusthelper.internal.physics.api.http.handler; -import cn.wustlinghang.wusthelper.rpc.response.ResponseCode; +import cn.wustlinghang.wusthelper.internal.rpc.response.ResponseCode; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.Provider; diff --git a/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/handler/ParseExceptionHandler.java b/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/handler/ParseExceptionHandler.java index 601b05b..ab65e80 100644 --- a/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/handler/ParseExceptionHandler.java +++ b/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/handler/ParseExceptionHandler.java @@ -1,7 +1,7 @@ package cn.wustlinghang.wusthelper.internal.physics.api.http.handler; import cn.wustlinghang.mywust.exception.ParseException; -import cn.wustlinghang.wusthelper.rpc.response.ResponseCode; +import cn.wustlinghang.wusthelper.internal.rpc.response.ResponseCode; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.Provider; diff --git a/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/handler/RpcExceptionHandler.java b/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/handler/RpcExceptionHandler.java index 0630455..2693671 100644 --- a/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/handler/RpcExceptionHandler.java +++ b/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/handler/RpcExceptionHandler.java @@ -1,6 +1,6 @@ package cn.wustlinghang.wusthelper.internal.physics.api.http.handler; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.Provider; diff --git a/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/handler/ValidationExceptionHandler.java b/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/handler/ValidationExceptionHandler.java index 11dc7d1..4d89680 100644 --- a/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/handler/ValidationExceptionHandler.java +++ b/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/handler/ValidationExceptionHandler.java @@ -1,6 +1,6 @@ package cn.wustlinghang.wusthelper.internal.physics.api.http.handler; -import cn.wustlinghang.wusthelper.rpc.response.ResponseCode; +import cn.wustlinghang.wusthelper.internal.rpc.response.ResponseCode; import jakarta.validation.ValidationException; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.ext.ExceptionMapper; diff --git a/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/handler/WebApplicationExceptionHandler.java b/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/handler/WebApplicationExceptionHandler.java index 346f267..9ad609a 100644 --- a/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/handler/WebApplicationExceptionHandler.java +++ b/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/handler/WebApplicationExceptionHandler.java @@ -1,7 +1,7 @@ package cn.wustlinghang.wusthelper.internal.physics.api.http.handler; -import cn.wustlinghang.wusthelper.internal.physics.exception.PhysicsRpcException; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.PhysicsRpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.ext.ExceptionMapper; diff --git a/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/interceptor/ResponseWrapperInterceptor.java b/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/interceptor/ResponseWrapperInterceptor.java index bb39d54..5bf463c 100644 --- a/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/interceptor/ResponseWrapperInterceptor.java +++ b/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/interceptor/ResponseWrapperInterceptor.java @@ -1,7 +1,7 @@ package cn.wustlinghang.wusthelper.internal.physics.api.http.interceptor; import cn.wustlinghang.wusthelper.internal.physics.api.http.handler.BaseExceptionHandler; -import cn.wustlinghang.wusthelper.rpc.response.RpcResponse; +import cn.wustlinghang.wusthelper.internal.rpc.response.RpcResponse; import com.fasterxml.jackson.databind.ObjectMapper; import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.core.HttpHeaders; diff --git a/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/services/BaseService.java b/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/services/BaseService.java index 233ae1a..1b442e6 100644 --- a/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/services/BaseService.java +++ b/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/services/BaseService.java @@ -1,7 +1,7 @@ package cn.wustlinghang.wusthelper.internal.physics.services; import cn.wustlinghang.mywust.exception.ApiException; -import cn.wustlinghang.wusthelper.internal.physics.exception.PhysicsRpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.PhysicsRpcException; import lombok.extern.slf4j.Slf4j; @Slf4j diff --git a/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/services/CourseTableService.java b/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/services/CourseTableService.java index 220ca8f..ff10945 100644 --- a/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/services/CourseTableService.java +++ b/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/services/CourseTableService.java @@ -5,8 +5,8 @@ import cn.wustlinghang.mywust.core.request.service.physics.PhysicsCourseApiServi import cn.wustlinghang.mywust.data.physics.PhysicsCourse; import cn.wustlinghang.mywust.exception.ApiException; import cn.wustlinghang.mywust.network.RequestClientOption; -import cn.wustlinghang.wusthelper.internal.physics.exception.PhysicsRpcException; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.PhysicsRpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.enterprise.context.ApplicationScoped; import java.io.IOException; diff --git a/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/services/LoginService.java b/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/services/LoginService.java index 81cb646..1bb88d5 100644 --- a/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/services/LoginService.java +++ b/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/services/LoginService.java @@ -4,7 +4,7 @@ import cn.wustlinghang.mywust.core.request.service.auth.PhysicsLogin; import cn.wustlinghang.mywust.exception.ApiException; import cn.wustlinghang.mywust.exception.ParseException; import cn.wustlinghang.mywust.network.RequestClientOption; -import cn.wustlinghang.wusthelper.internal.physics.exception.PhysicsRpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.PhysicsRpcException; import jakarta.enterprise.context.ApplicationScoped; import lombok.extern.slf4j.Slf4j; diff --git a/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/services/ScoreService.java b/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/services/ScoreService.java index 9591499..48dc416 100644 --- a/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/services/ScoreService.java +++ b/sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/services/ScoreService.java @@ -6,8 +6,8 @@ import cn.wustlinghang.mywust.data.global.Score; import cn.wustlinghang.mywust.exception.ApiException; import cn.wustlinghang.mywust.exception.ParseException; import cn.wustlinghang.mywust.network.RequestClientOption; -import cn.wustlinghang.wusthelper.internal.physics.exception.PhysicsRpcException; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.PhysicsRpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.enterprise.context.ApplicationScoped; import java.io.IOException; diff --git a/sub-services/pom.xml b/sub-services/pom.xml index b748a65..608977f 100644 --- a/sub-services/pom.xml +++ b/sub-services/pom.xml @@ -28,7 +28,7 @@ cn.wustlinghang.mywust mywust-core - 0.0.2-SNAPSHOT + ${mywust.version} cn.wustlinghang.mywust diff --git a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/CookieApi.java b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/CookieApi.java index 63e2904..235cf5d 100644 --- a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/CookieApi.java +++ b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/CookieApi.java @@ -1,7 +1,7 @@ package cn.wustlinghang.wusthelper.internal.undergrad.api.http; import cn.wustlinghang.wusthelper.internal.undergrad.services.LoginService; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.validation.constraints.NotNull; import jakarta.ws.rs.GET; import jakarta.ws.rs.Path; diff --git a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/CourseTableApi.java b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/CourseTableApi.java index 7e4be8a..ddcac9d 100644 --- a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/CourseTableApi.java +++ b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/CourseTableApi.java @@ -2,7 +2,7 @@ package cn.wustlinghang.wusthelper.internal.undergrad.api.http; import cn.wustlinghang.mywust.data.global.Course; import cn.wustlinghang.wusthelper.internal.undergrad.services.CourseTableService; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.enterprise.context.ApplicationScoped; import jakarta.validation.constraints.NotNull; import jakarta.ws.rs.GET; diff --git a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/CreditStatusApi.java b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/CreditStatusApi.java index ceed384..dffe812 100644 --- a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/CreditStatusApi.java +++ b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/CreditStatusApi.java @@ -1,7 +1,7 @@ package cn.wustlinghang.wusthelper.internal.undergrad.api.http; import cn.wustlinghang.wusthelper.internal.undergrad.services.CreditStatusService; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.enterprise.context.ApplicationScoped; import jakarta.validation.constraints.NotNull; import jakarta.ws.rs.GET; diff --git a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/ExamActivitiesApi.java b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/ExamActivitiesApi.java index 416f878..1a695af 100644 --- a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/ExamActivitiesApi.java +++ b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/ExamActivitiesApi.java @@ -3,7 +3,7 @@ package cn.wustlinghang.wusthelper.internal.undergrad.api.http; import cn.wustlinghang.mywust.core.request.service.undergraduate.UndergradExamDelayApiService; import cn.wustlinghang.mywust.data.global.Score; import cn.wustlinghang.wusthelper.internal.undergrad.services.ExamActivitiesService; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.enterprise.context.ApplicationScoped; import jakarta.validation.constraints.NotNull; import jakarta.ws.rs.GET; diff --git a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/ExamDelayApplicationApi.java b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/ExamDelayApplicationApi.java index 96da3c3..d9f5e95 100644 --- a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/ExamDelayApplicationApi.java +++ b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/ExamDelayApplicationApi.java @@ -2,7 +2,7 @@ package cn.wustlinghang.wusthelper.internal.undergrad.api.http; import cn.wustlinghang.mywust.data.undergrad.ExamDelayApplication; import cn.wustlinghang.wusthelper.internal.undergrad.services.ExamDelayApplicationService; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.enterprise.context.ApplicationScoped; import jakarta.validation.constraints.NotNull; import jakarta.ws.rs.GET; diff --git a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/ScoreApi.java b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/ScoreApi.java index 6905e75..8f5cbba 100644 --- a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/ScoreApi.java +++ b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/ScoreApi.java @@ -2,7 +2,7 @@ package cn.wustlinghang.wusthelper.internal.undergrad.api.http; import cn.wustlinghang.mywust.data.global.Score; import cn.wustlinghang.wusthelper.internal.undergrad.services.ScoreService; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.enterprise.context.ApplicationScoped; import jakarta.validation.constraints.NotNull; import jakarta.ws.rs.GET; diff --git a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/StudentInfoApi.java b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/StudentInfoApi.java index 1da83b8..05c5ebf 100644 --- a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/StudentInfoApi.java +++ b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/StudentInfoApi.java @@ -2,7 +2,7 @@ package cn.wustlinghang.wusthelper.internal.undergrad.api.http; import cn.wustlinghang.mywust.data.global.StudentInfo; import cn.wustlinghang.wusthelper.internal.undergrad.services.StudentInfoService; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.enterprise.context.ApplicationScoped; import jakarta.validation.constraints.NotNull; import jakarta.ws.rs.GET; diff --git a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/TrainingPlanApi.java b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/TrainingPlanApi.java index d3a25ed..26bee7b 100644 --- a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/TrainingPlanApi.java +++ b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/TrainingPlanApi.java @@ -1,7 +1,7 @@ package cn.wustlinghang.wusthelper.internal.undergrad.api.http; import cn.wustlinghang.wusthelper.internal.undergrad.services.TrainingPlanService; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.enterprise.context.ApplicationScoped; import jakarta.validation.constraints.NotNull; import jakarta.ws.rs.GET; diff --git a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/handler/BaseExceptionHandler.java b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/handler/BaseExceptionHandler.java index e5e1fee..f67a531 100644 --- a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/handler/BaseExceptionHandler.java +++ b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/handler/BaseExceptionHandler.java @@ -1,7 +1,7 @@ package cn.wustlinghang.wusthelper.internal.undergrad.api.http.handler; -import cn.wustlinghang.wusthelper.rpc.response.ResponseCode; -import cn.wustlinghang.wusthelper.rpc.response.RpcResponse; +import cn.wustlinghang.wusthelper.internal.rpc.response.ResponseCode; +import cn.wustlinghang.wusthelper.internal.rpc.response.RpcResponse; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import jakarta.ws.rs.core.MediaType; diff --git a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/handler/DefaultExceptionHandler.java b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/handler/DefaultExceptionHandler.java index 20d3112..e1ee003 100644 --- a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/handler/DefaultExceptionHandler.java +++ b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/handler/DefaultExceptionHandler.java @@ -1,6 +1,6 @@ package cn.wustlinghang.wusthelper.internal.undergrad.api.http.handler; -import cn.wustlinghang.wusthelper.rpc.response.ResponseCode; +import cn.wustlinghang.wusthelper.internal.rpc.response.ResponseCode; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.Provider; diff --git a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/handler/IOExceptionHandler.java b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/handler/IOExceptionHandler.java index f8e06f4..22887d6 100644 --- a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/handler/IOExceptionHandler.java +++ b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/handler/IOExceptionHandler.java @@ -1,6 +1,6 @@ package cn.wustlinghang.wusthelper.internal.undergrad.api.http.handler; -import cn.wustlinghang.wusthelper.rpc.response.ResponseCode; +import cn.wustlinghang.wusthelper.internal.rpc.response.ResponseCode; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.Provider; diff --git a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/handler/ParseExceptionHandler.java b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/handler/ParseExceptionHandler.java index 1bd6177..5e3f95a 100644 --- a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/handler/ParseExceptionHandler.java +++ b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/handler/ParseExceptionHandler.java @@ -1,7 +1,7 @@ package cn.wustlinghang.wusthelper.internal.undergrad.api.http.handler; import cn.wustlinghang.mywust.exception.ParseException; -import cn.wustlinghang.wusthelper.rpc.response.ResponseCode; +import cn.wustlinghang.wusthelper.internal.rpc.response.ResponseCode; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.Provider; diff --git a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/handler/RpcExceptionHandler.java b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/handler/RpcExceptionHandler.java index 5760852..0de94db 100644 --- a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/handler/RpcExceptionHandler.java +++ b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/handler/RpcExceptionHandler.java @@ -1,6 +1,6 @@ package cn.wustlinghang.wusthelper.internal.undergrad.api.http.handler; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.Provider; diff --git a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/handler/ValidationExceptionHandler.java b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/handler/ValidationExceptionHandler.java index 1e39096..5a67fcd 100644 --- a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/handler/ValidationExceptionHandler.java +++ b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/handler/ValidationExceptionHandler.java @@ -1,6 +1,6 @@ package cn.wustlinghang.wusthelper.internal.undergrad.api.http.handler; -import cn.wustlinghang.wusthelper.rpc.response.ResponseCode; +import cn.wustlinghang.wusthelper.internal.rpc.response.ResponseCode; import jakarta.validation.ValidationException; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.ext.ExceptionMapper; diff --git a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/handler/WebApplicationExceptionHandler.java b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/handler/WebApplicationExceptionHandler.java index 0a16d96..1f93418 100644 --- a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/handler/WebApplicationExceptionHandler.java +++ b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/handler/WebApplicationExceptionHandler.java @@ -1,7 +1,7 @@ package cn.wustlinghang.wusthelper.internal.undergrad.api.http.handler; -import cn.wustlinghang.wusthelper.internal.undergrad.exception.UndergradRpcException; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.UndergradRpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.ext.ExceptionMapper; diff --git a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/interceptor/ResponseWrapperInterceptor.java b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/interceptor/ResponseWrapperInterceptor.java index 250bc0a..cfa0fd6 100644 --- a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/interceptor/ResponseWrapperInterceptor.java +++ b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/interceptor/ResponseWrapperInterceptor.java @@ -1,7 +1,7 @@ package cn.wustlinghang.wusthelper.internal.undergrad.api.http.interceptor; import cn.wustlinghang.wusthelper.internal.undergrad.api.http.handler.BaseExceptionHandler; -import cn.wustlinghang.wusthelper.rpc.response.RpcResponse; +import cn.wustlinghang.wusthelper.internal.rpc.response.RpcResponse; import com.fasterxml.jackson.databind.ObjectMapper; import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.core.HttpHeaders; diff --git a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/BaseService.java b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/BaseService.java index 059f822..c487b11 100644 --- a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/BaseService.java +++ b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/BaseService.java @@ -1,7 +1,7 @@ package cn.wustlinghang.wusthelper.internal.undergrad.services; import cn.wustlinghang.mywust.exception.ApiException; -import cn.wustlinghang.wusthelper.internal.undergrad.exception.UndergradRpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.UndergradRpcException; import lombok.extern.slf4j.Slf4j; @Slf4j diff --git a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/CourseTableService.java b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/CourseTableService.java index db642cd..ba3dee6 100644 --- a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/CourseTableService.java +++ b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/CourseTableService.java @@ -4,8 +4,8 @@ import cn.wustlinghang.mywust.core.parser.undergraduate.UndergradCourseTablePars import cn.wustlinghang.mywust.core.request.service.undergraduate.UndergradCourseTableApiService; import cn.wustlinghang.mywust.data.global.Course; import cn.wustlinghang.mywust.exception.ApiException; -import cn.wustlinghang.wusthelper.internal.undergrad.exception.UndergradRpcException; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.UndergradRpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.enterprise.context.ApplicationScoped; import java.io.IOException; diff --git a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/CreditStatusService.java b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/CreditStatusService.java index caee00b..0efae3a 100644 --- a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/CreditStatusService.java +++ b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/CreditStatusService.java @@ -4,8 +4,8 @@ import cn.wustlinghang.mywust.core.parser.undergraduate.UndergradCreditStatusPar import cn.wustlinghang.mywust.core.request.service.undergraduate.UndergradCreditStatusApiService; import cn.wustlinghang.mywust.exception.ApiException; import cn.wustlinghang.mywust.network.RequestClientOption; -import cn.wustlinghang.wusthelper.internal.undergrad.exception.UndergradRpcException; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.UndergradRpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.enterprise.context.ApplicationScoped; import java.io.IOException; diff --git a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/ExamActivitiesService.java b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/ExamActivitiesService.java index c7b2662..98193a7 100644 --- a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/ExamActivitiesService.java +++ b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/ExamActivitiesService.java @@ -2,8 +2,8 @@ package cn.wustlinghang.wusthelper.internal.undergrad.services; import cn.wustlinghang.mywust.core.request.service.undergraduate.UndergradExamDelayApiService; import cn.wustlinghang.mywust.exception.ApiException; -import cn.wustlinghang.wusthelper.internal.undergrad.exception.UndergradRpcException; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.UndergradRpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.enterprise.context.ApplicationScoped; import java.io.IOException; diff --git a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/ExamDelayApplicationService.java b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/ExamDelayApplicationService.java index 5008b0c..0c67167 100644 --- a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/ExamDelayApplicationService.java +++ b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/ExamDelayApplicationService.java @@ -4,8 +4,8 @@ import cn.wustlinghang.mywust.core.parser.undergraduate.UndergradExamDelayParser import cn.wustlinghang.mywust.core.request.service.undergraduate.UndergradExamDelayApiService; import cn.wustlinghang.mywust.data.undergrad.ExamDelayApplication; import cn.wustlinghang.mywust.exception.ApiException; -import cn.wustlinghang.wusthelper.internal.undergrad.exception.UndergradRpcException; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.UndergradRpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.enterprise.context.ApplicationScoped; import java.io.IOException; diff --git a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/LoginService.java b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/LoginService.java index bdac6f1..e97adba 100644 --- a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/LoginService.java +++ b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/LoginService.java @@ -3,7 +3,7 @@ package cn.wustlinghang.wusthelper.internal.undergrad.services; import cn.wustlinghang.mywust.core.request.service.auth.UndergraduateLogin; import cn.wustlinghang.mywust.exception.ApiException; import cn.wustlinghang.mywust.network.RequestClientOption; -import cn.wustlinghang.wusthelper.internal.undergrad.exception.UndergradRpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.UndergradRpcException; import jakarta.enterprise.context.ApplicationScoped; import lombok.extern.slf4j.Slf4j; diff --git a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/ScoreService.java b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/ScoreService.java index 3c4d641..ec0f261 100644 --- a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/ScoreService.java +++ b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/ScoreService.java @@ -4,8 +4,8 @@ import cn.wustlinghang.mywust.core.parser.undergraduate.UndergradScoreParser; import cn.wustlinghang.mywust.core.request.service.undergraduate.UndergradScoreApiService; import cn.wustlinghang.mywust.data.global.Score; import cn.wustlinghang.mywust.exception.ApiException; -import cn.wustlinghang.wusthelper.internal.undergrad.exception.UndergradRpcException; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.UndergradRpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.enterprise.context.ApplicationScoped; import java.io.IOException; diff --git a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/StudentInfoService.java b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/StudentInfoService.java index 83330b5..ca7a605 100644 --- a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/StudentInfoService.java +++ b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/StudentInfoService.java @@ -4,8 +4,8 @@ import cn.wustlinghang.mywust.core.parser.undergraduate.UndergradStudentInfoPage import cn.wustlinghang.mywust.core.request.service.undergraduate.UndergradStudentInfoApiService; import cn.wustlinghang.mywust.data.global.StudentInfo; import cn.wustlinghang.mywust.exception.ApiException; -import cn.wustlinghang.wusthelper.internal.undergrad.exception.UndergradRpcException; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.UndergradRpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.enterprise.context.ApplicationScoped; import java.io.IOException; diff --git a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/TrainingPlanService.java b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/TrainingPlanService.java index be2a1b5..8dfb0e1 100644 --- a/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/TrainingPlanService.java +++ b/sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/services/TrainingPlanService.java @@ -3,8 +3,8 @@ package cn.wustlinghang.wusthelper.internal.undergrad.services; import cn.wustlinghang.mywust.core.parser.undergraduate.UndergradTrainingPlanPageParser; import cn.wustlinghang.mywust.core.request.service.undergraduate.UndergradTrainingPlanApiService; import cn.wustlinghang.mywust.exception.ApiException; -import cn.wustlinghang.wusthelper.internal.undergrad.exception.UndergradRpcException; -import cn.wustlinghang.wusthelper.rpc.exception.RpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.UndergradRpcException; +import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException; import jakarta.enterprise.context.ApplicationScoped; import java.io.IOException;