Bläddra i källkod

jdk11 -> jdk17
springboot:2.6.15 -> springboot:3.2.1 (spring:5.3.27 -> spring:6.1.2)
springcloud:2021.0.9 -> springcloud:2023.0.1

1.使用 @Cacheable 注解时遇到 If you are using named parameters, ensure that the compiler uses the '-parameters' flag 错误, 使用 maven-compiler-plugin 添加 <compilerArgument>-parameters</compilerArgument> 配置
2.javax.servlet 更改为 jakarta.servlet
3.webflux 的 ServerHttpRequest#getMethodValue 方法更改为 ServerHttpRequest#getMethod#name
4.禁用 hystrix 和 turbine
5.禁用 shardingsphere
6.禁用 EnableAuthorizationServer 和 EnableResourceServer
7.spring-data-redis 的 RedisZSetCommands.Aggregate 和 RedisZSetCommands.Weights 变更为 zset.Aggregate 和 zset.Weights, redis 配置变更为 spring.data.redis
8.org.springframework.cloud.gateway.support.NotFoundException#getStatus 变更为 org.springframework.cloud.gateway.support.NotFoundException#getStatusCode
9.spring-security 6 不再支持 WebSecurityConfigurerAdapter, cn.reghao.tnb.account.app.security.WebSecurityConfig 中有较大变化
10.mysql:mysql-connector-java 变更为 com.mysql:mysql-connector-j, 版本变更为 8.0.31
11.mybatis-spring-boot-starter 版本变更为 3.0.4
12.配置文件中 server.tomcat.connection-timeout 和 server.tomcat.keep-alive-timeout 参数不再提供

reghao 7 månader sedan
förälder
incheckning
f9395a7b78
100 ändrade filer med 392 tillägg och 331 borttagningar
  1. 15 18
      README.md
  2. 1 1
      account/account-api/pom.xml
  3. 18 4
      account/account-service/pom.xml
  4. 1 1
      account/account-service/src/main/java/cn/reghao/tnb/account/app/config/ContextStartup.java
  5. 2 2
      account/account-service/src/main/java/cn/reghao/tnb/account/app/config/web/AccountInterceptor.java
  6. 3 3
      account/account-service/src/main/java/cn/reghao/tnb/account/app/config/web/CorsFilter.java
  7. 3 3
      account/account-service/src/main/java/cn/reghao/tnb/account/app/security/MyAuthenticationEntryPoint.java
  8. 2 2
      account/account-service/src/main/java/cn/reghao/tnb/account/app/security/OAuth2AuthorizationConfig.java
  9. 4 4
      account/account-service/src/main/java/cn/reghao/tnb/account/app/security/OAuth2ResourceConfig.java
  10. 51 21
      account/account-service/src/main/java/cn/reghao/tnb/account/app/security/WebSecurityConfig.java
  11. 3 3
      account/account-service/src/main/java/cn/reghao/tnb/account/app/security/filter/LoginRedirectFilter.java
  12. 3 3
      account/account-service/src/main/java/cn/reghao/tnb/account/app/security/form/AccountAuthFilter.java
  13. 3 3
      account/account-service/src/main/java/cn/reghao/tnb/account/app/security/form/ThirdPartyAuthFilter.java
  14. 3 3
      account/account-service/src/main/java/cn/reghao/tnb/account/app/security/handler/AuthFailureHandlerImpl.java
  15. 3 3
      account/account-service/src/main/java/cn/reghao/tnb/account/app/security/handler/AuthSuccessHandlerImpl.java
  16. 2 2
      account/account-service/src/main/java/cn/reghao/tnb/account/app/security/handler/LogoutHandlerImpl.java
  17. 3 3
      account/account-service/src/main/java/cn/reghao/tnb/account/app/security/handler/LogoutSuccessHandlerImpl.java
  18. 3 3
      account/account-service/src/main/java/cn/reghao/tnb/account/app/security/session/MySecurityContextRepository.java
  19. 2 2
      account/account-service/src/main/java/cn/reghao/tnb/account/app/security/session/MySessionAuthenticationStrategy.java
  20. 2 2
      account/account-service/src/main/java/cn/reghao/tnb/account/app/service/impl/AccountTokenServiceImpl.java
  21. 1 1
      account/account-service/src/main/java/cn/reghao/tnb/account/app/service/impl/LoginAttemptServiceImpl.java
  22. 6 5
      account/account-service/src/main/resources/application-cluster.yml
  23. 6 5
      account/account-service/src/main/resources/application-dev.yml
  24. 6 5
      account/account-service/src/main/resources/application-test.yml
  25. 2 2
      account/pom.xml
  26. 2 2
      auth/pom.xml
  27. 1 1
      common/pom.xml
  28. 1 1
      common/src/main/java/cn/reghao/tnb/common/exception/ControllerExceptionHandler.java
  29. 1 1
      common/src/main/java/cn/reghao/tnb/common/exception/FilterExceptionHandler.java
  30. 2 2
      content/content-api/pom.xml
  31. 8 8
      content/content-service/pom.xml
  32. 1 1
      content/content-service/src/main/java/cn/reghao/tnb/content/app/aop/TimeConsumedAspect.java
  33. 4 4
      content/content-service/src/main/java/cn/reghao/tnb/content/app/config/mybatis/DynamicDataSourceConfig.java
  34. 5 6
      content/content-service/src/main/java/cn/reghao/tnb/content/app/config/mybatis/SqlSessionConfig.java
  35. 5 5
      content/content-service/src/main/java/cn/reghao/tnb/content/app/config/shard/ModuloShardingTableAlgorithm.java
  36. 6 6
      content/content-service/src/main/java/cn/reghao/tnb/content/app/config/shard/ShardingDataSourceConfig.java
  37. 1 1
      content/content-service/src/main/java/cn/reghao/tnb/content/app/config/web/TokenFilter.java
  38. 2 2
      content/content-service/src/main/java/cn/reghao/tnb/content/app/config/web/UserRoleInterceptor.java
  39. 1 1
      content/content-service/src/main/java/cn/reghao/tnb/content/app/config/web/WebConfig.java
  40. 1 1
      content/content-service/src/main/java/cn/reghao/tnb/content/app/geo/service/EarthService.java
  41. 3 3
      content/content-service/src/main/java/cn/reghao/tnb/content/app/util/redis/ds/RedisSortedSetStr.java
  42. 5 5
      content/content-service/src/main/resources/application-cluster.yml
  43. 28 24
      content/content-service/src/main/resources/application-dev.yml
  44. 5 5
      content/content-service/src/main/resources/application-test.yml
  45. 2 2
      content/pom.xml
  46. 2 2
      data/data-api/pom.xml
  47. 4 4
      data/data-service/pom.xml
  48. 1 1
      data/data-service/src/main/java/cn/reghao/tnb/data/app/filter/GetRequestBodyFilter.java
  49. 5 5
      data/data-service/src/main/resources/application-dev.yml
  50. 6 5
      data/data-service/src/main/resources/application-test.yml
  51. 2 2
      data/pom.xml
  52. 2 2
      eureka/eureka-api/pom.xml
  53. 2 2
      eureka/eureka-server/pom.xml
  54. 2 2
      eureka/pom.xml
  55. 2 2
      file/file-api/pom.xml
  56. 6 6
      file/file-service/pom.xml
  57. 2 2
      file/file-service/src/main/java/cn/reghao/tnb/file/app/config/web/OssSdkInterceptor.java
  58. 1 1
      file/file-service/src/main/java/cn/reghao/tnb/file/app/config/web/TokenFilter.java
  59. 1 1
      file/file-service/src/main/java/cn/reghao/tnb/file/app/config/web/WebConfig.java
  60. 0 1
      file/file-service/src/main/java/cn/reghao/tnb/file/app/model/dto/AvatarUpdate.java
  61. 2 1
      file/file-service/src/main/java/cn/reghao/tnb/file/app/service/AvatarService.java
  62. 6 5
      file/file-service/src/main/resources/application-dev.yml
  63. 6 5
      file/file-service/src/main/resources/application-test.yml
  64. 2 2
      file/pom.xml
  65. 2 2
      gateway/pom.xml
  66. 1 1
      gateway/src/main/java/cn/reghao/tnb/gateway/lb/UserReactiveLoadBalancerClientFilter.java
  67. 1 1
      gateway/src/main/java/cn/reghao/tnb/gateway/log/GatewayLogService.java
  68. 6 5
      gateway/src/main/resources/application-dev.yml
  69. 6 5
      gateway/src/main/resources/application-test.yml
  70. 2 2
      message/message-api/pom.xml
  71. 8 8
      message/message-service/pom.xml
  72. 4 4
      message/message-service/src/main/java/cn/reghao/tnb/message/app/MessageApplication.java
  73. 1 1
      message/message-service/src/main/java/cn/reghao/tnb/message/app/ws/config/WebSocketInterceptor.java
  74. 2 2
      message/pom.xml
  75. 2 2
      oss/oss-api/pom.xml
  76. 3 3
      oss/oss-sdk/pom.xml
  77. 5 5
      oss/oss-store/pom.xml
  78. 1 1
      oss/oss-store/src/main/java/cn/reghao/tnb/oss/store/config/exception/ControllerExceptionHandler.java
  79. 1 1
      oss/oss-store/src/main/java/cn/reghao/tnb/oss/store/config/exception/FilterExceptionHandler.java
  80. 2 2
      oss/oss-store/src/main/java/cn/reghao/tnb/oss/store/config/inerceptor/AccessLogInterceptor.java
  81. 1 1
      oss/oss-store/src/main/java/cn/reghao/tnb/oss/store/config/inerceptor/TokenFilter.java
  82. 1 1
      oss/oss-store/src/main/java/cn/reghao/tnb/oss/store/config/web/WebConfig.java
  83. 1 1
      oss/oss-store/src/main/java/cn/reghao/tnb/oss/store/controller/ObjectGetController.java
  84. 1 1
      oss/oss-store/src/main/java/cn/reghao/tnb/oss/store/service/GetObjectService.java
  85. 4 4
      oss/oss-store/src/main/java/cn/reghao/tnb/oss/store/tomcat/GlobalServlet.java
  86. 1 1
      oss/oss-store/src/main/java/cn/reghao/tnb/oss/store/util/ObjectUtil.java
  87. 0 3
      oss/oss-store/src/main/resources/application.yml
  88. 2 2
      oss/pom.xml
  89. 19 8
      pom.xml
  90. 2 2
      search/pom.xml
  91. 2 2
      search/search-api/pom.xml
  92. 5 5
      search/search-service/pom.xml
  93. 1 1
      search/search-service/src/main/java/cn/reghao/tnb/search/app/config/web/TokenFilter.java
  94. 1 1
      search/search-service/src/main/java/cn/reghao/tnb/search/app/config/web/WebConfig.java
  95. 2 2
      user/pom.xml
  96. 2 2
      user/user-api/pom.xml
  97. 6 6
      user/user-service/pom.xml
  98. 1 1
      user/user-service/src/main/java/cn/reghao/tnb/user/app/config/web/TokenFilter.java
  99. 1 1
      user/user-service/src/main/java/cn/reghao/tnb/user/app/config/web/WebConfig.java
  100. 6 5
      user/user-service/src/main/resources/application-cluster.yml

+ 15 - 18
README.md

@@ -1,15 +1,22 @@
 # tnb
-微服务实践, 本项目实现了一个类似 bilibili 的 VOD 系统后端
-> 也包含 mall, exam, im, geo 等模块
-> 
-> 前台应用包括 Web 应用和 Android 应用
+微服务实践, 本项目实现了一个类似 bilibili 的 VOD 系统后端 
+> 客户端包括 Web 应用和 Android 应用
 > > 分别由 [tnbapp](https://git.reghao.cn/reghao/tnbapp) 项目和 [tnbdroid](https://git.reghao.cn/reghao/tnbdroid) 项目提供
 
 ## 依赖
+### jdk 和框架版本
 - os:Linux
 > Windows 系统理论上可以运行, 但尚未实践
-- jdk:11
-- maven:3.9
+- jdk:17
+- maven:3.9.6
+- spring:6.1.2
+> https://github.com/spring-projects/spring-framework/wiki/Spring-Framework-6.1-Release-Notes
+- springboot:3.2.1
+> https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.2-Release-Notes
+- springcloud:2023.0.1
+> https://github.com/spring-cloud/spring-cloud-release/wiki/Spring-Cloud-2023.0-Release-Notes
+
+### 第三方版本
 - mysql:5.7
 - redis
 - rabbitmq
@@ -20,14 +27,6 @@
 - nacos-server:v2.4.1
 > 仅 search-service 依赖
 
-## Spring 版本
-- Spring:5.3.27
-> https://github.com/spring-projects/spring-framework/wiki/Spring-Framework-5.3-Release-Notes
-- SpringBoot:2.6.15
-> https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.6-Release-Notes
-- SpringCloud:2021.0.9
-> https://github.com/spring-cloud/spring-cloud-release/wiki/Spring-Cloud-2021.0-Release-Notes
-
 ## 模块
 tnb 项目模块:
 - eureka:6060
@@ -39,6 +38,7 @@ tnb 项目模块:
 - content:6005
 - data:6006
 - search:6007
+- oss-store:4010
 
 ## 构建部署
 ### pull 项目源码
@@ -74,8 +74,5 @@ bash shutdown.sh
 ```
 > 执行 shutdown.sh 会结束 tnb 项目中的各个应用
 
-### 存储系统
-正常使用 VOD 系统还需要运行 [oss](https://git.reghao.cn/reghao/oss) 项目
-
 ## 其他
-本项目模块太多, 构建部署都太过繁琐, 推荐使用 [devops](https://git.reghao.cn/reghao/devops) 项目来自动构建部署应用.
+本项目模块太多, 构建部署都太过繁琐, 推荐使用 [bnt](https://git.reghao.cn/reghao/bnt) 项目提供的 devops 系统来自动构建部署应用.

+ 1 - 1
account/account-api/pom.xml

@@ -17,7 +17,7 @@
         <dependency>
             <groupId>cn.reghao.jutil</groupId>
             <artifactId>web</artifactId>
-            <version>1.0.0-SNAPSHOT</version>
+            <version>jdk17-SNAPSHOT</version>
             <scope>compile</scope>
         </dependency>
     </dependencies>

+ 18 - 4
account/account-service/pom.xml

@@ -73,9 +73,9 @@
         </dependency>
 
         <dependency>
-            <groupId>mysql</groupId>
-            <artifactId>mysql-connector-java</artifactId>
-            <version>8.0.17</version>
+            <groupId>com.mysql</groupId>
+            <artifactId>mysql-connector-j</artifactId>
+            <version>8.0.31</version>
         </dependency>
         <dependency>
             <groupId>com.zaxxer</groupId>
@@ -85,7 +85,7 @@
         <dependency>
             <groupId>org.mybatis.spring.boot</groupId>
             <artifactId>mybatis-spring-boot-starter</artifactId>
-            <version>2.1.1</version>
+            <version>3.0.4</version>
         </dependency>
 
         <dependency>
@@ -179,6 +179,20 @@
                 </configuration>
             </plugin>
 
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.11.0</version>
+                <configuration>
+                    <compilerArgs>
+                        <arg>-parameters</arg>
+                    </compilerArgs>
+                    <source>${java.version}</source>
+                    <target>${java.version}</target>
+                    <encoding>${project.build.sourceEncoding}</encoding>
+                </configuration>
+            </plugin>
+
             <plugin>
                 <groupId>org.springframework.boot</groupId>
                 <artifactId>spring-boot-maven-plugin</artifactId>

+ 1 - 1
account/account-service/src/main/java/cn/reghao/tnb/account/app/config/ContextStartup.java

@@ -8,7 +8,7 @@ import org.springframework.core.annotation.Order;
 import org.springframework.stereotype.Component;
 import org.springframework.web.context.ServletContextAware;
 
-import javax.servlet.ServletContext;
+import jakarta.servlet.ServletContext;
 
 /**
  * 加载配置信息到系统

+ 2 - 2
account/account-service/src/main/java/cn/reghao/tnb/account/app/config/web/AccountInterceptor.java

@@ -9,8 +9,8 @@ import org.springframework.stereotype.Component;
 import org.springframework.web.servlet.HandlerInterceptor;
 import org.springframework.web.servlet.ModelAndView;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
 
 /**
  * 用户访问日志拦截器

+ 3 - 3
account/account-service/src/main/java/cn/reghao/tnb/account/app/config/web/CorsFilter.java

@@ -1,8 +1,8 @@
 package cn.reghao.tnb.account.app.config.web;
 
-import javax.servlet.*;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.*;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.util.List;
 

+ 3 - 3
account/account-service/src/main/java/cn/reghao/tnb/account/app/security/MyAuthenticationEntryPoint.java

@@ -6,9 +6,9 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.security.core.AuthenticationException;
 import org.springframework.security.web.AuthenticationEntryPoint;
 
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.io.PrintWriter;
 

+ 2 - 2
account/account-service/src/main/java/cn/reghao/tnb/account/app/security/OAuth2AuthorizationConfig.java

@@ -28,8 +28,8 @@ import javax.sql.DataSource;
  * @author reghao
  * @date 2023-02-07 15:18:20
  */
-@Configuration
-@EnableAuthorizationServer
+//@Configuration
+//@EnableAuthorizationServer
 public class OAuth2AuthorizationConfig extends AuthorizationServerConfigurerAdapter {
     @Autowired
     @Qualifier("authenticationManagerBean")

+ 4 - 4
account/account-service/src/main/java/cn/reghao/tnb/account/app/security/OAuth2ResourceConfig.java

@@ -10,8 +10,8 @@ import org.springframework.security.oauth2.config.annotation.web.configurers.Res
  * @author reghao
  * @date 2023-07-26 10:12:34
  */
-@Configuration
-@EnableResourceServer
+//@Configuration
+//@EnableResourceServer
 public class OAuth2ResourceConfig extends ResourceServerConfigurerAdapter {
     private static final String resourceId = "account_info";
 
@@ -23,7 +23,7 @@ public class OAuth2ResourceConfig extends ResourceServerConfigurerAdapter {
 
     @Override
     public void configure(HttpSecurity http) throws Exception {
-        http
+/*        http
                 .requestMatchers()
                 // 保险起见,防止被主过滤器链路拦截
                 .antMatchers("/api/account/resource/**")
@@ -33,6 +33,6 @@ public class OAuth2ResourceConfig extends ResourceServerConfigurerAdapter {
                 .antMatchers("/api/account/resource/user/**").access("#oauth2.hasScope('get_user_info')");
 
         http.exceptionHandling()
-                .authenticationEntryPoint(new MyAuthenticationEntryPoint());
+                .authenticationEntryPoint(new MyAuthenticationEntryPoint());*/
     }
 }

+ 51 - 21
account/account-service/src/main/java/cn/reghao/tnb/account/app/security/WebSecurityConfig.java

@@ -12,12 +12,11 @@ import org.springframework.context.annotation.Configuration;
 import org.springframework.security.access.hierarchicalroles.RoleHierarchy;
 import org.springframework.security.access.hierarchicalroles.RoleHierarchyImpl;
 import org.springframework.security.authentication.AuthenticationManager;
-import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
+import org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration;
 import org.springframework.security.config.annotation.web.builders.HttpSecurity;
-import org.springframework.security.config.annotation.web.builders.WebSecurity;
 import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
-import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
 import org.springframework.security.config.http.SessionCreationPolicy;
+import org.springframework.security.web.SecurityFilterChain;
 import org.springframework.security.web.authentication.AuthenticationFailureHandler;
 import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
 import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
@@ -33,7 +32,7 @@ import org.springframework.security.web.context.SecurityContextPersistenceFilter
  */
 @Configuration
 @EnableWebSecurity
-public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
+public class WebSecurityConfig {
     private final String loginPage = "/login";
     private final String loginApi = "/api/auth/signin";
     private final String logoutApi = "/api/auth/signout";
@@ -60,6 +59,33 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
         this.logoutSuccessHandler = logoutSuccessHandler;
     }
 
+    @Bean
+    public SecurityFilterChain filterChain(HttpSecurity http, AuthenticationManager authenticationManager) throws Exception {
+        http
+                .authorizeHttpRequests(request -> request
+                        .requestMatchers("/api/account/**").authenticated()
+                        .anyRequest().permitAll())
+                .addFilterAfter(new LoginRedirectFilter(), SecurityContextPersistenceFilter.class)
+                .addFilterBefore(accountAuthFilter(authenticationManager), UsernamePasswordAuthenticationFilter.class)
+                .addFilterBefore(thirdPartyAuthFilter(authenticationManager), UsernamePasswordAuthenticationFilter.class)
+                .securityContext().securityContextRepository(mySecurityContextRepository)
+                .and()
+                .formLogin().disable()
+                .logout().logoutUrl(logoutApi).addLogoutHandler(logoutHandler).logoutSuccessHandler(logoutSuccessHandler)
+                .and()
+                .exceptionHandling().authenticationEntryPoint(new MyAuthenticationEntryPoint())
+                .and()
+                .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.ALWAYS).sessionAuthenticationStrategy(new MySessionAuthenticationStrategy())
+                .and()
+                .rememberMe().disable()
+                .cors().disable()
+                .csrf().disable()
+                .headers().disable()
+                .authenticationProvider(userAuthProvider);
+
+        return http.build();
+    }
+
     /**
      * 放行静态资源
      *
@@ -67,15 +93,15 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
      * @return
      * @date 2023-08-02 11:09:45
      */
-    @Override
+    /*@Override
     public void configure(WebSecurity web) {
         web.ignoring()
                 .antMatchers("/dist/**")
                 .antMatchers("/classic/**")
                 .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/v2/**", "/webjars/**");
-    }
+    }*/
 
-    @Override
+    /*@Override
     public void configure(HttpSecurity http) throws Exception {
         // 在 FilterSecurityInterceptor 中用于权限判定
         http.authorizeRequests()
@@ -94,8 +120,8 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
 
         // 配置 UsernamePasswordAuthenticationFilter, 禁用 UsernamePasswordAuthenticationFilter
         http.formLogin().disable();
-                /*.loginPage(loginPage)
-                .loginProcessingUrl(loginApi);*/
+                *//*.loginPage(loginPage)
+                .loginProcessingUrl(loginApi);*//*
 
         // 配置 LogoutFilter
         http.logout()
@@ -114,13 +140,13 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
                 .sessionAuthenticationStrategy(new MySessionAuthenticationStrategy());
                 // spring security 中禁用 session
                 //.sessionCreationPolicy(SessionCreationPolicy.STATELESS);
-                /*.maximumSessions(1)
-                .expiredUrl(loginPage);*/
+                *//*.maximumSessions(1)
+                .expiredUrl(loginPage);*//*
 
         // 配置 RememberMeAuthenticationFilter, 禁用 RememberMeAuthenticationFilter
         http.rememberMe().disable();
-                /*.key("DExNzAyNTQ2Nzo3NDI3MTNhYmM5MGE5")
-                .rememberMeParameter("rememberMe");*/
+                *//*.key("DExNzAyNTQ2Nzo3NDI3MTNhYmM5MGE5")
+                .rememberMeParameter("rememberMe");*//*
 
         // 配置 CorsFilter, 禁用 CorsFilter
         http.cors().disable();
@@ -130,7 +156,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
 
         // 配置 HeaderWriterFilter, 禁用 HeaderWriterFilter
         http.headers().disable();
-    }
+    }*/
 
     /**
      * 配置认证管理器
@@ -139,10 +165,14 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
      * @return
      * @date 2021-07-25 下午2:28
      */
-    @Bean
+    /*@Bean
     @Override
     public AuthenticationManager authenticationManagerBean() throws Exception {
         return super.authenticationManagerBean();
+    }*/
+    @Bean
+    public AuthenticationManager authenticationManager(AuthenticationConfiguration authenticationConfiguration) throws Exception {
+        return authenticationConfiguration.getAuthenticationManager();
     }
 
     /**
@@ -152,10 +182,10 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
      * @return
      * @date 2021-07-25 下午2:31
      */
-    @Override
+    /*@Override
     protected void configure(AuthenticationManagerBuilder auth) throws Exception {
         auth.authenticationProvider(userAuthProvider);
-    }
+    }*/
 
     /**
      * 配置账号密码登入 filter
@@ -164,9 +194,9 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
      * @return
      * @date 2022-07-06 上午9:54
      */
-    private AccountAuthFilter accountAuthFilter() throws Exception {
+    private AccountAuthFilter accountAuthFilter(AuthenticationManager authenticationManager) throws Exception {
         AccountAuthFilter filter = new AccountAuthFilter(loginApi, "POST", accountLoginService);
-        filter.setAuthenticationManager(super.authenticationManager());
+        filter.setAuthenticationManager(authenticationManager);
         filter.setAuthenticationSuccessHandler(successHandler);
         filter.setAuthenticationFailureHandler(failureHandler);
         return filter;
@@ -179,9 +209,9 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
      * @return
      * @date 2023-07-31 16:14:14
      */
-    private ThirdPartyAuthFilter thirdPartyAuthFilter() throws Exception {
+    private ThirdPartyAuthFilter thirdPartyAuthFilter(AuthenticationManager authenticationManager) throws Exception {
         ThirdPartyAuthFilter filter = new ThirdPartyAuthFilter("/oauth/redirect/**", "GET");
-        filter.setAuthenticationManager(super.authenticationManager());
+        filter.setAuthenticationManager(authenticationManager);
         filter.setAuthenticationSuccessHandler(successHandler);
         filter.setAuthenticationFailureHandler(failureHandler);
         return filter;

+ 3 - 3
account/account-service/src/main/java/cn/reghao/tnb/account/app/security/filter/LoginRedirectFilter.java

@@ -4,9 +4,9 @@ import org.springframework.security.core.context.SecurityContext;
 import org.springframework.security.core.context.SecurityContextHolder;
 import org.springframework.web.filter.GenericFilterBean;
 
-import javax.servlet.*;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.*;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
 import java.io.IOException;
 
 /**

+ 3 - 3
account/account-service/src/main/java/cn/reghao/tnb/account/app/security/form/AccountAuthFilter.java

@@ -8,9 +8,9 @@ import org.springframework.security.core.AuthenticationException;
 import org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter;
 import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
 
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
 import java.io.IOException;
 
 /**

+ 3 - 3
account/account-service/src/main/java/cn/reghao/tnb/account/app/security/form/ThirdPartyAuthFilter.java

@@ -9,9 +9,9 @@ import org.springframework.security.core.AuthenticationException;
 import org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter;
 import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
 
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
 import java.io.IOException;
 
 /**

+ 3 - 3
account/account-service/src/main/java/cn/reghao/tnb/account/app/security/handler/AuthFailureHandlerImpl.java

@@ -8,9 +8,9 @@ import org.springframework.security.core.AuthenticationException;
 import org.springframework.security.web.authentication.AuthenticationFailureHandler;
 import org.springframework.stereotype.Component;
 
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.io.PrintWriter;
 

+ 3 - 3
account/account-service/src/main/java/cn/reghao/tnb/account/app/security/handler/AuthSuccessHandlerImpl.java

@@ -15,9 +15,9 @@ import org.springframework.security.web.authentication.AuthenticationSuccessHand
 import org.springframework.security.web.savedrequest.SavedRequest;
 import org.springframework.stereotype.Component;
 
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.io.PrintWriter;
 

+ 2 - 2
account/account-service/src/main/java/cn/reghao/tnb/account/app/security/handler/LogoutHandlerImpl.java

@@ -5,8 +5,8 @@ import org.springframework.security.core.Authentication;
 import org.springframework.security.web.authentication.logout.LogoutHandler;
 import org.springframework.stereotype.Component;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
 
 /**
  * @author reghao

+ 3 - 3
account/account-service/src/main/java/cn/reghao/tnb/account/app/security/handler/LogoutSuccessHandlerImpl.java

@@ -5,9 +5,9 @@ import org.springframework.security.core.Authentication;
 import org.springframework.security.web.authentication.logout.LogoutSuccessHandler;
 import org.springframework.stereotype.Component;
 
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.io.PrintWriter;
 

+ 3 - 3
account/account-service/src/main/java/cn/reghao/tnb/account/app/security/session/MySecurityContextRepository.java

@@ -10,9 +10,9 @@ import org.springframework.security.web.context.HttpRequestResponseHolder;
 import org.springframework.security.web.context.SecurityContextRepository;
 import org.springframework.stereotype.Component;
 
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.Cookie;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
 
 /**
  * 提供给 SecurityContextPersistenceFilter 使用的 SecurityContextRepository 实现

+ 2 - 2
account/account-service/src/main/java/cn/reghao/tnb/account/app/security/session/MySessionAuthenticationStrategy.java

@@ -4,8 +4,8 @@ import org.springframework.security.core.Authentication;
 import org.springframework.security.core.session.SessionRegistry;
 import org.springframework.security.web.authentication.session.SessionAuthenticationStrategy;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
 
 /**
  * 配置 SessionManagementFilter 中的 SessionAuthenticationStrategy

+ 2 - 2
account/account-service/src/main/java/cn/reghao/tnb/account/app/service/impl/AccountTokenServiceImpl.java

@@ -29,8 +29,8 @@ import org.springframework.session.data.redis.RedisIndexedSessionRepository;
 import org.springframework.session.web.http.SessionRepositoryFilter;
 import org.springframework.stereotype.Service;
 
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.Cookie;
+import jakarta.servlet.http.HttpServletRequest;
 import java.security.NoSuchAlgorithmException;
 import java.security.PrivateKey;
 import java.security.interfaces.RSAPrivateKey;

+ 1 - 1
account/account-service/src/main/java/cn/reghao/tnb/account/app/service/impl/LoginAttemptServiceImpl.java

@@ -16,7 +16,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.security.web.authentication.preauth.PreAuthenticatedCredentialsNotFoundException;
 import org.springframework.stereotype.Service;
 
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
 import java.util.*;
 import java.util.stream.Collectors;
 

+ 6 - 5
account/account-service/src/main/resources/application-cluster.yml

@@ -6,11 +6,12 @@ spring:
   cloud:
     discovery:
       enabled: true
-  redis:
-    database: 0
-    host: 192.168.0.211
-    port: 6379
-    password: Test@123456
+  data:
+    redis:
+      database: 0
+      host: 192.168.0.211
+      port: 6379
+      password: Test@123456
   rabbitmq:
     addresses: 192.168.0.211:5672,192.168.0.212:5672,192.168.0.213:5672
     virtual-host: /

+ 6 - 5
account/account-service/src/main/resources/application-dev.yml

@@ -6,11 +6,12 @@ spring:
   cloud:
     discovery:
       enabled: true
-  redis:
-    database: 0
-    host: 127.0.0.1
-    port: 6379
-    password: Dev@123456
+  data:
+    redis:
+      database: 0
+      host: 127.0.0.1
+      port: 6379
+      password: Dev@123456
   rabbitmq:
     host: 127.0.0.1
     port: 5672

+ 6 - 5
account/account-service/src/main/resources/application-test.yml

@@ -6,11 +6,12 @@ spring:
   cloud:
     discovery:
       enabled: true
-  redis:
-    database: 0
-    host: 192.168.0.209
-    port: 6379
-    password: Test@123456
+  data:
+    redis:
+      database: 0
+      host: 192.168.0.209
+      port: 6379
+      password: Test@123456
   rabbitmq:
     host: 192.168.0.209
     port: 5672

+ 2 - 2
account/pom.xml

@@ -19,7 +19,7 @@
 
     <properties>
         <java.version>11</java.version>
-        <maven.compiler.source>11</maven.compiler.source>
-        <maven.compiler.target>11</maven.compiler.target>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
     </properties>
 </project>

+ 2 - 2
auth/pom.xml

@@ -13,8 +13,8 @@
     <version>1.0.0-SNAPSHOT</version>
 
     <properties>
-        <maven.compiler.source>11</maven.compiler.source>
-        <maven.compiler.target>11</maven.compiler.target>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
     </properties>
 
     <dependencies>

+ 1 - 1
common/pom.xml

@@ -16,7 +16,7 @@
         <dependency>
             <groupId>cn.reghao.jutil</groupId>
             <artifactId>web</artifactId>
-            <version>1.0.0-SNAPSHOT</version>
+            <version>jdk17-SNAPSHOT</version>
         </dependency>
 
         <dependency>

+ 1 - 1
common/src/main/java/cn/reghao/tnb/common/exception/ControllerExceptionHandler.java

@@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.ControllerAdvice;
 import org.springframework.web.bind.annotation.ExceptionHandler;
 import org.springframework.web.bind.annotation.ResponseBody;
 
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
 import java.util.stream.Collectors;
 
 /**

+ 1 - 1
common/src/main/java/cn/reghao/tnb/common/exception/FilterExceptionHandler.java

@@ -10,7 +10,7 @@ import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
 import java.util.HashMap;
 import java.util.Map;
 

+ 2 - 2
content/content-api/pom.xml

@@ -14,8 +14,8 @@
     <version>1.0.0-SNAPSHOT</version>
 
     <properties>
-        <maven.compiler.source>11</maven.compiler.source>
-        <maven.compiler.target>11</maven.compiler.target>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
     </properties>
 
     <dependencies>

+ 8 - 8
content/content-service/pom.xml

@@ -13,8 +13,8 @@
     <artifactId>content-service</artifactId>
 
     <properties>
-        <maven.compiler.source>11</maven.compiler.source>
-        <maven.compiler.target>11</maven.compiler.target>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
     </properties>
 
     <dependencies>
@@ -56,9 +56,9 @@
         </dependency>
 
         <dependency>
-            <groupId>mysql</groupId>
-            <artifactId>mysql-connector-java</artifactId>
-            <version>8.0.17</version>
+            <groupId>com.mysql</groupId>
+            <artifactId>mysql-connector-j</artifactId>
+            <version>8.0.31</version>
         </dependency>
         <dependency>
             <groupId>com.zaxxer</groupId>
@@ -68,9 +68,9 @@
         <dependency>
             <groupId>org.mybatis.spring.boot</groupId>
             <artifactId>mybatis-spring-boot-starter</artifactId>
-            <version>2.1.1</version>
+            <version>3.0.4</version>
         </dependency>
-        <dependency>
+        <!--<dependency>
             <groupId>org.apache.shardingsphere</groupId>
             <artifactId>sharding-jdbc-spring-boot-starter</artifactId>
             <version>4.1.1</version>
@@ -79,7 +79,7 @@
             <groupId>org.apache.shardingsphere</groupId>
             <artifactId>sharding-core-common</artifactId>
             <version>4.1.1</version>
-        </dependency>
+        </dependency>-->
 
         <dependency>
             <groupId>org.springframework.boot</groupId>

+ 1 - 1
content/content-service/src/main/java/cn/reghao/tnb/content/app/aop/TimeConsumedAspect.java

@@ -6,7 +6,7 @@ import org.aspectj.lang.JoinPoint;
 import org.aspectj.lang.annotation.*;
 import org.springframework.stereotype.Component;
 
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
 
 /**
  * @author reghao

+ 4 - 4
content/content-service/src/main/java/cn/reghao/tnb/content/app/config/mybatis/DynamicDataSourceConfig.java

@@ -1,7 +1,7 @@
 package cn.reghao.tnb.content.app.config.mybatis;
 
 import cn.reghao.tnb.content.app.config.DataSourceType;
-import org.apache.shardingsphere.shardingjdbc.jdbc.core.datasource.ShardingDataSource;
+//import org.apache.shardingsphere.shardingjdbc.jdbc.core.datasource.ShardingDataSource;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 
@@ -13,9 +13,9 @@ import java.util.Map;
  * @author reghao
  * @date 2023-12-31 01:02:45
  */
-@Configuration
+//@Configuration
 public class DynamicDataSourceConfig {
-    @Bean(name = "dynamicDataSource")
+    /*@Bean(name = "dynamicDataSource")
     public DynamicDataSource dynamicDataSource(DataSource dataSource) throws Exception {
         if (dataSource instanceof ShardingDataSource) {
             ShardingDataSource shardingDataSource = (ShardingDataSource) dataSource;
@@ -26,7 +26,7 @@ public class DynamicDataSourceConfig {
         }
 
         throw new Exception("DataSource is not ShardingDataSource");
-    }
+    }*/
 
     private DynamicDataSource getDynamicDataSource(DataSource master, DataSource slave) {
         Map<Object, Object> targetDataSources = new HashMap<>();

+ 5 - 6
content/content-service/src/main/java/cn/reghao/tnb/content/app/config/mybatis/SqlSessionConfig.java

@@ -1,7 +1,7 @@
 package cn.reghao.tnb.content.app.config.mybatis;
 
 import org.apache.ibatis.session.SqlSessionFactory;
-import org.apache.shardingsphere.shardingjdbc.jdbc.core.datasource.ShardingDataSource;
+//import org.apache.shardingsphere.shardingjdbc.jdbc.core.datasource.ShardingDataSource;
 import org.mybatis.spring.SqlSessionFactoryBean;
 import org.mybatis.spring.SqlSessionTemplate;
 import org.mybatis.spring.annotation.MapperScan;
@@ -23,7 +23,6 @@ import java.util.Map;
 @Configuration
 @MapperScan(basePackages = {
         "cn.reghao.tnb.content.app.vod.db.mapper",
-        "cn.reghao.tnb.content.app.disk.db.mapper",
         "cn.reghao.tnb.content.app.data.db.mapper",
         "cn.reghao.tnb.content.app.chat.db.mapper",
         "cn.reghao.tnb.content.app.exam.db.mapper",
@@ -33,7 +32,7 @@ import java.util.Map;
         sqlSessionFactoryRef = "sqlSessionFactory")
 public class SqlSessionConfig {
     //@Bean(name = "sqlSessionTemplate")
-    public SqlSessionTemplate sqlSessionTemplate(@Qualifier("shardingDataSource") DataSource dataSource) throws Exception {
+    /*public SqlSessionTemplate sqlSessionTemplate(@Qualifier("shardingDataSource") DataSource dataSource) throws Exception {
         if (dataSource instanceof ShardingDataSource) {
             ShardingDataSource shardingDataSource = (ShardingDataSource) dataSource;
             Map<String, DataSource> map = shardingDataSource.getDataSourceMap();
@@ -52,7 +51,7 @@ public class SqlSessionConfig {
         }
 
         throw new Exception("DataSource is not ShardingDataSource");
-    }
+    }*/
 
     private SqlSessionFactory getSqlSessionFactory(String databaseId, DataSource dataSource) throws Exception {
         SqlSessionFactoryBean factoryBean = new SqlSessionFactoryBean();
@@ -72,7 +71,7 @@ public class SqlSessionConfig {
     }
 
     @Bean(name = "sqlSessionFactory")
-    public SqlSessionFactory sqlSessionFactory(@Qualifier("dynamicDataSource") DataSource dataSource) throws Exception {
+    public SqlSessionFactory sqlSessionFactory(/*@Qualifier("dynamicDataSource") */DataSource dataSource) throws Exception {
         SqlSessionFactoryBean factoryBean = new SqlSessionFactoryBean();
         factoryBean.setDataSource(dataSource);
         factoryBean.setPlugins(pageListInterceptor());
@@ -93,7 +92,7 @@ public class SqlSessionConfig {
     }
 
     @Bean(value = "transactionManager")
-    public PlatformTransactionManager annotationDrivenTransactionManager(@Qualifier("dynamicDataSource") DataSource dataSource) {
+    public PlatformTransactionManager annotationDrivenTransactionManager(/*@Qualifier("dynamicDataSource") */DataSource dataSource) {
         return new DataSourceTransactionManager(dataSource);
     }
 }

+ 5 - 5
content/content-service/src/main/java/cn/reghao/tnb/content/app/config/shard/ModuloShardingTableAlgorithm.java

@@ -1,7 +1,7 @@
 package cn.reghao.tnb.content.app.config.shard;
 
-import org.apache.shardingsphere.api.sharding.standard.PreciseShardingAlgorithm;
-import org.apache.shardingsphere.api.sharding.standard.PreciseShardingValue;
+//import org.apache.shardingsphere.api.sharding.standard.PreciseShardingAlgorithm;
+//import org.apache.shardingsphere.api.sharding.standard.PreciseShardingValue;
 
 import java.util.Collection;
 
@@ -9,9 +9,9 @@ import java.util.Collection;
  * @author reghao
  * @date 2022-03-15 21:01:01
  */
-public class ModuloShardingTableAlgorithm implements PreciseShardingAlgorithm<String> {
-    @Override
+public class ModuloShardingTableAlgorithm /*implements PreciseShardingAlgorithm<String>*/ {
+    /*@Override
     public String doSharding(Collection<String> var1, PreciseShardingValue<String> var2) {
         return "qq_mobile_$->{qq % 4}";
-    }
+    }*/
 }

+ 6 - 6
content/content-service/src/main/java/cn/reghao/tnb/content/app/config/shard/ShardingDataSourceConfig.java

@@ -1,9 +1,9 @@
 package cn.reghao.tnb.content.app.config.shard;
 
-import org.apache.shardingsphere.api.config.sharding.ShardingRuleConfiguration;
-import org.apache.shardingsphere.api.config.sharding.TableRuleConfiguration;
-import org.apache.shardingsphere.api.config.sharding.strategy.StandardShardingStrategyConfiguration;
-import org.apache.shardingsphere.shardingjdbc.api.ShardingDataSourceFactory;
+//import org.apache.shardingsphere.api.config.sharding.ShardingRuleConfiguration;
+//import org.apache.shardingsphere.api.config.sharding.TableRuleConfiguration;
+//import org.apache.shardingsphere.api.config.sharding.strategy.StandardShardingStrategyConfiguration;
+//import org.apache.shardingsphere.shardingjdbc.api.ShardingDataSourceFactory;
 
 import javax.sql.DataSource;
 import java.sql.SQLException;
@@ -20,7 +20,7 @@ public class ShardingDataSourceConfig {
     private final String database = "reghao_oss_rdb";
 
     //@Bean
-    public DataSource getShardingDataSource() throws SQLException {
+    /*public DataSource getShardingDataSource() throws SQLException {
         ShardingRuleConfiguration shardingRuleConfig = new ShardingRuleConfiguration();
         shardingRuleConfig.getTableRuleConfigs().add(getTableRuleConfiguration());
         //shardingRuleConfig.setDefaultDatabaseShardingStrategyConfig(new InlineShardingStrategyConfiguration("qq", "qq_mobile_$->{qq % 4}"));
@@ -33,7 +33,7 @@ public class ShardingDataSourceConfig {
         String logicalTalbe = "qq_mobile";
         String actualDataNodes = database + ".qq_mobile_$->{0..3}";
         return new TableRuleConfiguration(logicalTalbe, actualDataNodes);
-    }
+    }*/
 
     private Map<String, DataSource> createDataSourceMap() {
         Map<String, DataSource> result = new HashMap<>();

+ 1 - 1
content/content-service/src/main/java/cn/reghao/tnb/content/app/config/web/TokenFilter.java

@@ -7,7 +7,7 @@ import cn.reghao.tnb.common.util.ConstantId;
 import org.slf4j.MDC;
 import org.springframework.stereotype.Component;
 
-import javax.servlet.*;
+import jakarta.servlet.*;
 import java.io.IOException;
 import java.util.Arrays;
 import java.util.HashSet;

+ 2 - 2
content/content-service/src/main/java/cn/reghao/tnb/content/app/config/web/UserRoleInterceptor.java

@@ -9,8 +9,8 @@ import org.springframework.stereotype.Component;
 import org.springframework.web.servlet.HandlerInterceptor;
 import org.springframework.web.servlet.ModelAndView;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.io.PrintWriter;
 

+ 1 - 1
content/content-service/src/main/java/cn/reghao/tnb/content/app/config/web/WebConfig.java

@@ -6,7 +6,7 @@ import org.springframework.context.annotation.Configuration;
 import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
 import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
 
-import javax.servlet.Filter;
+import jakarta.servlet.Filter;
 
 /**
  * @author reghao

+ 1 - 1
content/content-service/src/main/java/cn/reghao/tnb/content/app/geo/service/EarthService.java

@@ -9,7 +9,7 @@ import org.dom4j.io.SAXReader;
 import org.dom4j.io.XMLWriter;
 import org.springframework.stereotype.Service;
 
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 import java.io.*;
 import java.net.URLEncoder;
 import java.nio.charset.StandardCharsets;

+ 3 - 3
content/content-service/src/main/java/cn/reghao/tnb/content/app/util/redis/ds/RedisSortedSetStr.java

@@ -1,6 +1,7 @@
 package cn.reghao.tnb.content.app.util.redis.ds;
 
-import org.springframework.data.redis.connection.RedisZSetCommands;
+import org.springframework.data.redis.connection.zset.Aggregate;
+import org.springframework.data.redis.connection.zset.Weights;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.data.redis.core.ZSetOperations;
 import org.springframework.stereotype.Component;
@@ -36,7 +37,6 @@ public class RedisSortedSetStr {
     }
 
     public Long zinterstore(String destKey, String numKeys, Set<String> keys, int weight1, int weight2) {
-        return zsetOps.intersectAndStore(numKeys, keys, destKey,
-                RedisZSetCommands.Aggregate.SUM, RedisZSetCommands.Weights.of(weight1, weight2));
+        return zsetOps.intersectAndStore(numKeys, keys, destKey, Aggregate.SUM, Weights.of(weight1, weight2));
     }
 }

+ 5 - 5
content/content-service/src/main/resources/application-cluster.yml

@@ -14,11 +14,11 @@ spring:
       authentication-database: admin
       username: test
       password: Test@123456
-  redis:
-    database: 0
-    host: 192.168.0.211
-    port: 6379
-    password: Test@123456
+    redis:
+      database: 0
+      host: 192.168.0.211
+      port: 6379
+      password: Test@123456
   rabbitmq:
     addresses: 192.168.0.211:5672,192.168.0.212:5672,192.168.0.213:5672
     virtual-host: /

+ 28 - 24
content/content-service/src/main/resources/application-dev.yml

@@ -15,36 +15,40 @@ spring:
       authentication-database: admin
       username: dev
       password: Dev@123456
-  redis:
-    database: 0
-    host: 127.0.0.1
-    port: 6379
-    password: Dev@123456
+    redis:
+      database: 0
+      host: 127.0.0.1
+      port: 6379
+      password: Dev@123456
   rabbitmq:
     host: 127.0.0.1
     port: 5672
     virtual-host: /
     username: dev
     password: Dev@123456
-  shardingsphere:
-    datasource:
-      names: master,slave
-      masterslave:
-        name: ms
-        master-data-source-name: master
-        slave-data-source-names: slave
-      master:
-        type: com.zaxxer.hikari.HikariDataSource
-        driver-class-name: com.mysql.cj.jdbc.Driver
-        jdbc-url: jdbc:mysql://127.0.0.1/tnb_content_rdb?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2b8
-        username: dev
-        password: Dev@123456
-      slave:
-        type: com.zaxxer.hikari.HikariDataSource
-        driver-class-name: com.mysql.cj.jdbc.Driver
-        jdbc-url: jdbc:mysql://127.0.0.1/tnb_content_rdb?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2b8
-        username: dev
-        password: Dev@123456
+  datasource:
+    url: jdbc:mysql://127.0.0.1/tnb_content_rdb?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2b8
+    username: dev
+    password: Dev@123456
+#  shardingsphere:
+#    datasource:
+#      names: master,slave
+#      masterslave:
+#        name: ms
+#        master-data-source-name: master
+#        slave-data-source-names: slave
+#      master:
+#        type: com.zaxxer.hikari.HikariDataSource
+#        driver-class-name: com.mysql.cj.jdbc.Driver
+#        jdbc-url: jdbc:mysql://127.0.0.1/tnb_content_rdb?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2b8
+#        username: dev
+#        password: Dev@123456
+#      slave:
+#        type: com.zaxxer.hikari.HikariDataSource
+#        driver-class-name: com.mysql.cj.jdbc.Driver
+#        jdbc-url: jdbc:mysql://127.0.0.1/tnb_content_rdb?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2b8
+#        username: dev
+#        password: Dev@123456
 eureka:
   client:
     service-url:

+ 5 - 5
content/content-service/src/main/resources/application-test.yml

@@ -13,11 +13,11 @@ spring:
       authentication-database: admin
       username: test
       password: Test@123456
-  redis:
-    database: 0
-    host: 192.168.0.209
-    port: 6379
-    password: Test@123456
+    redis:
+      database: 0
+      host: 192.168.0.209
+      port: 6379
+      password: Test@123456
   rabbitmq:
     host: 192.168.0.209
     port: 5672

+ 2 - 2
content/pom.xml

@@ -17,8 +17,8 @@
     </modules>
 
     <properties>
-        <maven.compiler.source>11</maven.compiler.source>
-        <maven.compiler.target>11</maven.compiler.target>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
     </properties>
 
 </project>

+ 2 - 2
data/data-api/pom.xml

@@ -14,8 +14,8 @@
     <version>1.0.0-SNAPSHOT</version>
 
     <properties>
-        <maven.compiler.source>11</maven.compiler.source>
-        <maven.compiler.target>11</maven.compiler.target>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
     </properties>
 
 </project>

+ 4 - 4
data/data-service/pom.xml

@@ -13,8 +13,8 @@
     <artifactId>data-service</artifactId>
 
     <properties>
-        <maven.compiler.source>11</maven.compiler.source>
-        <maven.compiler.target>11</maven.compiler.target>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
     </properties>
 
     <dependencies>
@@ -38,8 +38,8 @@
             <artifactId>spring-boot-starter-data-r2dbc</artifactId>
         </dependency>
         <dependency>
-            <groupId>mysql</groupId>
-            <artifactId>mysql-connector-java</artifactId>
+            <groupId>com.mysql</groupId>
+            <artifactId>mysql-connector-j</artifactId>
             <scope>runtime</scope>
         </dependency>
         <dependency>

+ 1 - 1
data/data-service/src/main/java/cn/reghao/tnb/data/app/filter/GetRequestBodyFilter.java

@@ -25,7 +25,7 @@ import java.util.concurrent.atomic.AtomicReference;
 public class GetRequestBodyFilter implements WebFilter, Ordered {
     public Mono<Void> filter(ServerWebExchange exchange, WebFilterChain chain) {
         ServerHttpRequest serverHttpRequest = exchange.getRequest();
-        String method = serverHttpRequest.getMethodValue();
+        String method = serverHttpRequest.getMethod().name();
         //从请求里获取Post请求体
         String bodyStr = resolveBodyFromRequest(serverHttpRequest);
 

+ 5 - 5
data/data-service/src/main/resources/application-dev.yml

@@ -7,11 +7,6 @@ spring:
     url: r2dbcs:mysql://127.0.0.1/tnb_content_rdb?SSL=false&sslMode=DISABLED&useUnicode=true&characterEncoding=UTF8&autoReconnect=true
     username: dev
     password: Dev@123456
-  redis:
-    database: 0
-    host: 127.0.0.1
-    port: 6379
-    password: Dev@123456
   data:
     mongodb:
       host: 127.0.0.1
@@ -20,6 +15,11 @@ spring:
       username: dev
       password: Dev@123456
       database: "tnb_content_rdb"
+    redis:
+      database: 0
+      host: 127.0.0.1
+      port: 6379
+      password: Dev@123456
   rabbitmq:
     host: 127.0.0.1
     port: 5672

+ 6 - 5
data/data-service/src/main/resources/application-test.yml

@@ -2,11 +2,12 @@ spring:
   cloud:
     discovery:
       enabled: true
-  redis:
-    database: 0
-    host: 192.168.0.209
-    port: 6379
-    password: Test@123456
+  data:
+    redis:
+      database: 0
+      host: 192.168.0.209
+      port: 6379
+      password: Test@123456
   rabbitmq:
     host: 192.168.0.209
     port: 5672

+ 2 - 2
data/pom.xml

@@ -17,7 +17,7 @@
     </modules>
 
     <properties>
-        <maven.compiler.source>11</maven.compiler.source>
-        <maven.compiler.target>11</maven.compiler.target>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
     </properties>
 </project>

+ 2 - 2
eureka/eureka-api/pom.xml

@@ -14,8 +14,8 @@
     <version>1.0.0-SNAPSHOT</version>
 
     <properties>
-        <maven.compiler.source>11</maven.compiler.source>
-        <maven.compiler.target>11</maven.compiler.target>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
     </properties>
 
 </project>

+ 2 - 2
eureka/eureka-server/pom.xml

@@ -13,8 +13,8 @@
     <artifactId>eureka-server</artifactId>
 
     <properties>
-        <maven.compiler.source>11</maven.compiler.source>
-        <maven.compiler.target>11</maven.compiler.target>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
     </properties>
 
     <dependencies>

+ 2 - 2
eureka/pom.xml

@@ -17,8 +17,8 @@
     </modules>
 
     <properties>
-        <maven.compiler.source>11</maven.compiler.source>
-        <maven.compiler.target>11</maven.compiler.target>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
     </properties>
 
 </project>

+ 2 - 2
file/file-api/pom.xml

@@ -14,7 +14,7 @@
     <version>1.0.0-SNAPSHOT</version>
 
     <properties>
-        <maven.compiler.source>11</maven.compiler.source>
-        <maven.compiler.target>11</maven.compiler.target>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
     </properties>
 </project>

+ 6 - 6
file/file-service/pom.xml

@@ -13,8 +13,8 @@
     <artifactId>file-service</artifactId>
 
     <properties>
-        <maven.compiler.source>11</maven.compiler.source>
-        <maven.compiler.target>11</maven.compiler.target>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
     </properties>
 
     <dependencies>
@@ -85,9 +85,9 @@
         </dependency>-->
 
         <dependency>
-            <groupId>mysql</groupId>
-            <artifactId>mysql-connector-java</artifactId>
-            <version>8.0.17</version>
+            <groupId>com.mysql</groupId>
+            <artifactId>mysql-connector-j</artifactId>
+            <version>8.0.31</version>
         </dependency>
         <dependency>
             <groupId>com.zaxxer</groupId>
@@ -97,7 +97,7 @@
         <dependency>
             <groupId>org.mybatis.spring.boot</groupId>
             <artifactId>mybatis-spring-boot-starter</artifactId>
-            <version>2.1.1</version>
+            <version>3.0.4</version>
         </dependency>
 
         <dependency>

+ 2 - 2
file/file-service/src/main/java/cn/reghao/tnb/file/app/config/web/OssSdkInterceptor.java

@@ -11,8 +11,8 @@ import org.springframework.stereotype.Component;
 import org.springframework.web.servlet.HandlerInterceptor;
 import org.springframework.web.servlet.ModelAndView;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
 import java.util.UUID;
 
 /**

+ 1 - 1
file/file-service/src/main/java/cn/reghao/tnb/file/app/config/web/TokenFilter.java

@@ -7,7 +7,7 @@ import cn.reghao.tnb.common.util.ConstantId;
 import org.slf4j.MDC;
 import org.springframework.stereotype.Component;
 
-import javax.servlet.*;
+import jakarta.servlet.*;
 import java.io.IOException;
 import java.util.Arrays;
 import java.util.HashSet;

+ 1 - 1
file/file-service/src/main/java/cn/reghao/tnb/file/app/config/web/WebConfig.java

@@ -6,7 +6,7 @@ import org.springframework.context.annotation.Configuration;
 import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
 import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
 
-import javax.servlet.Filter;
+import jakarta.servlet.Filter;
 
 /**
  * @author reghao

+ 0 - 1
file/file-service/src/main/java/cn/reghao/tnb/file/app/model/dto/AvatarUpdate.java

@@ -4,7 +4,6 @@ import lombok.AllArgsConstructor;
 import lombok.Getter;
 import lombok.NoArgsConstructor;
 import lombok.Setter;
-import org.checkerframework.checker.units.qual.A;
 
 import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.NotNull;

+ 2 - 1
file/file-service/src/main/java/cn/reghao/tnb/file/app/service/AvatarService.java

@@ -6,6 +6,7 @@ import cn.reghao.tnb.account.api.iface.AccountQuery;
 import cn.reghao.tnb.common.auth.UserContext;
 import cn.reghao.tnb.file.app.model.dto.AvatarUpdate;
 import org.apache.dubbo.config.annotation.DubboReference;
+import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Service;
 
 /**
@@ -18,7 +19,7 @@ public class AvatarService {
     private AccountQuery accountQuery;
     private final OssService ossService;
 
-    public AvatarService(OssService ossService) {
+    public AvatarService(@Qualifier("storeServiceWrapperRouter") OssService ossService) {
         this.ossService = ossService;
     }
 

+ 6 - 5
file/file-service/src/main/resources/application-dev.yml

@@ -5,11 +5,12 @@ spring:
   cloud:
     discovery:
       enabled: true
-  redis:
-    database: 0
-    host: 127.0.0.1
-    port: 6379
-    password: Dev@123456
+  data:
+    redis:
+      database: 0
+      host: 127.0.0.1
+      port: 6379
+      password: Dev@123456
   datasource:
     url: jdbc:mysql://127.0.0.1/tnb_content_rdb?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2b8
     username: dev

+ 6 - 5
file/file-service/src/main/resources/application-test.yml

@@ -6,11 +6,12 @@ spring:
   cloud:
     discovery:
       enabled: true
-  redis:
-    database: 0
-    host: 192.168.0.209
-    port: 6379
-    password: Test@123456
+  data:
+    redis:
+      database: 0
+      host: 192.168.0.209
+      port: 6379
+      password: Test@123456
   datasource:
     url: jdbc:mysql://192.168.0.209:3306/tnb_content_tdb?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2b8
     username: test

+ 2 - 2
file/pom.xml

@@ -16,8 +16,8 @@
     </modules>
 
     <properties>
-        <maven.compiler.source>11</maven.compiler.source>
-        <maven.compiler.target>11</maven.compiler.target>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
     </properties>
 
     <dependencies>

+ 2 - 2
gateway/pom.xml

@@ -12,8 +12,8 @@
     <artifactId>gateway</artifactId>
 
     <properties>
-        <maven.compiler.source>11</maven.compiler.source>
-        <maven.compiler.target>11</maven.compiler.target>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
     </properties>
 
     <dependencies>

+ 1 - 1
gateway/src/main/java/cn/reghao/tnb/gateway/lb/UserReactiveLoadBalancerClientFilter.java

@@ -85,7 +85,7 @@ public class UserReactiveLoadBalancerClientFilter extends ReactiveLoadBalancerCl
             }).then(chain.filter(exchange));
         } catch (NotFoundException e) {
             exchange.getAttributes().put("targetService", "SERVICE_UNAVAILABLE");
-            exchange.getResponse().setStatusCode(e.getStatus());
+            exchange.getResponse().setStatusCode(e.getStatusCode());
             String msg = e.getMessage();
             byte[] bytes = msg.getBytes(StandardCharsets.UTF_8);
 

+ 1 - 1
gateway/src/main/java/cn/reghao/tnb/gateway/log/GatewayLogService.java

@@ -69,7 +69,7 @@ public class GatewayLogService {
         ServerHttpRequest request = exchange.getRequest();
         String requestUrl = getOriginalRequestUrl(exchange);
         gatewayLog.setRequestUrl(requestUrl);
-        gatewayLog.setRequestMethod(request.getMethodValue());
+        gatewayLog.setRequestMethod(request.getMethod().name());
         Map<String, String> requestHeaders = new HashMap<>();
         HttpHeaders headers = request.getHeaders();
         headers.forEach((headerName, headerValue) -> {

+ 6 - 5
gateway/src/main/resources/application-dev.yml

@@ -1,9 +1,4 @@
 spring:
-  redis:
-    database: 0
-    host: 127.0.0.1
-    port: 6379
-    password: Dev@123456
   rabbitmq:
     host: 127.0.0.1
     port: 5672
@@ -13,6 +8,12 @@ spring:
   cloud:
     discovery:
       enabled: true
+  data:
+    redis:
+      database: 0
+      host: 127.0.0.1
+      port: 6379
+      password: Dev@123456
 eureka:
   client:
     service-url:

+ 6 - 5
gateway/src/main/resources/application-test.yml

@@ -1,9 +1,4 @@
 spring:
-  redis:
-    database: 0
-    host: 192.168.0.209
-    port: 6379
-    password: Test@123456
   rabbitmq:
     host: 192.168.0.209
     port: 5672
@@ -13,6 +8,12 @@ spring:
   cloud:
     discovery:
       enabled: true
+  data:
+    redis:
+      database: 0
+      host: 192.168.0.209
+      port: 6379
+      password: Test@123456
 eureka:
   client:
     service-url:

+ 2 - 2
message/message-api/pom.xml

@@ -14,8 +14,8 @@
     <version>1.0.0-SNAPSHOT</version>
 
     <properties>
-        <maven.compiler.source>11</maven.compiler.source>
-        <maven.compiler.target>11</maven.compiler.target>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
     </properties>
 
 </project>

+ 8 - 8
message/message-service/pom.xml

@@ -13,8 +13,8 @@
     <artifactId>message-service</artifactId>
 
     <properties>
-        <maven.compiler.source>11</maven.compiler.source>
-        <maven.compiler.target>11</maven.compiler.target>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
     </properties>
 
     <dependencies>
@@ -35,9 +35,9 @@
         </dependency>
 
         <dependency>
-            <groupId>mysql</groupId>
-            <artifactId>mysql-connector-java</artifactId>
-            <version>8.0.17</version>
+            <groupId>com.mysql</groupId>
+            <artifactId>mysql-connector-j</artifactId>
+            <version>8.0.31</version>
         </dependency>
         <dependency>
             <groupId>com.zaxxer</groupId>
@@ -47,7 +47,7 @@
         <dependency>
             <groupId>org.mybatis.spring.boot</groupId>
             <artifactId>mybatis-spring-boot-starter</artifactId>
-            <version>2.1.1</version>
+            <version>3.0.4</version>
         </dependency>
 
         <dependency>
@@ -79,7 +79,7 @@
             <groupId>org.springframework.cloud</groupId>
             <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
         </dependency>
-        <dependency>
+        <!--<dependency>
             <groupId>org.springframework.cloud</groupId>
             <artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
             <version>2.2.10.RELEASE</version>
@@ -88,7 +88,7 @@
             <groupId>org.springframework.cloud</groupId>
             <artifactId>spring-cloud-starter-netflix-turbine</artifactId>
             <version>2.2.10.RELEASE</version>
-        </dependency>
+        </dependency>-->
 
         <dependency>
             <groupId>org.dom4j</groupId>

+ 4 - 4
message/message-service/src/main/java/cn/reghao/tnb/message/app/MessageApplication.java

@@ -2,14 +2,14 @@ package cn.reghao.tnb.message.app;
 
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
-import org.springframework.cloud.netflix.turbine.EnableTurbine;
+//import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
+//import org.springframework.cloud.netflix.turbine.EnableTurbine;
 import org.springframework.context.annotation.ComponentScan;
 
 @SpringBootApplication
 @ComponentScan({"cn.reghao.tnb.common", "cn.reghao.tnb.message.app"})
-@EnableHystrixDashboard
-@EnableTurbine
+//@EnableHystrixDashboard
+//@EnableTurbine
 public class MessageApplication {
     public static void main(String[] args) {
         SpringApplication.run(MessageApplication.class, args);

+ 1 - 1
message/message-service/src/main/java/cn/reghao/tnb/message/app/ws/config/WebSocketInterceptor.java

@@ -9,7 +9,7 @@ import org.springframework.stereotype.Component;
 import org.springframework.web.socket.WebSocketHandler;
 import org.springframework.web.socket.server.HandshakeInterceptor;
 
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
 import java.util.Map;
 
 /**

+ 2 - 2
message/pom.xml

@@ -17,8 +17,8 @@
     </modules>
 
     <properties>
-        <maven.compiler.source>11</maven.compiler.source>
-        <maven.compiler.target>11</maven.compiler.target>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
     </properties>
 
 </project>

+ 2 - 2
oss/oss-api/pom.xml

@@ -13,8 +13,8 @@
     <version>1.0.0-SNAPSHOT</version>
 
     <properties>
-        <maven.compiler.source>11</maven.compiler.source>
-        <maven.compiler.target>11</maven.compiler.target>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
     </properties>

+ 3 - 3
oss/oss-sdk/pom.xml

@@ -13,8 +13,8 @@
     <version>1.0.0-SNAPSHOT</version>
 
     <properties>
-        <maven.compiler.source>11</maven.compiler.source>
-        <maven.compiler.target>11</maven.compiler.target>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
     </properties>
@@ -23,7 +23,7 @@
         <dependency>
             <groupId>cn.reghao.jutil</groupId>
             <artifactId>tool</artifactId>
-            <version>1.0.0-SNAPSHOT</version>
+            <version>jdk17-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>cn.reghao.tnb</groupId>

+ 5 - 5
oss/oss-store/pom.xml

@@ -39,7 +39,7 @@
         <dependency>
             <groupId>cn.reghao.jutil</groupId>
             <artifactId>web</artifactId>
-            <version>1.0.0-SNAPSHOT</version>
+            <version>jdk17-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>cn.reghao.tnb</groupId>
@@ -68,12 +68,12 @@
         <dependency>
             <groupId>org.mybatis.spring.boot</groupId>
             <artifactId>mybatis-spring-boot-starter</artifactId>
-            <version>1.3.2</version>
+            <version>3.0.4</version>
         </dependency>
         <dependency>
-            <groupId>mysql</groupId>
-            <artifactId>mysql-connector-java</artifactId>
-            <version>8.0.17</version>
+            <groupId>com.mysql</groupId>
+            <artifactId>mysql-connector-j</artifactId>
+            <version>8.0.31</version>
         </dependency>
         <dependency>
             <groupId>com.zaxxer</groupId>

+ 1 - 1
oss/oss-store/src/main/java/cn/reghao/tnb/oss/store/config/exception/ControllerExceptionHandler.java

@@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.ControllerAdvice;
 import org.springframework.web.bind.annotation.ExceptionHandler;
 import org.springframework.web.bind.annotation.ResponseBody;
 
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
 import java.util.stream.Collectors;
 
 /**

+ 1 - 1
oss/oss-store/src/main/java/cn/reghao/tnb/oss/store/config/exception/FilterExceptionHandler.java

@@ -10,7 +10,7 @@ import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
 import java.util.HashMap;
 import java.util.Map;
 

+ 2 - 2
oss/oss-store/src/main/java/cn/reghao/tnb/oss/store/config/inerceptor/AccessLogInterceptor.java

@@ -7,8 +7,8 @@ import org.springframework.stereotype.Component;
 import org.springframework.web.servlet.HandlerInterceptor;
 import org.springframework.web.servlet.ModelAndView;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
 
 /**
  * 访问日志拦截器

+ 1 - 1
oss/oss-store/src/main/java/cn/reghao/tnb/oss/store/config/inerceptor/TokenFilter.java

@@ -7,7 +7,7 @@ import cn.reghao.tnb.auth.model.OssPayload;
 import com.github.benmanes.caffeine.cache.Cache;
 import org.springframework.stereotype.Component;
 
-import javax.servlet.*;
+import jakarta.servlet.*;
 import java.io.IOException;
 
 /**

+ 1 - 1
oss/oss-store/src/main/java/cn/reghao/tnb/oss/store/config/web/WebConfig.java

@@ -13,7 +13,7 @@ import org.springframework.web.servlet.config.annotation.CorsRegistry;
 import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
 import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
 
-import javax.servlet.Filter;
+import jakarta.servlet.Filter;
 import java.util.List;
 
 /**

+ 1 - 1
oss/oss-store/src/main/java/cn/reghao/tnb/oss/store/controller/ObjectGetController.java

@@ -15,7 +15,7 @@ import cn.reghao.tnb.auth.model.OssPayload;
 import com.github.benmanes.caffeine.cache.Cache;
 import org.springframework.web.bind.annotation.*;
 
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 import java.io.IOException;
 
 /**

+ 1 - 1
oss/oss-store/src/main/java/cn/reghao/tnb/oss/store/service/GetObjectService.java

@@ -10,7 +10,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
 
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.http.HttpServletResponse;
 import java.io.*;
 import java.net.URLEncoder;
 import java.nio.charset.StandardCharsets;

+ 4 - 4
oss/oss-store/src/main/java/cn/reghao/tnb/oss/store/tomcat/GlobalServlet.java

@@ -3,10 +3,10 @@ package cn.reghao.tnb.oss.store.tomcat;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;
 
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.http.HttpServlet;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.io.Writer;
 

+ 1 - 1
oss/oss-store/src/main/java/cn/reghao/tnb/oss/store/util/ObjectUtil.java

@@ -2,7 +2,7 @@ package cn.reghao.tnb.oss.store.util;
 
 import cn.reghao.jutil.web.ServletUtil;
 
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletRequest;
 import java.net.URLDecoder;
 import java.nio.charset.StandardCharsets;
 

+ 0 - 3
oss/oss-store/src/main/resources/application.yml

@@ -13,9 +13,6 @@ dubbo:
     address: N/A
 server:
   port: 4010
-  tomcat:
-    connection-timeout: 1800_000
-    keep-alive-timeout: 1800_000
 spring:
   servlet:
     multipart:

+ 2 - 2
oss/pom.xml

@@ -17,8 +17,8 @@
     </modules>
 
     <properties>
-        <maven.compiler.source>11</maven.compiler.source>
-        <maven.compiler.target>11</maven.compiler.target>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
     </properties>
 
 </project>

+ 19 - 8
pom.xml

@@ -24,12 +24,12 @@
     </modules>
 
     <properties>
-        <maven.compiler.source>11</maven.compiler.source>
-        <maven.compiler.target>11</maven.compiler.target>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
-        <springboot.version>2.6.15</springboot.version>
-        <springcloud.version>2021.0.9</springcloud.version>
+        <springboot.version>3.2.1</springboot.version>
+        <springcloud.version>2023.0.1</springcloud.version>
         <dubbo.version>3.3.0</dubbo.version>
     </properties>
 
@@ -70,24 +70,24 @@
         <dependency>
             <groupId>cn.reghao.jutil</groupId>
             <artifactId>jdk</artifactId>
-            <version>1.0.0-SNAPSHOT</version>
+            <version>jdk17-SNAPSHOT</version>
         </dependency>
 
         <dependency>
             <groupId>org.projectlombok</groupId>
             <artifactId>lombok</artifactId>
             <optional>true</optional>
-            <version>1.18.16</version>
+            <version>1.18.42</version>
         </dependency>
         <dependency>
             <groupId>ch.qos.logback</groupId>
             <artifactId>logback-core</artifactId>
-            <version>1.2.3</version>
+            <version>1.4.14</version>
         </dependency>
         <dependency>
             <groupId>ch.qos.logback</groupId>
             <artifactId>logback-classic</artifactId>
-            <version>1.2.3</version>
+            <version>1.4.14</version>
         </dependency>
 
         <dependency>
@@ -99,6 +99,17 @@
             <artifactId>spring-boot-starter-test</artifactId>
             <scope>test</scope>
         </dependency>
+
+        <dependency>
+            <groupId>javax.validation</groupId>
+            <artifactId>validation-api</artifactId>
+            <version>2.0.1.Final</version>
+        </dependency>
+        <dependency>
+            <groupId>javax.annotation</groupId>
+            <artifactId>javax.annotation-api</artifactId>
+            <version>1.3.2</version>
+        </dependency>
     </dependencies>
 
     <distributionManagement>

+ 2 - 2
search/pom.xml

@@ -17,8 +17,8 @@
     </modules>
 
     <properties>
-        <maven.compiler.source>11</maven.compiler.source>
-        <maven.compiler.target>11</maven.compiler.target>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
     </properties>
 
 </project>

+ 2 - 2
search/search-api/pom.xml

@@ -14,8 +14,8 @@
     <version>1.0.0-SNAPSHOT</version>
 
     <properties>
-        <maven.compiler.source>11</maven.compiler.source>
-        <maven.compiler.target>11</maven.compiler.target>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
     </properties>
 
 </project>

+ 5 - 5
search/search-service/pom.xml

@@ -13,8 +13,8 @@
     <artifactId>search-service</artifactId>
 
     <properties>
-        <maven.compiler.source>11</maven.compiler.source>
-        <maven.compiler.target>11</maven.compiler.target>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
     </properties>
 
     <dependencies>
@@ -55,9 +55,9 @@
         </dependency>
 
         <dependency>
-            <groupId>mysql</groupId>
-            <artifactId>mysql-connector-java</artifactId>
-            <version>8.0.17</version>
+            <groupId>com.mysql</groupId>
+            <artifactId>mysql-connector-j</artifactId>
+            <version>8.0.31</version>
         </dependency>
         <dependency>
             <groupId>com.zaxxer</groupId>

+ 1 - 1
search/search-service/src/main/java/cn/reghao/tnb/search/app/config/web/TokenFilter.java

@@ -7,7 +7,7 @@ import cn.reghao.tnb.common.util.ConstantId;
 import org.slf4j.MDC;
 import org.springframework.stereotype.Component;
 
-import javax.servlet.*;
+import jakarta.servlet.*;
 import java.io.IOException;
 import java.util.Arrays;
 import java.util.HashSet;

+ 1 - 1
search/search-service/src/main/java/cn/reghao/tnb/search/app/config/web/WebConfig.java

@@ -5,7 +5,7 @@ import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
 
-import javax.servlet.Filter;
+import jakarta.servlet.Filter;
 
 /**
  * @author reghao

+ 2 - 2
user/pom.xml

@@ -17,8 +17,8 @@
     </modules>
 
     <properties>
-        <maven.compiler.source>11</maven.compiler.source>
-        <maven.compiler.target>11</maven.compiler.target>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
     </properties>
 
 </project>

+ 2 - 2
user/user-api/pom.xml

@@ -14,8 +14,8 @@
     <version>1.0.0-SNAPSHOT</version>
 
     <properties>
-        <maven.compiler.source>11</maven.compiler.source>
-        <maven.compiler.target>11</maven.compiler.target>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
     </properties>
 
     <dependencies>

+ 6 - 6
user/user-service/pom.xml

@@ -13,8 +13,8 @@
     <artifactId>user-service</artifactId>
 
     <properties>
-        <maven.compiler.source>11</maven.compiler.source>
-        <maven.compiler.target>11</maven.compiler.target>
+        <maven.compiler.source>17</maven.compiler.source>
+        <maven.compiler.target>17</maven.compiler.target>
     </properties>
 
     <dependencies>
@@ -59,9 +59,9 @@
         </dependency>
 
         <dependency>
-            <groupId>mysql</groupId>
-            <artifactId>mysql-connector-java</artifactId>
-            <version>8.0.17</version>
+            <groupId>com.mysql</groupId>
+            <artifactId>mysql-connector-j</artifactId>
+            <version>8.0.31</version>
         </dependency>
         <dependency>
             <groupId>com.zaxxer</groupId>
@@ -71,7 +71,7 @@
         <dependency>
             <groupId>org.mybatis.spring.boot</groupId>
             <artifactId>mybatis-spring-boot-starter</artifactId>
-            <version>2.1.1</version>
+            <version>3.0.4</version>
         </dependency>
 
         <dependency>

+ 1 - 1
user/user-service/src/main/java/cn/reghao/tnb/user/app/config/web/TokenFilter.java

@@ -7,7 +7,7 @@ import cn.reghao.tnb.common.util.ConstantId;
 import org.slf4j.MDC;
 import org.springframework.stereotype.Component;
 
-import javax.servlet.*;
+import jakarta.servlet.*;
 import java.io.IOException;
 import java.util.Arrays;
 import java.util.HashSet;

+ 1 - 1
user/user-service/src/main/java/cn/reghao/tnb/user/app/config/web/WebConfig.java

@@ -5,7 +5,7 @@ import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
 
-import javax.servlet.Filter;
+import jakarta.servlet.Filter;
 
 /**
  * @author reghao

+ 6 - 5
user/user-service/src/main/resources/application-cluster.yml

@@ -7,11 +7,12 @@ spring:
   cloud:
     discovery:
       enabled: true
-  redis:
-    database: 0
-    host: 192.168.0.211
-    port: 6379
-    password: Test@123456
+  data:
+    redis:
+      database: 0
+      host: 192.168.0.211
+      port: 6379
+      password: Test@123456
   datasource:
     url: jdbc:mysql://192.168.0.211:3306/tnb_account_tdb?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2b8
     username: test

Vissa filer visades inte eftersom för många filer har ändrats