diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml
new file mode 100644
index 0000000..b48c127
--- /dev/null
+++ b/.idea/dataSources.xml
@@ -0,0 +1,17 @@
+
+
+
+
+ mysql_aurora_aws
+ true
+ software.aws.rds.jdbc.mysql.Driver
+ jdbc:mysql:aws://localhost:3306/tutorial
+
+
+
+
+
+ $ProjectFileDir$
+
+
+
\ No newline at end of file
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
index 240ee29..c54f389 100644
--- a/.idea/encodings.xml
+++ b/.idea/encodings.xml
@@ -3,6 +3,8 @@
+
+
diff --git a/.idea/misc.xml b/.idea/misc.xml
index fdc35ea..bada8b5 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -8,7 +8,7 @@
-
+
\ No newline at end of file
diff --git a/.idea/mybatisx/templates.xml b/.idea/mybatisx/templates.xml
new file mode 100644
index 0000000..47f2860
--- /dev/null
+++ b/.idea/mybatisx/templates.xml
@@ -0,0 +1,65 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml
new file mode 100644
index 0000000..2b63946
--- /dev/null
+++ b/.idea/uiDesigner.xml
@@ -0,0 +1,124 @@
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/commons/pom.xml b/commons/pom.xml
index 1bf709a..439782d 100644
--- a/commons/pom.xml
+++ b/commons/pom.xml
@@ -27,5 +27,22 @@
com.alibaba.fastjson2
fastjson2
+
+ cn.hutool
+ hutool-all
+ 5.8.21
+
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ 3.1.5
+
+
+
+ io.github.openfeign
+ feign-micrometer
+ 12.5
+
\ No newline at end of file
diff --git a/community-8073/pom.xml b/community-8073/pom.xml
new file mode 100644
index 0000000..8d30724
--- /dev/null
+++ b/community-8073/pom.xml
@@ -0,0 +1,173 @@
+
+
+ 4.0.0
+
+ com.ivmiku.tutorial
+ first-tutorial
+ 1.0-SNAPSHOT
+
+
+ community-8073
+
+
+ 21
+ 21
+ UTF-8
+
+
+
+
+
+
+
+
+
+
+ io.minio
+ minio
+ 7.0.2
+
+
+
+
+ org.springdoc
+ springdoc-openapi-starter-webmvc-ui
+ 2.1.0
+
+
+ org.springdoc
+ springdoc-openapi-starter-webmvc-ui
+ 2.1.0
+
+
+
+
+ javax.servlet
+ javax.servlet-api
+ 4.0.1
+ provided
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+ org.springframework.boot
+ spring-boot-starter-actuator
+
+
+ com.baomidou
+ mybatis-plus-spring-boot3-starter
+
+
+ com.alibaba.cloud
+ spring-cloud-starter-alibaba-nacos-discovery
+
+
+ com.mysql
+ mysql-connector-j
+ runtime
+
+
+ org.projectlombok
+ lombok
+ provided
+
+
+
+ cn.dev33
+ sa-token-spring-boot3-starter
+
+
+
+ com.alibaba.fastjson2
+ fastjson2
+
+
+
+ cn.dev33
+ sa-token-redis-jackson
+ 1.38.0
+
+
+ org.apache.commons
+ commons-pool2
+
+
+
+ org.apache.dubbo
+ dubbo-spring-boot-starter
+
+
+
+ org.apache.dubbo
+ dubbo-registry-nacos
+
+
+ org.springframework.cloud
+ spring-cloud-starter-loadbalancer
+
+
+
+ io.micrometer
+ micrometer-tracing
+
+
+
+ io.micrometer
+ micrometer-tracing-bridge-brave
+
+
+
+ io.micrometer
+ micrometer-observation
+
+
+
+ io.zipkin.reporter2
+ zipkin-reporter-brave
+
+
+ org.apache.dubbo
+ dubbo-spring-boot-tracing-brave-zipkin-starter
+ 3.2.13
+
+
+ com.alibaba.cloud
+ spring-cloud-starter-alibaba-sentinel
+
+
+ com.github.binarywang
+ weixin-java-miniapp
+
+
+ com.ivmiku.tutorial
+ commons
+ 1.0-SNAPSHOT
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+ 3.0.13
+
+ com.ivmiku.tutorial.Main8072
+ JAR
+
+
+
+
+ repackage
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/gateway-8133/src/main/java/com/ivmiku/tutorial/Main8133.java b/gateway-8133/src/main/java/com/ivmiku/tutorial/Main8133.java
index 954215d..944b565 100644
--- a/gateway-8133/src/main/java/com/ivmiku/tutorial/Main8133.java
+++ b/gateway-8133/src/main/java/com/ivmiku/tutorial/Main8133.java
@@ -3,7 +3,9 @@ package com.ivmiku.tutorial;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
-@SpringBootApplication
+@SpringBootApplication(exclude = {
+ org.springframework.boot.actuate.autoconfigure.tracing.zipkin.ZipkinAutoConfiguration.class
+})
public class Main8133 {
public static void main(String[] args) {
SpringApplication.run(Main8133.class, args);
diff --git a/gateway-8133/src/main/java/com/ivmiku/tutorial/config/SaTokenConfigure.java b/gateway-8133/src/main/java/com/ivmiku/tutorial/config/SaTokenConfigure.java
index 59bfbdc..d26eec4 100644
--- a/gateway-8133/src/main/java/com/ivmiku/tutorial/config/SaTokenConfigure.java
+++ b/gateway-8133/src/main/java/com/ivmiku/tutorial/config/SaTokenConfigure.java
@@ -11,26 +11,49 @@ import org.springframework.context.annotation.Configuration;
* [Sa-Token 权限认证] 配置类
* @author click33
*/
+//@Configuration
+//public class SaTokenConfigure {
+// // 注册 Sa-Token全局过滤器
+// @Bean
+// public SaReactorFilter getSaReactorFilter() {
+// return new SaReactorFilter()
+// // 拦截地址
+// .addInclude("/**") /* 拦截全部path */
+// // 开放地址
+// .addExclude("/favicon.ico")
+// // 鉴权方法:每次访问进入
+// .setAuth(obj -> {
+// // 登录校验 -- 拦截所有路由,并排除/user/doLogin 用于开放登录
+// SaRouter.match("/**", "/user/**", r -> StpUtil.checkLogin());
+// })
+// // 异常处理方法:每次setAuth函数出现异常时进入
+// .setError(e -> {
+// return SaResult.error(e.getMessage());
+// });
+// }
+//}
@Configuration
public class SaTokenConfigure {
- // 注册 Sa-Token全局过滤器
+
+ // 注册 Sa-Token 全局过滤器
@Bean
public SaReactorFilter getSaReactorFilter() {
return new SaReactorFilter()
// 拦截地址
- .addInclude("/**") /* 拦截全部path */
+ .addInclude("/**") /* 拦截全部路径 */
// 开放地址
- .addExclude("/favicon.ico")
+ .addExclude("/favicon.ico",
+ "/user/login",
+ "/user/register",
+ "/swagger-resources/**",
+ "/v3/**",
+ "/swagger-ui/**")
// 鉴权方法:每次访问进入
.setAuth(obj -> {
- // 登录校验 -- 拦截所有路由,并排除/user/doLogin 用于开放登录
+ // 登录校验 -- 拦截所有路由,并排除指定路由
SaRouter.match("/**", "/user/**", r -> StpUtil.checkLogin());
})
- // 异常处理方法:每次setAuth函数出现异常时进入
- .setError(e -> {
- return SaResult.error(e.getMessage());
- })
- ;
+ // 异常处理方法:每次 setAuth 函数出现异常时进入
+ .setError(e -> SaResult.error(e.getMessage()));
}
}
-
diff --git a/gateway-8133/src/main/resources/application-dep.properties b/gateway-8133/src/main/resources/application-dep.properties
index 55f6029..a793f21 100644
--- a/gateway-8133/src/main/resources/application-dep.properties
+++ b/gateway-8133/src/main/resources/application-dep.properties
@@ -1,16 +1,16 @@
server.port=8133
spring.application.name=gateway
-spring.cloud.nacos.discovery.server-addr=nacos:8848
+spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848
-spring.data.redis.host=redis
+spring.data.redis.host=127.0.0.1
spring.data.redis.port=6379
spring.data.redis.database=0
-spring.data.redis.password=Shuodedaoli114514
+#spring.data.redis.password=Shuodedaoli114514
spring.cloud.gateway.routes[0].id=user
spring.cloud.gateway.routes[0].uri=lb://user
spring.cloud.gateway.routes[0].predicates[0]=Path=/user/**
-management.zipkin.tracing.endpoint=http://zipkin:9411/api/v2/spans
-management.tracing.sampling.probability=1.0
\ No newline at end of file
+management.zipkin.tracing.endpoint=http://127.0.0.1:9411/api/v2/spans
+management.tracing.sampling.probability=1.0
diff --git a/gateway-8133/src/main/resources/application-dev.properties b/gateway-8133/src/main/resources/application-dev.properties
index 12528ab..b28784a 100644
--- a/gateway-8133/src/main/resources/application-dev.properties
+++ b/gateway-8133/src/main/resources/application-dev.properties
@@ -10,6 +10,12 @@ spring.data.redis.database=0
spring.cloud.gateway.routes[0].id=user
spring.cloud.gateway.routes[0].uri=lb://user
spring.cloud.gateway.routes[0].predicates[0]=Path=/user/**
+spring.cloud.gateway.routes[0].filters[0]=StripPrefix=1
-management.zipkin.tracing.endpoint=http://localhost:9411/api/v2/spans
-management.tracing.sampling.probability=1.0
\ No newline at end of file
+spring.cloud.gateway.routes[1].id=community
+spring.cloud.gateway.routes[1].uri=lb://community
+spring.cloud.gateway.routes[1].predicates[0]=Path=/community/**
+spring.cloud.gateway.routes[1].filters[0]=StripPrefix=1
+
+#management.zipkin.tracing.endpoint=http://localhost:9411/api/v2/spans
+#management.tracing.sampling.probability=1.0
diff --git a/gateway-8133/src/main/resources/application.properties b/gateway-8133/src/main/resources/application.properties
index 0896b37..257b306 100644
--- a/gateway-8133/src/main/resources/application.properties
+++ b/gateway-8133/src/main/resources/application.properties
@@ -1 +1 @@
-spring.profiles.active=dep
\ No newline at end of file
+spring.profiles.active=dev
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index f405644..9cb51c7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -12,7 +12,8 @@
gateway-8133
user-8072
commons
- navigate-8432
+ community-8073
+
@@ -25,7 +26,7 @@
5.8.22
1.18.30
3.5.6
- 8.0.11
+ 8.0.28
4.2.3
2.0.40
1.0.2
@@ -53,6 +54,37 @@
+
+
+ mysql
+ mysql-connector-java
+ 8.0.28
+
+
+
+ javax.persistence
+ persistence-api
+ 1.0.2
+
+
+
+
+ cn.hutool
+ hutool-all
+ 5.8.21
+
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ 3.1.5
+
+
+
+ io.github.openfeign
+ feign-micrometer
+ 12.5
+
org.springframework.boot
@@ -83,30 +115,21 @@
mybatis-plus-spring-boot3-starter
${mybatis.springboot.version}
-
-
- mysql
- mysql-connector-java
- ${mysql.version}
-
-
-
- javax.persistence
- persistence-api
- ${persistence-api.version}
-
+
+
+
+
+
+
+
+
com.alibaba.fastjson2
fastjson2
${fastjson2.version}
-
-
- cn.hutool
- hutool-all
- ${hutool.version}
-
+
org.projectlombok
@@ -114,13 +137,7 @@
${lombok.version}
true
-
-
- org.springframework.boot
- spring-boot-starter-test
- ${spring.boot.test.version}
- test
-
+
@@ -148,12 +165,7 @@
micrometer-observation
${micrometer-observation.version}
-
-
- io.github.openfeign
- feign-micrometer
- ${feign-micrometer.version}
-
+
io.zipkin.reporter2
@@ -185,6 +197,8 @@
weixin-java-miniapp
${wx.version}
+
+
\ No newline at end of file
diff --git a/user-8072/src/main/java/com/ivmiku/tutorial/Main8072.java b/user-8072/src/main/java/com/ivmiku/tutorial/Main8072.java
index 31a15fe..817c779 100644
--- a/user-8072/src/main/java/com/ivmiku/tutorial/Main8072.java
+++ b/user-8072/src/main/java/com/ivmiku/tutorial/Main8072.java
@@ -4,7 +4,9 @@ import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
-@SpringBootApplication
+@SpringBootApplication(exclude = {
+ org.springframework.boot.actuate.autoconfigure.tracing.zipkin.ZipkinAutoConfiguration.class
+})
@MapperScan("com.ivmiku.tutorial.mapper")
public class Main8072 {
public static void main(String[] args) {
diff --git a/user-8072/src/main/resources/application-dep.properties b/user-8072/src/main/resources/application-dep.properties
index 2e28acd..d286cee 100644
--- a/user-8072/src/main/resources/application-dep.properties
+++ b/user-8072/src/main/resources/application-dep.properties
@@ -1,7 +1,7 @@
wx.miniapp.configs[0].appid=wx0d4fdb5c7bf3b12b
wx.miniapp.configs[0].secret=989f155fcc3aee616568473faf1b1d3b
-spring.data.redis.host=redis
+spring.data.redis.host=127.0.0.1
spring.data.redis.port=6379
spring.data.redis.database=0
@@ -11,11 +11,11 @@ server.port=8072
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.username=root
-spring.datasource.password=Shuodedaoli114514
-spring.datasource.url=jdbc:mysql://mysql:4514/tutorial?useUnicode=true&characterEncoding=utf8&useSSL=false&ServerTimezone=Asia/Shanghai
+spring.datasource.password=123456
+spring.datasource.url=jdbc:mysql://127.0.0.1:3306/tutorial?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
-spring.cloud.nacos.discovery.server-addr=nacos:8848
+spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848
spring.cloud.nacos.discovery.enabled=true
-management.zipkin.tracing.endpoint=http://zipkin:9411/api/v2/spans
-management.tracing.sampling.probability=1.0
\ No newline at end of file
+management.zipkin.tracing.endpoint=http://127.0.0.1:9411/api/v2/spans
+management.tracing.sampling.probability=1.0
diff --git a/user-8072/src/main/resources/application-dev.properties b/user-8072/src/main/resources/application-dev.properties
index bf4864f..90fc9fb 100644
--- a/user-8072/src/main/resources/application-dev.properties
+++ b/user-8072/src/main/resources/application-dev.properties
@@ -11,5 +11,8 @@ server.port=8072
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.username=root
-spring.datasource.password=12345abcde
+spring.datasource.password=123456
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/tutorial?useUnicode=true&characterEncoding=utf8&useSSL=false&ServerTimezone=Asia/Shanghai
+
+
+dubbo.application.qos-enable=false
\ No newline at end of file
diff --git a/user-8072/src/main/resources/application.properties b/user-8072/src/main/resources/application.properties
index 0896b37..257b306 100644
--- a/user-8072/src/main/resources/application.properties
+++ b/user-8072/src/main/resources/application.properties
@@ -1 +1 @@
-spring.profiles.active=dep
\ No newline at end of file
+spring.profiles.active=dev
\ No newline at end of file