lensfrex 1 year ago
parent 43f0c9a5c4
commit be03878e94
Signed by: lensfrex
GPG Key ID: 0F69A0A2FBEE98A0
  1. 8
      .idea/encodings.xml
  2. 49
      README.md
  3. 0
      backend-main/backend-data/.gitignore
  4. 18
      backend-main/backend-data/pom.xml
  5. 2
      backend-main/backend-data/src/main/java/cn/wustlinghang/data/Main.java
  6. 0
      backend-main/backend-web/.flattened-pom.xml
  7. 38
      backend-main/backend-web/.gitignore
  8. 98
      backend-main/backend-web/pom.xml
  9. 3
      backend-main/pom.xml
  10. 7
      backend-main/web/src/main/java/cn/wustlinghang/Main.java
  11. 4
      common/src/main/java/cn/wustlinghang/wusthelper/internal/rpc/exception/GraduateRpcException.java
  12. 10
      common/src/main/java/cn/wustlinghang/wusthelper/internal/rpc/exception/LibraryRpcException.java
  13. 4
      common/src/main/java/cn/wustlinghang/wusthelper/internal/rpc/exception/PhysicsRpcException.java
  14. 2
      common/src/main/java/cn/wustlinghang/wusthelper/internal/rpc/exception/RpcException.java
  15. 8
      common/src/main/java/cn/wustlinghang/wusthelper/internal/rpc/exception/UndergradRpcException.java
  16. 22
      common/src/main/java/cn/wustlinghang/wusthelper/internal/rpc/response/ResponseCode.java
  17. 2
      common/src/main/java/cn/wustlinghang/wusthelper/internal/rpc/response/RpcResponse.java
  18. 2
      common/src/main/java/cn/wustlinghang/wusthelper/internal/rpc/util/EnumUtil.java
  19. 20
      common/src/main/java/cn/wustlinghang/wusthelper/rpc/request/RpcRequest.java
  20. 2
      external-library/mywust
  21. 2
      pom.xml
  22. 2
      sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/CookieApi.java
  23. 2
      sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/CourseTableApi.java
  24. 2
      sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/ScoreApi.java
  25. 2
      sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/StudentInfoApi.java
  26. 2
      sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/TrainingPlanApi.java
  27. 4
      sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/handler/BaseExceptionHandler.java
  28. 2
      sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/handler/DefaultExceptionHandler.java
  29. 2
      sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/handler/IOExceptionHandler.java
  30. 2
      sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/handler/ParseExceptionHandler.java
  31. 2
      sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/handler/RpcExceptionHandler.java
  32. 2
      sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/handler/ValidationExceptionHandler.java
  33. 4
      sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/handler/WebApplicationExceptionHandler.java
  34. 2
      sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/api/http/interceptor/ResponseWrapperInterceptor.java
  35. 2
      sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/services/BaseService.java
  36. 4
      sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/services/CourseTableService.java
  37. 3
      sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/services/LoginService.java
  38. 4
      sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/services/ScoreService.java
  39. 4
      sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/services/StudentInfoService.java
  40. 4
      sub-services/graduate/src/main/java/cn/wustlinghang/wusthelper/internal/graduate/services/TrainingPlanService.java
  41. 4
      sub-services/library/.flattened-pom.xml
  42. 2
      sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/BookCoverImageApi.java
  43. 2
      sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/BookDetailApi.java
  44. 2
      sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/BookHoldingApi.java
  45. 2
      sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/CookieApi.java
  46. 2
      sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/CurrentLoanApi.java
  47. 3
      sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/LoanHistoryApi.java
  48. 2
      sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/OverdueSoonApi.java
  49. 2
      sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/SearchApi.java
  50. 4
      sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/handler/BaseExceptionHandler.java
  51. 2
      sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/handler/DefaultExceptionHandler.java
  52. 2
      sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/handler/IOExceptionHandler.java
  53. 2
      sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/handler/ParseExceptionHandler.java
  54. 2
      sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/handler/RpcExceptionHandler.java
  55. 2
      sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/handler/ValidationExceptionHandler.java
  56. 4
      sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/handler/WebApplicationExceptionHandler.java
  57. 2
      sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/api/http/interceptor/ResponseWrapperInterceptor.java
  58. 2
      sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/bean/MywustRequestAgentBeans.java
  59. 10
      sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/BaseService.java
  60. 12
      sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/BookCoverImageUrlService.java
  61. 8
      sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/BookDetailService.java
  62. 10
      sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/BookHoldingService.java
  63. 10
      sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/CurrentLoanService.java
  64. 11
      sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/LoanHistoryService.java
  65. 2
      sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/LoginService.java
  66. 10
      sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/OverdueSoonService.java
  67. 8
      sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/ParseService.java
  68. 10
      sub-services/library/src/main/java/cn/wustlinghang/wusthelper/internal/library/services/SearchService.java
  69. 2
      sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/CookieApi.java
  70. 2
      sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/CourseTableApi.java
  71. 2
      sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/ScoreApi.java
  72. 4
      sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/handler/BaseExceptionHandler.java
  73. 2
      sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/handler/DefaultExceptionHandler.java
  74. 2
      sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/handler/IOExceptionHandler.java
  75. 2
      sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/handler/ParseExceptionHandler.java
  76. 2
      sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/handler/RpcExceptionHandler.java
  77. 2
      sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/handler/ValidationExceptionHandler.java
  78. 4
      sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/handler/WebApplicationExceptionHandler.java
  79. 2
      sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/api/http/interceptor/ResponseWrapperInterceptor.java
  80. 2
      sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/services/BaseService.java
  81. 4
      sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/services/CourseTableService.java
  82. 2
      sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/services/LoginService.java
  83. 4
      sub-services/physics/src/main/java/cn/wustlinghang/wusthelper/internal/physics/services/ScoreService.java
  84. 2
      sub-services/pom.xml
  85. 2
      sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/CookieApi.java
  86. 2
      sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/CourseTableApi.java
  87. 2
      sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/CreditStatusApi.java
  88. 2
      sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/ExamActivitiesApi.java
  89. 2
      sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/ExamDelayApplicationApi.java
  90. 2
      sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/ScoreApi.java
  91. 2
      sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/StudentInfoApi.java
  92. 2
      sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/TrainingPlanApi.java
  93. 4
      sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/handler/BaseExceptionHandler.java
  94. 2
      sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/handler/DefaultExceptionHandler.java
  95. 2
      sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/handler/IOExceptionHandler.java
  96. 2
      sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/handler/ParseExceptionHandler.java
  97. 2
      sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/handler/RpcExceptionHandler.java
  98. 2
      sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/handler/ValidationExceptionHandler.java
  99. 4
      sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/handler/WebApplicationExceptionHandler.java
  100. 2
      sub-services/undergrad/src/main/java/cn/wustlinghang/wusthelper/internal/undergrad/api/http/interceptor/ResponseWrapperInterceptor.java
  101. Some files were not shown because too many files have changed in this diff Show More

@ -1,10 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="Encoding" defaultCharsetForPropertiesFiles="UTF-8"> <component name="Encoding" defaultCharsetForPropertiesFiles="UTF-8">
<file url="file://$PROJECT_DIR$/backend-main/backend-cache/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/backend-main/backend-cache/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/backend-main/backend-data/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/backend-main/backend-data/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/backend-main/backend-web/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/backend-main/backend-web/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/backend-main/src/main/java" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/backend-main/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/backend-main/src/main/resources" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/backend-main/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/backend-main/web/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/backend-main/web/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/common/src/main/java" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/common/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/common/src/main/resources" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/common/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/external-library/mywust/mywust-common/src/main/java" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/external-library/mywust/mywust-common/src/main/java" charset="UTF-8" />

@ -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)
---
就先这样吧,手累了

@ -6,29 +6,15 @@
<parent> <parent>
<groupId>cn.wustlinghang.wusthelper</groupId> <groupId>cn.wustlinghang.wusthelper</groupId>
<artifactId>backend-main</artifactId> <artifactId>backend-main</artifactId>
<version>${revision}</version> <version>0.0.1-SNAPSHOT</version>
</parent> </parent>
<artifactId>web</artifactId> <artifactId>backend-data</artifactId>
<properties> <properties>
<maven.compiler.source>17</maven.compiler.source> <maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target> <maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<springboot.version>3.1.1</springboot.version>
</properties> </properties>
<dependencyManagement>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-dependencies -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${springboot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project> </project>

@ -1,4 +1,4 @@
package cn.wustlinghang; package cn.wustlinghang.data;
public class Main { public class Main {
public static void main(String[] args) { public static void main(String[] args) {

@ -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

@ -0,0 +1,98 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>cn.wustlinghang.wusthelper</groupId>
<artifactId>backend-main</artifactId>
<version>${revision}</version>
</parent>
<artifactId>backend-web</artifactId>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<springboot.version>3.1.1</springboot.version>
<snakeyaml.version>2.0</snakeyaml.version>
<feign.version>4.0.3</feign.version>
</properties>
<dependencyManagement>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-dependencies -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${springboot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- 清除springboot的依赖引入的漏洞警告,直接提升版本消除 -->
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>${snakeyaml.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
<version>${feign.version}</version>
</dependency>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>

@ -12,7 +12,8 @@
<artifactId>backend-main</artifactId> <artifactId>backend-main</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<modules> <modules>
<module>web</module> <module>backend-web</module>
<module>backend-data</module>
</modules> </modules>
<properties> <properties>

@ -1,7 +0,0 @@
package cn.wustlinghang;
public class Main {
public static void main(String[] args) {
System.out.println("Hello world!");
}
}

@ -1,6 +1,4 @@
package cn.wustlinghang.wusthelper.internal.graduate.exception; package cn.wustlinghang.wusthelper.internal.rpc.exception;
import cn.wustlinghang.wusthelper.rpc.exception.RpcException;
import java.util.StringJoiner; import java.util.StringJoiner;

@ -1,6 +1,4 @@
package cn.wustlinghang.wusthelper.internal.library.exception; package cn.wustlinghang.wusthelper.internal.rpc.exception;
import cn.wustlinghang.wusthelper.rpc.exception.RpcException;
import java.util.StringJoiner; import java.util.StringJoiner;
@ -42,7 +40,9 @@ public class LibraryRpcException extends RpcException {
* 子模块编码 * 子模块编码
*/ */
public enum SubModuleCode { 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_BANNED,
// 用户账号禁用 // 用户账号禁用
AUTH_USER_DISABLED, AUTH_USER_DISABLED,
// 用户账号需要更改 // 用户密码需要更改
AUTH_NEED_CHANGE_PASSWORD, AUTH_NEED_CHANGE_PASSWORD,
AUTH_UNKNOWN_ERROR AUTH_UNKNOWN_ERROR
} }

@ -1,6 +1,4 @@
package cn.wustlinghang.wusthelper.internal.physics.exception; package cn.wustlinghang.wusthelper.internal.rpc.exception;
import cn.wustlinghang.wusthelper.rpc.exception.RpcException;
import java.util.StringJoiner; import java.util.StringJoiner;

@ -1,4 +1,4 @@
package cn.wustlinghang.wusthelper.rpc.exception; package cn.wustlinghang.wusthelper.internal.rpc.exception;
public class RpcException extends RuntimeException { public class RpcException extends RuntimeException {
protected final int code; protected final int code;

@ -1,6 +1,4 @@
package cn.wustlinghang.wusthelper.internal.undergrad.exception; package cn.wustlinghang.wusthelper.internal.rpc.exception;
import cn.wustlinghang.wusthelper.rpc.exception.RpcException;
import java.util.StringJoiner; import java.util.StringJoiner;
@ -66,9 +64,9 @@ public class UndergradRpcException extends RpcException {
AUTH_USER_BANNED, AUTH_USER_BANNED,
// 用户账号禁用 // 用户账号禁用
AUTH_USER_DISABLED, AUTH_USER_DISABLED,
// 用户账号需要更改 // 用户密码需要更改
AUTH_NEED_CHANGE_PASSWORD, AUTH_NEED_CHANGE_PASSWORD,
// 专属选课时间段账号被禁用(--> _ --> // 专属选课时间段账号被禁用(--> _ --)
AUTH_BANNED_IN_EXCLUSIVE_TIME, AUTH_BANNED_IN_EXCLUSIVE_TIME,
AUTH_UNKNOWN_ERROR AUTH_UNKNOWN_ERROR
} }

@ -2,7 +2,7 @@
* Class created by lensfrex. * Class created by lensfrex.
*/ */
package cn.wustlinghang.wusthelper.rpc.response; package cn.wustlinghang.wusthelper.internal.rpc.response;
public enum ResponseCode { public enum ResponseCode {
SUCCESS(20000, "成功"), SUCCESS(20000, "成功"),
@ -41,23 +41,3 @@ public enum ResponseCode {
return message; 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;
}
}

@ -1,4 +1,4 @@
package cn.wustlinghang.wusthelper.rpc.response; package cn.wustlinghang.wusthelper.internal.rpc.response;
public record RpcResponse<T>(int code, String msg, T data) { public record RpcResponse<T>(int code, String msg, T data) {
public static <T> RpcResponse<T> success(T data) { public static <T> RpcResponse<T> success(T data) {

@ -1,4 +1,4 @@
package cn.wustlinghang.wusthelper.rpc.util; package cn.wustlinghang.wusthelper.internal.rpc.util;
public class EnumUtil { public class EnumUtil {
public static <E extends Enum<E>> boolean equal(int value, Enum<E> e) { public static <E extends Enum<E>> boolean equal(int value, Enum<E> e) {

@ -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<String, String> arg;
public RpcRequest() {
this.arg = new HashMap<>();
}
public RpcRequest addArg(String key, String value) {
this.arg.put(key, value);
return this;
}
}

@ -1 +1 @@
Subproject commit a18aa81d71123f54e959866e93c7ceb56b03ade4 Subproject commit 965562b69e35d445fb5c58b2e2afd9cdf27d3146

@ -24,7 +24,7 @@
<maven.compiler.target>17</maven.compiler.target> <maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<mywust.version>0.0.2-SNAPSHOT</mywust.version> <mywust.version>0.0.2-beta</mywust.version>
<lombok.version>1.18.26</lombok.version> <lombok.version>1.18.26</lombok.version>
<hutool.version>5.8.20</hutool.version> <hutool.version>5.8.20</hutool.version>
</properties> </properties>

@ -1,7 +1,7 @@
package cn.wustlinghang.wusthelper.internal.graduate.api.http; package cn.wustlinghang.wusthelper.internal.graduate.api.http;
import cn.wustlinghang.wusthelper.internal.graduate.services.LoginService; 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.validation.constraints.NotNull;
import jakarta.ws.rs.GET; import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path; import jakarta.ws.rs.Path;

@ -2,7 +2,7 @@ package cn.wustlinghang.wusthelper.internal.graduate.api.http;
import cn.wustlinghang.mywust.data.global.Course; import cn.wustlinghang.mywust.data.global.Course;
import cn.wustlinghang.wusthelper.internal.graduate.services.CourseTableService; 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.enterprise.context.ApplicationScoped;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import jakarta.ws.rs.GET; import jakarta.ws.rs.GET;

@ -2,7 +2,7 @@ package cn.wustlinghang.wusthelper.internal.graduate.api.http;
import cn.wustlinghang.mywust.data.global.Score; import cn.wustlinghang.mywust.data.global.Score;
import cn.wustlinghang.wusthelper.internal.graduate.services.ScoreService; 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.enterprise.context.ApplicationScoped;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import jakarta.ws.rs.GET; import jakarta.ws.rs.GET;

@ -2,7 +2,7 @@ package cn.wustlinghang.wusthelper.internal.graduate.api.http;
import cn.wustlinghang.mywust.data.global.StudentInfo; import cn.wustlinghang.mywust.data.global.StudentInfo;
import cn.wustlinghang.wusthelper.internal.graduate.services.StudentInfoService; 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.enterprise.context.ApplicationScoped;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import jakarta.ws.rs.GET; import jakarta.ws.rs.GET;

@ -1,7 +1,7 @@
package cn.wustlinghang.wusthelper.internal.graduate.api.http; package cn.wustlinghang.wusthelper.internal.graduate.api.http;
import cn.wustlinghang.wusthelper.internal.graduate.services.TrainingPlanService; 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.enterprise.context.ApplicationScoped;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import jakarta.ws.rs.GET; import jakarta.ws.rs.GET;

@ -1,7 +1,7 @@
package cn.wustlinghang.wusthelper.internal.graduate.api.http.handler; 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 cn.wustlinghang.wusthelper.rpc.response.RpcResponse; import cn.wustlinghang.wusthelper.internal.rpc.response.RpcResponse;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.MediaType;

@ -1,6 +1,6 @@
package cn.wustlinghang.wusthelper.internal.graduate.api.http.handler; 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.core.Response;
import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.ExceptionMapper;
import jakarta.ws.rs.ext.Provider; import jakarta.ws.rs.ext.Provider;

@ -1,6 +1,6 @@
package cn.wustlinghang.wusthelper.internal.graduate.api.http.handler; 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.core.Response;
import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.ExceptionMapper;
import jakarta.ws.rs.ext.Provider; import jakarta.ws.rs.ext.Provider;

@ -1,7 +1,7 @@
package cn.wustlinghang.wusthelper.internal.graduate.api.http.handler; package cn.wustlinghang.wusthelper.internal.graduate.api.http.handler;
import cn.wustlinghang.mywust.exception.ParseException; 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.core.Response;
import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.ExceptionMapper;
import jakarta.ws.rs.ext.Provider; import jakarta.ws.rs.ext.Provider;

@ -1,6 +1,6 @@
package cn.wustlinghang.wusthelper.internal.graduate.api.http.handler; 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.core.Response;
import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.ExceptionMapper;
import jakarta.ws.rs.ext.Provider; import jakarta.ws.rs.ext.Provider;

@ -1,6 +1,6 @@
package cn.wustlinghang.wusthelper.internal.graduate.api.http.handler; 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.validation.ValidationException;
import jakarta.ws.rs.core.Response; import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.ExceptionMapper;

@ -1,7 +1,7 @@
package cn.wustlinghang.wusthelper.internal.graduate.api.http.handler; package cn.wustlinghang.wusthelper.internal.graduate.api.http.handler;
import cn.wustlinghang.wusthelper.internal.graduate.exception.GraduateRpcException; import cn.wustlinghang.wusthelper.internal.rpc.exception.GraduateRpcException;
import cn.wustlinghang.wusthelper.rpc.exception.RpcException; import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException;
import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.Response; import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.ExceptionMapper;

@ -1,7 +1,7 @@
package cn.wustlinghang.wusthelper.internal.graduate.api.http.interceptor; package cn.wustlinghang.wusthelper.internal.graduate.api.http.interceptor;
import cn.wustlinghang.wusthelper.internal.graduate.api.http.handler.BaseExceptionHandler; 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 com.fasterxml.jackson.databind.ObjectMapper;
import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.HttpHeaders; import jakarta.ws.rs.core.HttpHeaders;

@ -1,7 +1,7 @@
package cn.wustlinghang.wusthelper.internal.graduate.services; package cn.wustlinghang.wusthelper.internal.graduate.services;
import cn.wustlinghang.mywust.exception.ApiException; 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; import lombok.extern.slf4j.Slf4j;
@Slf4j @Slf4j

@ -5,8 +5,8 @@ import cn.wustlinghang.mywust.core.request.service.graduate.GraduateCourseTableA
import cn.wustlinghang.mywust.data.global.Course; import cn.wustlinghang.mywust.data.global.Course;
import cn.wustlinghang.mywust.exception.ApiException; import cn.wustlinghang.mywust.exception.ApiException;
import cn.wustlinghang.mywust.network.RequestClientOption; import cn.wustlinghang.mywust.network.RequestClientOption;
import cn.wustlinghang.wusthelper.internal.graduate.exception.GraduateRpcException; import cn.wustlinghang.wusthelper.internal.rpc.exception.GraduateRpcException;
import cn.wustlinghang.wusthelper.rpc.exception.RpcException; import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException;
import jakarta.enterprise.context.ApplicationScoped; import jakarta.enterprise.context.ApplicationScoped;
import java.io.IOException; import java.io.IOException;

@ -3,10 +3,9 @@ package cn.wustlinghang.wusthelper.internal.graduate.services;
import cn.wustlinghang.mywust.core.request.service.auth.GraduateLogin; import cn.wustlinghang.mywust.core.request.service.auth.GraduateLogin;
import cn.wustlinghang.mywust.exception.ApiException; import cn.wustlinghang.mywust.exception.ApiException;
import cn.wustlinghang.mywust.network.RequestClientOption; 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 jakarta.enterprise.context.ApplicationScoped;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.eclipse.microprofile.config.inject.ConfigProperties;
import org.eclipse.microprofile.config.inject.ConfigProperty; import org.eclipse.microprofile.config.inject.ConfigProperty;
import java.io.IOException; import java.io.IOException;

@ -5,8 +5,8 @@ import cn.wustlinghang.mywust.core.request.service.graduate.GraduateScoreApiServ
import cn.wustlinghang.mywust.data.global.Score; import cn.wustlinghang.mywust.data.global.Score;
import cn.wustlinghang.mywust.exception.ApiException; import cn.wustlinghang.mywust.exception.ApiException;
import cn.wustlinghang.mywust.network.RequestClientOption; import cn.wustlinghang.mywust.network.RequestClientOption;
import cn.wustlinghang.wusthelper.internal.graduate.exception.GraduateRpcException; import cn.wustlinghang.wusthelper.internal.rpc.exception.GraduateRpcException;
import cn.wustlinghang.wusthelper.rpc.exception.RpcException; import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException;
import jakarta.enterprise.context.ApplicationScoped; import jakarta.enterprise.context.ApplicationScoped;
import java.io.IOException; import java.io.IOException;

@ -5,8 +5,8 @@ import cn.wustlinghang.mywust.core.request.service.graduate.GraduateStudentInfoA
import cn.wustlinghang.mywust.data.global.StudentInfo; import cn.wustlinghang.mywust.data.global.StudentInfo;
import cn.wustlinghang.mywust.exception.ApiException; import cn.wustlinghang.mywust.exception.ApiException;
import cn.wustlinghang.mywust.network.RequestClientOption; import cn.wustlinghang.mywust.network.RequestClientOption;
import cn.wustlinghang.wusthelper.internal.graduate.exception.GraduateRpcException; import cn.wustlinghang.wusthelper.internal.rpc.exception.GraduateRpcException;
import cn.wustlinghang.wusthelper.rpc.exception.RpcException; import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException;
import jakarta.enterprise.context.ApplicationScoped; import jakarta.enterprise.context.ApplicationScoped;
import java.io.IOException; import java.io.IOException;

@ -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.core.request.service.graduate.GraduateTrainingPlanApiService;
import cn.wustlinghang.mywust.exception.ApiException; import cn.wustlinghang.mywust.exception.ApiException;
import cn.wustlinghang.mywust.network.RequestClientOption; import cn.wustlinghang.mywust.network.RequestClientOption;
import cn.wustlinghang.wusthelper.internal.graduate.exception.GraduateRpcException; import cn.wustlinghang.wusthelper.internal.rpc.exception.GraduateRpcException;
import cn.wustlinghang.wusthelper.rpc.exception.RpcException; import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException;
import jakarta.enterprise.context.ApplicationScoped; import jakarta.enterprise.context.ApplicationScoped;
import java.io.IOException; import java.io.IOException;

@ -33,13 +33,13 @@
<dependency> <dependency>
<groupId>cn.wustlinghang.mywust</groupId> <groupId>cn.wustlinghang.mywust</groupId>
<artifactId>mywust-core</artifactId> <artifactId>mywust-core</artifactId>
<version>0.0.2-SNAPSHOT</version> <version>0.0.2-beta</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>cn.wustlinghang.mywust</groupId> <groupId>cn.wustlinghang.mywust</groupId>
<artifactId>mywust-network-okhttp</artifactId> <artifactId>mywust-network-okhttp</artifactId>
<version>0.0.2-SNAPSHOT</version> <version>0.0.2-beta</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>

@ -1,7 +1,7 @@
package cn.wustlinghang.wusthelper.internal.library.api.http; package cn.wustlinghang.wusthelper.internal.library.api.http;
import cn.wustlinghang.wusthelper.internal.library.services.BookCoverImageUrlService; 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.enterprise.context.ApplicationScoped;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import jakarta.ws.rs.GET; import jakarta.ws.rs.GET;

@ -2,7 +2,7 @@ package cn.wustlinghang.wusthelper.internal.library.api.http;
import cn.wustlinghang.mywust.data.library.parsed.BookDetail; import cn.wustlinghang.mywust.data.library.parsed.BookDetail;
import cn.wustlinghang.wusthelper.internal.library.services.BookDetailService; 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.enterprise.context.ApplicationScoped;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import jakarta.ws.rs.GET; import jakarta.ws.rs.GET;

@ -2,7 +2,7 @@ package cn.wustlinghang.wusthelper.internal.library.api.http;
import cn.wustlinghang.mywust.data.library.parsed.BookHolding; import cn.wustlinghang.mywust.data.library.parsed.BookHolding;
import cn.wustlinghang.wusthelper.internal.library.services.BookHoldingService; 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.enterprise.context.ApplicationScoped;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import jakarta.ws.rs.GET; import jakarta.ws.rs.GET;

@ -1,7 +1,7 @@
package cn.wustlinghang.wusthelper.internal.library.api.http; package cn.wustlinghang.wusthelper.internal.library.api.http;
import cn.wustlinghang.wusthelper.internal.library.services.LoginService; 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.validation.constraints.NotNull;
import jakarta.ws.rs.GET; import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path; import jakarta.ws.rs.Path;

@ -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.PagingResult;
import cn.wustlinghang.mywust.data.library.origin.CurrentLoanBook; import cn.wustlinghang.mywust.data.library.origin.CurrentLoanBook;
import cn.wustlinghang.wusthelper.internal.library.services.CurrentLoanService; 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.enterprise.context.ApplicationScoped;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import jakarta.ws.rs.DefaultValue; import jakarta.ws.rs.DefaultValue;

@ -1,10 +1,9 @@
package cn.wustlinghang.wusthelper.internal.library.api.http; package cn.wustlinghang.wusthelper.internal.library.api.http;
import cn.wustlinghang.mywust.data.library.PagingResult; 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.data.library.origin.HistoryLoanBook;
import cn.wustlinghang.wusthelper.internal.library.services.LoanHistoryService; 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.enterprise.context.ApplicationScoped;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import jakarta.ws.rs.DefaultValue; import jakarta.ws.rs.DefaultValue;

@ -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.PagingResult;
import cn.wustlinghang.mywust.data.library.origin.BaseLoanBook; import cn.wustlinghang.mywust.data.library.origin.BaseLoanBook;
import cn.wustlinghang.wusthelper.internal.library.services.OverdueSoonService; 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.enterprise.context.ApplicationScoped;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import jakarta.ws.rs.DefaultValue; import jakarta.ws.rs.DefaultValue;

@ -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.PagingResult;
import cn.wustlinghang.mywust.data.library.origin.BookSearchResult; import cn.wustlinghang.mywust.data.library.origin.BookSearchResult;
import cn.wustlinghang.wusthelper.internal.library.services.SearchService; 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.enterprise.context.ApplicationScoped;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import jakarta.ws.rs.DefaultValue; import jakarta.ws.rs.DefaultValue;

@ -1,7 +1,7 @@
package cn.wustlinghang.wusthelper.internal.library.api.http.handler; 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 cn.wustlinghang.wusthelper.rpc.response.RpcResponse; import cn.wustlinghang.wusthelper.internal.rpc.response.RpcResponse;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.MediaType;

@ -1,6 +1,6 @@
package cn.wustlinghang.wusthelper.internal.library.api.http.handler; 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.core.Response;
import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.ExceptionMapper;
import jakarta.ws.rs.ext.Provider; import jakarta.ws.rs.ext.Provider;

@ -1,6 +1,6 @@
package cn.wustlinghang.wusthelper.internal.library.api.http.handler; 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.core.Response;
import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.ExceptionMapper;
import jakarta.ws.rs.ext.Provider; import jakarta.ws.rs.ext.Provider;

@ -1,7 +1,7 @@
package cn.wustlinghang.wusthelper.internal.library.api.http.handler; package cn.wustlinghang.wusthelper.internal.library.api.http.handler;
import cn.wustlinghang.mywust.exception.ParseException; 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.core.Response;
import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.ExceptionMapper;
import jakarta.ws.rs.ext.Provider; import jakarta.ws.rs.ext.Provider;

@ -1,6 +1,6 @@
package cn.wustlinghang.wusthelper.internal.library.api.http.handler; 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.core.Response;
import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.ExceptionMapper;
import jakarta.ws.rs.ext.Provider; import jakarta.ws.rs.ext.Provider;

@ -1,6 +1,6 @@
package cn.wustlinghang.wusthelper.internal.library.api.http.handler; 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.validation.ValidationException;
import jakarta.ws.rs.core.Response; import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.ExceptionMapper;

@ -1,7 +1,7 @@
package cn.wustlinghang.wusthelper.internal.library.api.http.handler; package cn.wustlinghang.wusthelper.internal.library.api.http.handler;
import cn.wustlinghang.wusthelper.internal.library.exception.LibraryRpcException; import cn.wustlinghang.wusthelper.internal.rpc.exception.LibraryRpcException;
import cn.wustlinghang.wusthelper.rpc.exception.RpcException; import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException;
import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.Response; import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.ExceptionMapper;

@ -1,7 +1,7 @@
package cn.wustlinghang.wusthelper.internal.library.api.http.interceptor; package cn.wustlinghang.wusthelper.internal.library.api.http.interceptor;
import cn.wustlinghang.wusthelper.internal.library.api.http.handler.BaseExceptionHandler; 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 com.fasterxml.jackson.databind.ObjectMapper;
import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.HttpHeaders; import jakarta.ws.rs.core.HttpHeaders;

@ -16,7 +16,7 @@ public class MywustRequestAgentBeans {
.port(8080) .port(8080)
.build(); .build();
RequestClientOption option = new RequestClientOption(); RequestClientOption option = new RequestClientOption();
option.setProxy(proxy); // option.setProxy(proxy);
return option; return option;
} }

@ -1,17 +1,9 @@
package cn.wustlinghang.wusthelper.internal.library.services; package cn.wustlinghang.wusthelper.internal.library.services;
import cn.wustlinghang.mywust.data.library.parsed.BookHolding;
import cn.wustlinghang.mywust.exception.ApiException; import cn.wustlinghang.mywust.exception.ApiException;
import cn.wustlinghang.wusthelper.internal.library.exception.LibraryRpcException; import cn.wustlinghang.wusthelper.internal.rpc.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 lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import java.io.IOException;
import java.util.List;
@Slf4j @Slf4j
public abstract class BaseService { public abstract class BaseService {
protected LibraryRpcException wrapApiException(ApiException e, LibraryRpcException.SubModuleCode subModuleCode) { protected LibraryRpcException wrapApiException(ApiException e, LibraryRpcException.SubModuleCode subModuleCode) {

@ -2,8 +2,8 @@ package cn.wustlinghang.wusthelper.internal.library.services;
import cn.wustlinghang.mywust.core.request.service.library.BookCoverImageUrlApiService; import cn.wustlinghang.mywust.core.request.service.library.BookCoverImageUrlApiService;
import cn.wustlinghang.mywust.exception.ApiException; import cn.wustlinghang.mywust.exception.ApiException;
import cn.wustlinghang.wusthelper.internal.library.exception.LibraryRpcException; import cn.wustlinghang.wusthelper.internal.rpc.exception.LibraryRpcException;
import cn.wustlinghang.wusthelper.rpc.exception.RpcException; import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException;
import jakarta.enterprise.context.ApplicationScoped; import jakarta.enterprise.context.ApplicationScoped;
import java.io.IOException; import java.io.IOException;
@ -22,11 +22,11 @@ public class BookCoverImageUrlService extends BaseService {
try { try {
return api.getBookCoverImageUrl(isbn); return api.getBookCoverImageUrl(isbn);
} catch (ApiException e) { } catch (ApiException e) {
throw wrapApiException(e, LibraryRpcException.SubModuleCode.PUBLIC_API); throw wrapApiException(e, LibraryRpcException.SubModuleCode.COVER_IMAGE);
} catch (IOException e) { } catch (IOException e) {
throw new LibraryRpcException( throw new LibraryRpcException(
LibraryRpcException.TypeCode.NETWORK_EXCEPTION, LibraryRpcException.TypeCode.NETWORK_EXCEPTION,
LibraryRpcException.SubModuleCode.PUBLIC_API, LibraryRpcException.SubModuleCode.COVER_IMAGE,
LibraryRpcException.ErrorCode.NETWORK_ERROR LibraryRpcException.ErrorCode.NETWORK_ERROR
); );
} }
@ -36,11 +36,11 @@ public class BookCoverImageUrlService extends BaseService {
try { try {
return api.getBookCoverImageUrl(isbnList); return api.getBookCoverImageUrl(isbnList);
} catch (ApiException e) { } catch (ApiException e) {
throw wrapApiException(e, LibraryRpcException.SubModuleCode.PUBLIC_API); throw wrapApiException(e, LibraryRpcException.SubModuleCode.COVER_IMAGE);
} catch (IOException e) { } catch (IOException e) {
throw new LibraryRpcException( throw new LibraryRpcException(
LibraryRpcException.TypeCode.NETWORK_EXCEPTION, LibraryRpcException.TypeCode.NETWORK_EXCEPTION,
LibraryRpcException.SubModuleCode.PUBLIC_API, LibraryRpcException.SubModuleCode.COVER_IMAGE,
LibraryRpcException.ErrorCode.NETWORK_ERROR LibraryRpcException.ErrorCode.NETWORK_ERROR
); );
} }

@ -3,8 +3,8 @@ package cn.wustlinghang.wusthelper.internal.library.services;
import cn.wustlinghang.mywust.core.request.service.library.BookDetailApiService; import cn.wustlinghang.mywust.core.request.service.library.BookDetailApiService;
import cn.wustlinghang.mywust.data.library.parsed.BookDetail; import cn.wustlinghang.mywust.data.library.parsed.BookDetail;
import cn.wustlinghang.mywust.exception.ApiException; import cn.wustlinghang.mywust.exception.ApiException;
import cn.wustlinghang.wusthelper.internal.library.exception.LibraryRpcException; import cn.wustlinghang.wusthelper.internal.rpc.exception.LibraryRpcException;
import cn.wustlinghang.wusthelper.rpc.exception.RpcException; import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException;
import jakarta.enterprise.context.ApplicationScoped; import jakarta.enterprise.context.ApplicationScoped;
import java.io.IOException; import java.io.IOException;
@ -21,11 +21,11 @@ public class BookDetailService extends BaseService {
try { try {
return api.getBookDetail(bookId); return api.getBookDetail(bookId);
} catch (ApiException e) { } catch (ApiException e) {
throw wrapApiException(e, LibraryRpcException.SubModuleCode.PUBLIC_API); throw wrapApiException(e, LibraryRpcException.SubModuleCode.BOOK_DETAIL);
} catch (IOException e) { } catch (IOException e) {
throw new LibraryRpcException( throw new LibraryRpcException(
LibraryRpcException.TypeCode.NETWORK_EXCEPTION, LibraryRpcException.TypeCode.NETWORK_EXCEPTION,
LibraryRpcException.SubModuleCode.PUBLIC_API, LibraryRpcException.SubModuleCode.BOOK_DETAIL,
LibraryRpcException.ErrorCode.NETWORK_ERROR LibraryRpcException.ErrorCode.NETWORK_ERROR
); );
} }

@ -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.data.library.parsed.BookHolding;
import cn.wustlinghang.mywust.exception.ApiException; import cn.wustlinghang.mywust.exception.ApiException;
import cn.wustlinghang.mywust.exception.ParseException; import cn.wustlinghang.mywust.exception.ParseException;
import cn.wustlinghang.wusthelper.internal.library.exception.LibraryRpcException; import cn.wustlinghang.wusthelper.internal.rpc.exception.LibraryRpcException;
import cn.wustlinghang.wusthelper.rpc.exception.RpcException; import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException;
import jakarta.enterprise.context.ApplicationScoped; import jakarta.enterprise.context.ApplicationScoped;
import java.io.IOException; import java.io.IOException;
@ -24,17 +24,17 @@ public class BookHoldingService extends BaseService {
try { try {
return api.getHoldingList(id); return api.getHoldingList(id);
} catch (ApiException e) { } catch (ApiException e) {
throw wrapApiException(e, LibraryRpcException.SubModuleCode.PERSONAL_API); throw wrapApiException(e, LibraryRpcException.SubModuleCode.BOOK_HOLDING);
} catch (IOException e) { } catch (IOException e) {
throw new LibraryRpcException( throw new LibraryRpcException(
LibraryRpcException.TypeCode.NETWORK_EXCEPTION, LibraryRpcException.TypeCode.NETWORK_EXCEPTION,
LibraryRpcException.SubModuleCode.PERSONAL_API, LibraryRpcException.SubModuleCode.BOOK_HOLDING,
LibraryRpcException.ErrorCode.NETWORK_ERROR LibraryRpcException.ErrorCode.NETWORK_ERROR
); );
} catch (ParseException e) { } catch (ParseException e) {
throw new LibraryRpcException( throw new LibraryRpcException(
LibraryRpcException.TypeCode.PARSE_EXCEPTION, LibraryRpcException.TypeCode.PARSE_EXCEPTION,
LibraryRpcException.SubModuleCode.PERSONAL_API, LibraryRpcException.SubModuleCode.BOOK_HOLDING,
LibraryRpcException.ErrorCode.PARSE_ERROR LibraryRpcException.ErrorCode.PARSE_ERROR
); );
} }

@ -5,8 +5,8 @@ import cn.wustlinghang.mywust.data.library.PagingResult;
import cn.wustlinghang.mywust.data.library.origin.CurrentLoanBook; import cn.wustlinghang.mywust.data.library.origin.CurrentLoanBook;
import cn.wustlinghang.mywust.exception.ApiException; import cn.wustlinghang.mywust.exception.ApiException;
import cn.wustlinghang.mywust.exception.ParseException; import cn.wustlinghang.mywust.exception.ParseException;
import cn.wustlinghang.wusthelper.internal.library.exception.LibraryRpcException; import cn.wustlinghang.wusthelper.internal.rpc.exception.LibraryRpcException;
import cn.wustlinghang.wusthelper.rpc.exception.RpcException; import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException;
import jakarta.enterprise.context.ApplicationScoped; import jakarta.enterprise.context.ApplicationScoped;
import java.io.IOException; import java.io.IOException;
@ -25,17 +25,17 @@ public class CurrentLoanService extends BaseService {
try { try {
return api.getCurrentLoan(cookie, page, pageSize); return api.getCurrentLoan(cookie, page, pageSize);
} catch (ApiException e) { } catch (ApiException e) {
throw wrapApiException(e, LibraryRpcException.SubModuleCode.PERSONAL_API); throw wrapApiException(e, LibraryRpcException.SubModuleCode.CURRENT_LOAN);
} catch (IOException e) { } catch (IOException e) {
throw new LibraryRpcException( throw new LibraryRpcException(
LibraryRpcException.TypeCode.NETWORK_EXCEPTION, LibraryRpcException.TypeCode.NETWORK_EXCEPTION,
LibraryRpcException.SubModuleCode.PERSONAL_API, LibraryRpcException.SubModuleCode.CURRENT_LOAN,
LibraryRpcException.ErrorCode.NETWORK_ERROR LibraryRpcException.ErrorCode.NETWORK_ERROR
); );
} catch (ParseException e) { } catch (ParseException e) {
throw new LibraryRpcException( throw new LibraryRpcException(
LibraryRpcException.TypeCode.PARSE_EXCEPTION, LibraryRpcException.TypeCode.PARSE_EXCEPTION,
LibraryRpcException.SubModuleCode.PERSONAL_API, LibraryRpcException.SubModuleCode.CURRENT_LOAN,
LibraryRpcException.ErrorCode.PARSE_ERROR LibraryRpcException.ErrorCode.PARSE_ERROR
); );
} }

@ -2,12 +2,11 @@ package cn.wustlinghang.wusthelper.internal.library.services;
import cn.wustlinghang.mywust.core.request.service.library.LoanHistoryApiService; import cn.wustlinghang.mywust.core.request.service.library.LoanHistoryApiService;
import cn.wustlinghang.mywust.data.library.PagingResult; 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.data.library.origin.HistoryLoanBook;
import cn.wustlinghang.mywust.exception.ApiException; import cn.wustlinghang.mywust.exception.ApiException;
import cn.wustlinghang.mywust.exception.ParseException; import cn.wustlinghang.mywust.exception.ParseException;
import cn.wustlinghang.wusthelper.internal.library.exception.LibraryRpcException; import cn.wustlinghang.wusthelper.internal.rpc.exception.LibraryRpcException;
import cn.wustlinghang.wusthelper.rpc.exception.RpcException; import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException;
import jakarta.enterprise.context.ApplicationScoped; import jakarta.enterprise.context.ApplicationScoped;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -28,18 +27,18 @@ public class LoanHistoryService extends BaseService {
try { try {
return api.getLoanHistory(cookie, page, pageSize); return api.getLoanHistory(cookie, page, pageSize);
} catch (ApiException e) { } catch (ApiException e) {
throw wrapApiException(e, LibraryRpcException.SubModuleCode.PERSONAL_API); throw wrapApiException(e, LibraryRpcException.SubModuleCode.LOAN_HISTORY);
} catch (IOException e) { } catch (IOException e) {
throw new LibraryRpcException( throw new LibraryRpcException(
LibraryRpcException.TypeCode.NETWORK_EXCEPTION, LibraryRpcException.TypeCode.NETWORK_EXCEPTION,
LibraryRpcException.SubModuleCode.PERSONAL_API, LibraryRpcException.SubModuleCode.LOAN_HISTORY,
LibraryRpcException.ErrorCode.NETWORK_ERROR LibraryRpcException.ErrorCode.NETWORK_ERROR
); );
} catch (ParseException e) { } catch (ParseException e) {
log.error("解析错误:", e); log.error("解析错误:", e);
throw new LibraryRpcException( throw new LibraryRpcException(
LibraryRpcException.TypeCode.PARSE_EXCEPTION, LibraryRpcException.TypeCode.PARSE_EXCEPTION,
LibraryRpcException.SubModuleCode.PERSONAL_API, LibraryRpcException.SubModuleCode.LOAN_HISTORY,
LibraryRpcException.ErrorCode.PARSE_ERROR LibraryRpcException.ErrorCode.PARSE_ERROR
); );
} }

@ -3,7 +3,7 @@ package cn.wustlinghang.wusthelper.internal.library.services;
import cn.wustlinghang.mywust.core.request.service.auth.LibraryLogin; import cn.wustlinghang.mywust.core.request.service.auth.LibraryLogin;
import cn.wustlinghang.mywust.exception.ApiException; import cn.wustlinghang.mywust.exception.ApiException;
import cn.wustlinghang.mywust.network.RequestClientOption; 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 jakarta.enterprise.context.ApplicationScoped;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;

@ -5,8 +5,8 @@ import cn.wustlinghang.mywust.data.library.PagingResult;
import cn.wustlinghang.mywust.data.library.origin.BaseLoanBook; import cn.wustlinghang.mywust.data.library.origin.BaseLoanBook;
import cn.wustlinghang.mywust.exception.ApiException; import cn.wustlinghang.mywust.exception.ApiException;
import cn.wustlinghang.mywust.exception.ParseException; import cn.wustlinghang.mywust.exception.ParseException;
import cn.wustlinghang.wusthelper.internal.library.exception.LibraryRpcException; import cn.wustlinghang.wusthelper.internal.rpc.exception.LibraryRpcException;
import cn.wustlinghang.wusthelper.rpc.exception.RpcException; import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException;
import jakarta.enterprise.context.ApplicationScoped; import jakarta.enterprise.context.ApplicationScoped;
import java.io.IOException; import java.io.IOException;
@ -25,17 +25,17 @@ public class OverdueSoonService extends BaseService {
try { try {
return api.getOverdueSoon(cookie, page, pageSize); return api.getOverdueSoon(cookie, page, pageSize);
} catch (ApiException e) { } catch (ApiException e) {
throw wrapApiException(e, LibraryRpcException.SubModuleCode.PERSONAL_API); throw wrapApiException(e, LibraryRpcException.SubModuleCode.OVERDUE_SOON);
} catch (IOException e) { } catch (IOException e) {
throw new LibraryRpcException( throw new LibraryRpcException(
LibraryRpcException.TypeCode.NETWORK_EXCEPTION, LibraryRpcException.TypeCode.NETWORK_EXCEPTION,
LibraryRpcException.SubModuleCode.PERSONAL_API, LibraryRpcException.SubModuleCode.OVERDUE_SOON,
LibraryRpcException.ErrorCode.NETWORK_ERROR LibraryRpcException.ErrorCode.NETWORK_ERROR
); );
} catch (ParseException e) { } catch (ParseException e) {
throw new LibraryRpcException( throw new LibraryRpcException(
LibraryRpcException.TypeCode.PARSE_EXCEPTION, LibraryRpcException.TypeCode.PARSE_EXCEPTION,
LibraryRpcException.SubModuleCode.PERSONAL_API, LibraryRpcException.SubModuleCode.OVERDUE_SOON,
LibraryRpcException.ErrorCode.PARSE_ERROR LibraryRpcException.ErrorCode.PARSE_ERROR
); );
} }

@ -1,8 +0,0 @@
package cn.wustlinghang.wusthelper.internal.library.services;
import jakarta.enterprise.context.ApplicationScoped;
@ApplicationScoped
public class ParseService {
}

@ -5,8 +5,8 @@ import cn.wustlinghang.mywust.data.library.PagingResult;
import cn.wustlinghang.mywust.data.library.origin.BookSearchResult; import cn.wustlinghang.mywust.data.library.origin.BookSearchResult;
import cn.wustlinghang.mywust.exception.ApiException; import cn.wustlinghang.mywust.exception.ApiException;
import cn.wustlinghang.mywust.exception.ParseException; import cn.wustlinghang.mywust.exception.ParseException;
import cn.wustlinghang.wusthelper.internal.library.exception.LibraryRpcException; import cn.wustlinghang.wusthelper.internal.rpc.exception.LibraryRpcException;
import cn.wustlinghang.wusthelper.rpc.exception.RpcException; import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException;
import jakarta.enterprise.context.ApplicationScoped; import jakarta.enterprise.context.ApplicationScoped;
import java.io.IOException; import java.io.IOException;
@ -25,17 +25,17 @@ public class SearchService extends BaseService {
try { try {
return api.search(keyword, page, pageSize); return api.search(keyword, page, pageSize);
} catch (ApiException e) { } catch (ApiException e) {
throw wrapApiException(e, LibraryRpcException.SubModuleCode.PUBLIC_API); throw wrapApiException(e, LibraryRpcException.SubModuleCode.SEARCH);
} catch (IOException e) { } catch (IOException e) {
throw new LibraryRpcException( throw new LibraryRpcException(
LibraryRpcException.TypeCode.NETWORK_EXCEPTION, LibraryRpcException.TypeCode.NETWORK_EXCEPTION,
LibraryRpcException.SubModuleCode.PUBLIC_API, LibraryRpcException.SubModuleCode.SEARCH,
LibraryRpcException.ErrorCode.NETWORK_ERROR LibraryRpcException.ErrorCode.NETWORK_ERROR
); );
} catch (ParseException e) { } catch (ParseException e) {
throw new LibraryRpcException( throw new LibraryRpcException(
LibraryRpcException.TypeCode.PARSE_EXCEPTION, LibraryRpcException.TypeCode.PARSE_EXCEPTION,
LibraryRpcException.SubModuleCode.PERSONAL_API, LibraryRpcException.SubModuleCode.SEARCH,
LibraryRpcException.ErrorCode.PARSE_ERROR LibraryRpcException.ErrorCode.PARSE_ERROR
); );
} }

@ -1,7 +1,7 @@
package cn.wustlinghang.wusthelper.internal.physics.api.http; package cn.wustlinghang.wusthelper.internal.physics.api.http;
import cn.wustlinghang.wusthelper.internal.physics.services.LoginService; 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.validation.constraints.NotNull;
import jakarta.ws.rs.GET; import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path; import jakarta.ws.rs.Path;

@ -2,7 +2,7 @@ package cn.wustlinghang.wusthelper.internal.physics.api.http;
import cn.wustlinghang.mywust.data.physics.PhysicsCourse; import cn.wustlinghang.mywust.data.physics.PhysicsCourse;
import cn.wustlinghang.wusthelper.internal.physics.services.CourseTableService; 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.enterprise.context.ApplicationScoped;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import jakarta.ws.rs.GET; import jakarta.ws.rs.GET;

@ -2,7 +2,7 @@ package cn.wustlinghang.wusthelper.internal.physics.api.http;
import cn.wustlinghang.mywust.data.global.Score; import cn.wustlinghang.mywust.data.global.Score;
import cn.wustlinghang.wusthelper.internal.physics.services.ScoreService; 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.enterprise.context.ApplicationScoped;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import jakarta.ws.rs.GET; import jakarta.ws.rs.GET;

@ -1,7 +1,7 @@
package cn.wustlinghang.wusthelper.internal.physics.api.http.handler; 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 cn.wustlinghang.wusthelper.rpc.response.RpcResponse; import cn.wustlinghang.wusthelper.internal.rpc.response.RpcResponse;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.MediaType;

@ -1,6 +1,6 @@
package cn.wustlinghang.wusthelper.internal.physics.api.http.handler; 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.core.Response;
import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.ExceptionMapper;
import jakarta.ws.rs.ext.Provider; import jakarta.ws.rs.ext.Provider;

@ -1,6 +1,6 @@
package cn.wustlinghang.wusthelper.internal.physics.api.http.handler; 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.core.Response;
import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.ExceptionMapper;
import jakarta.ws.rs.ext.Provider; import jakarta.ws.rs.ext.Provider;

@ -1,7 +1,7 @@
package cn.wustlinghang.wusthelper.internal.physics.api.http.handler; package cn.wustlinghang.wusthelper.internal.physics.api.http.handler;
import cn.wustlinghang.mywust.exception.ParseException; 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.core.Response;
import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.ExceptionMapper;
import jakarta.ws.rs.ext.Provider; import jakarta.ws.rs.ext.Provider;

@ -1,6 +1,6 @@
package cn.wustlinghang.wusthelper.internal.physics.api.http.handler; 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.core.Response;
import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.ExceptionMapper;
import jakarta.ws.rs.ext.Provider; import jakarta.ws.rs.ext.Provider;

@ -1,6 +1,6 @@
package cn.wustlinghang.wusthelper.internal.physics.api.http.handler; 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.validation.ValidationException;
import jakarta.ws.rs.core.Response; import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.ExceptionMapper;

@ -1,7 +1,7 @@
package cn.wustlinghang.wusthelper.internal.physics.api.http.handler; package cn.wustlinghang.wusthelper.internal.physics.api.http.handler;
import cn.wustlinghang.wusthelper.internal.physics.exception.PhysicsRpcException; import cn.wustlinghang.wusthelper.internal.rpc.exception.PhysicsRpcException;
import cn.wustlinghang.wusthelper.rpc.exception.RpcException; import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException;
import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.Response; import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.ExceptionMapper;

@ -1,7 +1,7 @@
package cn.wustlinghang.wusthelper.internal.physics.api.http.interceptor; package cn.wustlinghang.wusthelper.internal.physics.api.http.interceptor;
import cn.wustlinghang.wusthelper.internal.physics.api.http.handler.BaseExceptionHandler; 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 com.fasterxml.jackson.databind.ObjectMapper;
import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.HttpHeaders; import jakarta.ws.rs.core.HttpHeaders;

@ -1,7 +1,7 @@
package cn.wustlinghang.wusthelper.internal.physics.services; package cn.wustlinghang.wusthelper.internal.physics.services;
import cn.wustlinghang.mywust.exception.ApiException; 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; import lombok.extern.slf4j.Slf4j;
@Slf4j @Slf4j

@ -5,8 +5,8 @@ import cn.wustlinghang.mywust.core.request.service.physics.PhysicsCourseApiServi
import cn.wustlinghang.mywust.data.physics.PhysicsCourse; import cn.wustlinghang.mywust.data.physics.PhysicsCourse;
import cn.wustlinghang.mywust.exception.ApiException; import cn.wustlinghang.mywust.exception.ApiException;
import cn.wustlinghang.mywust.network.RequestClientOption; import cn.wustlinghang.mywust.network.RequestClientOption;
import cn.wustlinghang.wusthelper.internal.physics.exception.PhysicsRpcException; import cn.wustlinghang.wusthelper.internal.rpc.exception.PhysicsRpcException;
import cn.wustlinghang.wusthelper.rpc.exception.RpcException; import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException;
import jakarta.enterprise.context.ApplicationScoped; import jakarta.enterprise.context.ApplicationScoped;
import java.io.IOException; import java.io.IOException;

@ -4,7 +4,7 @@ import cn.wustlinghang.mywust.core.request.service.auth.PhysicsLogin;
import cn.wustlinghang.mywust.exception.ApiException; import cn.wustlinghang.mywust.exception.ApiException;
import cn.wustlinghang.mywust.exception.ParseException; import cn.wustlinghang.mywust.exception.ParseException;
import cn.wustlinghang.mywust.network.RequestClientOption; 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 jakarta.enterprise.context.ApplicationScoped;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;

@ -6,8 +6,8 @@ import cn.wustlinghang.mywust.data.global.Score;
import cn.wustlinghang.mywust.exception.ApiException; import cn.wustlinghang.mywust.exception.ApiException;
import cn.wustlinghang.mywust.exception.ParseException; import cn.wustlinghang.mywust.exception.ParseException;
import cn.wustlinghang.mywust.network.RequestClientOption; import cn.wustlinghang.mywust.network.RequestClientOption;
import cn.wustlinghang.wusthelper.internal.physics.exception.PhysicsRpcException; import cn.wustlinghang.wusthelper.internal.rpc.exception.PhysicsRpcException;
import cn.wustlinghang.wusthelper.rpc.exception.RpcException; import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException;
import jakarta.enterprise.context.ApplicationScoped; import jakarta.enterprise.context.ApplicationScoped;
import java.io.IOException; import java.io.IOException;

@ -28,7 +28,7 @@
<dependency> <dependency>
<groupId>cn.wustlinghang.mywust</groupId> <groupId>cn.wustlinghang.mywust</groupId>
<artifactId>mywust-core</artifactId> <artifactId>mywust-core</artifactId>
<version>0.0.2-SNAPSHOT</version> <version>${mywust.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>cn.wustlinghang.mywust</groupId> <groupId>cn.wustlinghang.mywust</groupId>

@ -1,7 +1,7 @@
package cn.wustlinghang.wusthelper.internal.undergrad.api.http; package cn.wustlinghang.wusthelper.internal.undergrad.api.http;
import cn.wustlinghang.wusthelper.internal.undergrad.services.LoginService; 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.validation.constraints.NotNull;
import jakarta.ws.rs.GET; import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path; import jakarta.ws.rs.Path;

@ -2,7 +2,7 @@ package cn.wustlinghang.wusthelper.internal.undergrad.api.http;
import cn.wustlinghang.mywust.data.global.Course; import cn.wustlinghang.mywust.data.global.Course;
import cn.wustlinghang.wusthelper.internal.undergrad.services.CourseTableService; 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.enterprise.context.ApplicationScoped;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import jakarta.ws.rs.GET; import jakarta.ws.rs.GET;

@ -1,7 +1,7 @@
package cn.wustlinghang.wusthelper.internal.undergrad.api.http; package cn.wustlinghang.wusthelper.internal.undergrad.api.http;
import cn.wustlinghang.wusthelper.internal.undergrad.services.CreditStatusService; 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.enterprise.context.ApplicationScoped;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import jakarta.ws.rs.GET; import jakarta.ws.rs.GET;

@ -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.core.request.service.undergraduate.UndergradExamDelayApiService;
import cn.wustlinghang.mywust.data.global.Score; import cn.wustlinghang.mywust.data.global.Score;
import cn.wustlinghang.wusthelper.internal.undergrad.services.ExamActivitiesService; 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.enterprise.context.ApplicationScoped;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import jakarta.ws.rs.GET; import jakarta.ws.rs.GET;

@ -2,7 +2,7 @@ package cn.wustlinghang.wusthelper.internal.undergrad.api.http;
import cn.wustlinghang.mywust.data.undergrad.ExamDelayApplication; import cn.wustlinghang.mywust.data.undergrad.ExamDelayApplication;
import cn.wustlinghang.wusthelper.internal.undergrad.services.ExamDelayApplicationService; 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.enterprise.context.ApplicationScoped;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import jakarta.ws.rs.GET; import jakarta.ws.rs.GET;

@ -2,7 +2,7 @@ package cn.wustlinghang.wusthelper.internal.undergrad.api.http;
import cn.wustlinghang.mywust.data.global.Score; import cn.wustlinghang.mywust.data.global.Score;
import cn.wustlinghang.wusthelper.internal.undergrad.services.ScoreService; 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.enterprise.context.ApplicationScoped;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import jakarta.ws.rs.GET; import jakarta.ws.rs.GET;

@ -2,7 +2,7 @@ package cn.wustlinghang.wusthelper.internal.undergrad.api.http;
import cn.wustlinghang.mywust.data.global.StudentInfo; import cn.wustlinghang.mywust.data.global.StudentInfo;
import cn.wustlinghang.wusthelper.internal.undergrad.services.StudentInfoService; 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.enterprise.context.ApplicationScoped;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import jakarta.ws.rs.GET; import jakarta.ws.rs.GET;

@ -1,7 +1,7 @@
package cn.wustlinghang.wusthelper.internal.undergrad.api.http; package cn.wustlinghang.wusthelper.internal.undergrad.api.http;
import cn.wustlinghang.wusthelper.internal.undergrad.services.TrainingPlanService; 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.enterprise.context.ApplicationScoped;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import jakarta.ws.rs.GET; import jakarta.ws.rs.GET;

@ -1,7 +1,7 @@
package cn.wustlinghang.wusthelper.internal.undergrad.api.http.handler; 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 cn.wustlinghang.wusthelper.rpc.response.RpcResponse; import cn.wustlinghang.wusthelper.internal.rpc.response.RpcResponse;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.MediaType;

@ -1,6 +1,6 @@
package cn.wustlinghang.wusthelper.internal.undergrad.api.http.handler; 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.core.Response;
import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.ExceptionMapper;
import jakarta.ws.rs.ext.Provider; import jakarta.ws.rs.ext.Provider;

@ -1,6 +1,6 @@
package cn.wustlinghang.wusthelper.internal.undergrad.api.http.handler; 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.core.Response;
import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.ExceptionMapper;
import jakarta.ws.rs.ext.Provider; import jakarta.ws.rs.ext.Provider;

@ -1,7 +1,7 @@
package cn.wustlinghang.wusthelper.internal.undergrad.api.http.handler; package cn.wustlinghang.wusthelper.internal.undergrad.api.http.handler;
import cn.wustlinghang.mywust.exception.ParseException; 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.core.Response;
import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.ExceptionMapper;
import jakarta.ws.rs.ext.Provider; import jakarta.ws.rs.ext.Provider;

@ -1,6 +1,6 @@
package cn.wustlinghang.wusthelper.internal.undergrad.api.http.handler; 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.core.Response;
import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.ExceptionMapper;
import jakarta.ws.rs.ext.Provider; import jakarta.ws.rs.ext.Provider;

@ -1,6 +1,6 @@
package cn.wustlinghang.wusthelper.internal.undergrad.api.http.handler; 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.validation.ValidationException;
import jakarta.ws.rs.core.Response; import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.ExceptionMapper;

@ -1,7 +1,7 @@
package cn.wustlinghang.wusthelper.internal.undergrad.api.http.handler; package cn.wustlinghang.wusthelper.internal.undergrad.api.http.handler;
import cn.wustlinghang.wusthelper.internal.undergrad.exception.UndergradRpcException; import cn.wustlinghang.wusthelper.internal.rpc.exception.UndergradRpcException;
import cn.wustlinghang.wusthelper.rpc.exception.RpcException; import cn.wustlinghang.wusthelper.internal.rpc.exception.RpcException;
import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.Response; import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.ext.ExceptionMapper; import jakarta.ws.rs.ext.ExceptionMapper;

@ -1,7 +1,7 @@
package cn.wustlinghang.wusthelper.internal.undergrad.api.http.interceptor; package cn.wustlinghang.wusthelper.internal.undergrad.api.http.interceptor;
import cn.wustlinghang.wusthelper.internal.undergrad.api.http.handler.BaseExceptionHandler; 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 com.fasterxml.jackson.databind.ObjectMapper;
import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.HttpHeaders; import jakarta.ws.rs.core.HttpHeaders;

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save