feat: 项目初始化及当前全部内容提交

This commit is contained in:
2025-07-15 17:37:50 +08:00
parent ec817067f1
commit e78f192d34
622 changed files with 75174 additions and 383 deletions
+48
View File
@@ -0,0 +1,48 @@
# 网关服务Dockerfile
FROM openjdk:17-jdk-alpine
# 设置工作目录
WORKDIR /app
# 安装必要的工具
RUN apk add --no-cache curl tzdata && \
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
echo "Asia/Shanghai" > /etc/timezone
# 复制Maven构建文件
COPY pom.xml ./
COPY emotion-common ./emotion-common
COPY emotion-gateway ./emotion-gateway
# 安装Maven
RUN apk add --no-cache maven
# 构建应用
RUN mvn clean package -DskipTests -pl emotion-gateway -am
# 创建运行用户
RUN addgroup -g 1000 emotion && \
adduser -D -s /bin/sh -u 1000 -G emotion emotion
# 复制jar文件
RUN cp emotion-gateway/target/emotion-gateway-*.jar app.jar
# 设置文件权限
RUN chown -R emotion:emotion /app
# 切换到非root用户
USER emotion
# 健康检查
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
CMD curl -f http://localhost:19000/actuator/health || exit 1
# 暴露端口
EXPOSE 19000
# 启动命令
ENTRYPOINT ["java", "-jar", \
"-Xms512m", "-Xmx1024m", \
"-Djava.security.egd=file:/dev/./urandom", \
"-Dspring.profiles.active=local", \
"app.jar"]
+100
View File
@@ -0,0 +1,100 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.emotionmuseum</groupId>
<artifactId>backend</artifactId>
<version>1.0.0</version>
</parent>
<artifactId>emotion-gateway</artifactId>
<name>emotion-gateway</name>
<description>API网关服务</description>
<dependencies>
<!-- 公共模块(排除Web依赖,网关使用Reactive -->
<dependency>
<groupId>com.emotionmuseum</groupId>
<artifactId>emotion-common</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Spring Cloud Gateway -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-gateway</artifactId>
</dependency>
<!-- Nacos Discovery -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<!-- Nacos Config -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<!-- Sentinel -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
</dependency>
<!-- Sentinel Gateway -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-sentinel-gateway</artifactId>
</dependency>
<!-- LoadBalancer -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
</dependency>
<!-- Redis -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis-reactive</artifactId>
</dependency>
<!-- Spring Boot DevTools for automatic restart -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<!-- 监控 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
@@ -0,0 +1,20 @@
package com.emotionmuseum.gateway;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
/**
* 网关服务启动类
*
* @author emotion-museum
* @since 2025-07-12
*/
@SpringBootApplication
@EnableDiscoveryClient
public class GatewayApplication {
public static void main(String[] args) {
SpringApplication.run(GatewayApplication.class, args);
}
}
@@ -0,0 +1,121 @@
# Gateway Docker环境配置
server:
port: 9000
spring:
application:
name: emotion-gateway
profiles:
active: docker
cloud:
nacos:
discovery:
server-addr: ${NACOS_SERVER_ADDR:nacos:8848}
namespace: public
group: DEFAULT_GROUP
config:
server-addr: ${NACOS_SERVER_ADDR:nacos:8848}
file-extension: yml
namespace: public
group: DEFAULT_GROUP
gateway:
discovery:
locator:
enabled: true
lower-case-service-id: true
routes:
# AI服务路由
- id: emotion-ai
uri: lb://emotion-ai
predicates:
- Path=/api/ai/**
filters:
- StripPrefix=1
# 用户服务路由
- id: emotion-user
uri: lb://emotion-user
predicates:
- Path=/api/user/**
filters:
- StripPrefix=1
# 记录服务路由
- id: emotion-record
uri: lb://emotion-record
predicates:
- Path=/api/record/**
filters:
- StripPrefix=1
# 成长服务路由
- id: emotion-growth
uri: lb://emotion-growth
predicates:
- Path=/api/growth/**
filters:
- StripPrefix=1
# 探索服务路由
- id: emotion-explore
uri: lb://emotion-explore
predicates:
- Path=/api/explore/**
filters:
- StripPrefix=1
# 奖励服务路由
- id: emotion-reward
uri: lb://emotion-reward
predicates:
- Path=/api/reward/**
filters:
- StripPrefix=1
# 统计服务路由
- id: emotion-stats
uri: lb://emotion-stats
predicates:
- Path=/api/stats/**
filters:
- StripPrefix=1
globalcors:
cors-configurations:
'[/**]':
allowedOriginPatterns: "*"
allowedMethods: "*"
allowedHeaders: "*"
allowCredentials: true
# 数据源配置
datasource:
url: jdbc:mysql://${MYSQL_HOST:mysql}:${MYSQL_PORT:3306}/emotion_museum?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true
username: root
password: 123456
driver-class-name: com.mysql.cj.jdbc.Driver
# Redis配置
redis:
host: ${REDIS_HOST:redis}
port: ${REDIS_PORT:6379}
password:
database: 0
timeout: 6000ms
lettuce:
pool:
max-active: 8
max-wait: -1ms
max-idle: 8
min-idle: 0
# 日志配置
logging:
level:
com.emotionmuseum: DEBUG
org.springframework.cloud.gateway: DEBUG
pattern:
console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level [%logger{50}] - %msg%n"
# 管理端点
management:
endpoints:
web:
exposure:
include: health,info,metrics,prometheus
endpoint:
health:
show-details: always
@@ -0,0 +1,129 @@
server:
port: 19000
spring:
application:
name: emotion-gateway
# Redis配置
data:
redis:
host: localhost
port: 6379
password:
database: 0
timeout: 10000ms
lettuce:
pool:
max-active: 8
max-wait: -1ms
max-idle: 8
min-idle: 0
# 网关配置
cloud:
gateway:
discovery:
locator:
enabled: true
lower-case-service-id: true
routes:
# 用户服务路由
- id: emotion-user-route
uri: lb://emotion-user
predicates:
- Path=/user/**
filters:
- StripPrefix=0
# AI服务路由
- id: emotion-ai-route
uri: lb://emotion-ai
predicates:
- Path=/ai/**
filters:
- StripPrefix=0
# 记录服务路由
- id: emotion-record-route
uri: lb://emotion-record
predicates:
- Path=/record/**
filters:
- StripPrefix=0
# 成长服务路由
- id: emotion-growth-route
uri: lb://emotion-growth
predicates:
- Path=/growth/**
filters:
- StripPrefix=0
# 探索服务路由
- id: emotion-explore-route
uri: lb://emotion-explore
predicates:
- Path=/explore/**
filters:
- StripPrefix=0
# 奖励服务路由
- id: emotion-reward-route
uri: lb://emotion-reward
predicates:
- Path=/reward/**
filters:
- StripPrefix=0
# 统计服务路由
- id: emotion-stats-route
uri: lb://emotion-stats
predicates:
- Path=/stats/**
filters:
- StripPrefix=0
# Nacos配置
spring:
cloud:
nacos:
discovery:
server-addr: localhost:8848
namespace:
group: DEFAULT_GROUP
enabled: true
register-enabled: true
heart-beat-interval: 5000
heart-beat-timeout: 15000
ip-delete-timeout: 30000
config:
server-addr: localhost:8848
namespace:
group: DEFAULT_GROUP
file-extension: yml
enabled: false
# 日志配置
logging:
level:
com.emotionmuseum: debug
org.springframework.cloud.gateway: debug
org.springframework.web: debug
pattern:
console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{50} - %msg%n"
file: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{50} - %msg%n"
file:
name: logs/emotion-gateway-local.log
# 管理端点配置
management:
endpoints:
web:
exposure:
include: health,info,metrics,gateway
endpoint:
health:
show-details: always
gateway:
enabled: true
@@ -0,0 +1,105 @@
server:
port: 9000
spring:
application:
name: emotion-gateway
autoconfigure:
exclude:
- org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
- org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
- com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration
data:
redis:
host: ${REDIS_HOST:localhost}
port: ${REDIS_PORT:6379}
database: 0
timeout: 3000ms
lettuce:
pool:
max-active: 20
max-idle: 10
min-idle: 5
max-wait: 3000ms
cloud:
nacos:
discovery:
server-addr: ${NACOS_SERVER_ADDR:localhost:8848}
namespace: public
group: DEFAULT_GROUP
enabled: true
ip: ${SERVER_IP:localhost}
metadata:
version: 1.0.0
environment: prod
config:
enabled: false
gateway:
discovery:
locator:
enabled: true
lower-case-service-id: true
routes:
# 用户服务路由
- id: emotion-user
uri: lb://emotion-user
predicates:
- Path=/api/user/**
# AI服务路由
- id: emotion-ai
uri: lb://emotion-ai
predicates:
- Path=/api/ai/**
# 记录服务路由
- id: emotion-record
uri: lb://emotion-record
predicates:
- Path=/api/record/**
filters:
- StripPrefix=1
# 成长服务路由
- id: emotion-growth
uri: lb://emotion-growth
predicates:
- Path=/api/growth/**
filters:
- StripPrefix=1
# 探索服务路由
- id: emotion-explore
uri: lb://emotion-explore
predicates:
- Path=/api/explore/**
filters:
- StripPrefix=1
# 奖励服务路由
- id: emotion-reward
uri: lb://emotion-reward
predicates:
- Path=/api/reward/**
filters:
- StripPrefix=1
# 统计服务路由
- id: emotion-stats
uri: lb://emotion-stats
predicates:
- Path=/api/stats/**
filters:
- StripPrefix=1
# 日志配置
logging:
level:
com.emotionmuseum: INFO
org.springframework.cloud.gateway: DEBUG
pattern:
console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"
# 管理端点
management:
endpoints:
web:
exposure:
include: health,info,gateway
endpoint:
health:
show-details: always
@@ -0,0 +1,118 @@
server:
port: 19000
spring:
application:
name: emotion-gateway
profiles:
active: dev
autoconfigure:
exclude:
- org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
- org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
- com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration
data:
redis:
host: localhost
port: 6379
database: 0
timeout: 3000ms
lettuce:
pool:
max-active: 20
max-idle: 10
min-idle: 5
max-wait: 3000ms
cloud:
nacos:
discovery:
server-addr: localhost:8848
namespace: emotion-dev
group: DEFAULT_GROUP
enabled: false
config:
enabled: false
gateway:
discovery:
locator:
enabled: true
lower-case-service-id: true
routes:
# 用户服务路由
- id: emotion-user
uri: lb://emotion-user
predicates:
- Path=/api/user/**
filters:
- StripPrefix=2
# AI对话服务路由
- id: emotion-ai
uri: lb://emotion-ai
predicates:
- Path=/api/ai/**
filters:
- StripPrefix=2
# 情绪记录服务路由
- id: emotion-record
uri: lb://emotion-record
predicates:
- Path=/api/record/**
filters:
- StripPrefix=2
# 成长课题服务路由
- id: emotion-growth
uri: lb://emotion-growth
predicates:
- Path=/api/growth/**
filters:
- StripPrefix=2
# 地图探索服务路由
- id: emotion-explore
uri: lb://emotion-explore
predicates:
- Path=/api/explore/**
filters:
- StripPrefix=2
# 成就奖励服务路由
- id: emotion-reward
uri: lb://emotion-reward
predicates:
- Path=/api/reward/**
filters:
- StripPrefix=2
# 统计分析服务路由
- id: emotion-stats
uri: lb://emotion-stats
predicates:
- Path=/api/stats/**
filters:
- StripPrefix=2
# 全局过滤器 (暂时禁用,需要实现对应的过滤器类)
# default-filters:
# - name: GlobalAuthFilter
# - name: GlobalLogFilter
# 监控配置
management:
endpoints:
web:
exposure:
include: health,info,gateway
endpoint:
health:
show-details: always
# 日志配置
logging:
level:
com.emotionmuseum: debug
org.springframework.cloud.gateway: debug
pattern:
console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level [%logger{50}] - %msg%n"
@@ -0,0 +1,121 @@
# Gateway Docker环境配置
server:
port: 9000
spring:
application:
name: emotion-gateway
profiles:
active: docker
cloud:
nacos:
discovery:
server-addr: ${NACOS_SERVER_ADDR:nacos:8848}
namespace: public
group: DEFAULT_GROUP
config:
server-addr: ${NACOS_SERVER_ADDR:nacos:8848}
file-extension: yml
namespace: public
group: DEFAULT_GROUP
gateway:
discovery:
locator:
enabled: true
lower-case-service-id: true
routes:
# AI服务路由
- id: emotion-ai
uri: lb://emotion-ai
predicates:
- Path=/api/ai/**
filters:
- StripPrefix=1
# 用户服务路由
- id: emotion-user
uri: lb://emotion-user
predicates:
- Path=/api/user/**
filters:
- StripPrefix=1
# 记录服务路由
- id: emotion-record
uri: lb://emotion-record
predicates:
- Path=/api/record/**
filters:
- StripPrefix=1
# 成长服务路由
- id: emotion-growth
uri: lb://emotion-growth
predicates:
- Path=/api/growth/**
filters:
- StripPrefix=1
# 探索服务路由
- id: emotion-explore
uri: lb://emotion-explore
predicates:
- Path=/api/explore/**
filters:
- StripPrefix=1
# 奖励服务路由
- id: emotion-reward
uri: lb://emotion-reward
predicates:
- Path=/api/reward/**
filters:
- StripPrefix=1
# 统计服务路由
- id: emotion-stats
uri: lb://emotion-stats
predicates:
- Path=/api/stats/**
filters:
- StripPrefix=1
globalcors:
cors-configurations:
'[/**]':
allowedOriginPatterns: "*"
allowedMethods: "*"
allowedHeaders: "*"
allowCredentials: true
# 数据源配置
datasource:
url: jdbc:mysql://${MYSQL_HOST:mysql}:${MYSQL_PORT:3306}/emotion_museum?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true
username: root
password: 123456
driver-class-name: com.mysql.cj.jdbc.Driver
# Redis配置
redis:
host: ${REDIS_HOST:redis}
port: ${REDIS_PORT:6379}
password:
database: 0
timeout: 6000ms
lettuce:
pool:
max-active: 8
max-wait: -1ms
max-idle: 8
min-idle: 0
# 日志配置
logging:
level:
com.emotionmuseum: DEBUG
org.springframework.cloud.gateway: DEBUG
pattern:
console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level [%logger{50}] - %msg%n"
# 管理端点
management:
endpoints:
web:
exposure:
include: health,info,metrics,prometheus
endpoint:
health:
show-details: always
@@ -0,0 +1,129 @@
server:
port: 19000
spring:
application:
name: emotion-gateway
# Redis配置
data:
redis:
host: localhost
port: 6379
password:
database: 0
timeout: 10000ms
lettuce:
pool:
max-active: 8
max-wait: -1ms
max-idle: 8
min-idle: 0
# 网关配置
cloud:
gateway:
discovery:
locator:
enabled: true
lower-case-service-id: true
routes:
# 用户服务路由
- id: emotion-user-route
uri: lb://emotion-user
predicates:
- Path=/user/**
filters:
- StripPrefix=0
# AI服务路由
- id: emotion-ai-route
uri: lb://emotion-ai
predicates:
- Path=/ai/**
filters:
- StripPrefix=0
# 记录服务路由
- id: emotion-record-route
uri: lb://emotion-record
predicates:
- Path=/record/**
filters:
- StripPrefix=0
# 成长服务路由
- id: emotion-growth-route
uri: lb://emotion-growth
predicates:
- Path=/growth/**
filters:
- StripPrefix=0
# 探索服务路由
- id: emotion-explore-route
uri: lb://emotion-explore
predicates:
- Path=/explore/**
filters:
- StripPrefix=0
# 奖励服务路由
- id: emotion-reward-route
uri: lb://emotion-reward
predicates:
- Path=/reward/**
filters:
- StripPrefix=0
# 统计服务路由
- id: emotion-stats-route
uri: lb://emotion-stats
predicates:
- Path=/stats/**
filters:
- StripPrefix=0
# Nacos配置
spring:
cloud:
nacos:
discovery:
server-addr: localhost:8848
namespace:
group: DEFAULT_GROUP
enabled: true
register-enabled: true
heart-beat-interval: 5000
heart-beat-timeout: 15000
ip-delete-timeout: 30000
config:
server-addr: localhost:8848
namespace:
group: DEFAULT_GROUP
file-extension: yml
enabled: false
# 日志配置
logging:
level:
com.emotionmuseum: debug
org.springframework.cloud.gateway: debug
org.springframework.web: debug
pattern:
console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{50} - %msg%n"
file: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{50} - %msg%n"
file:
name: logs/emotion-gateway-local.log
# 管理端点配置
management:
endpoints:
web:
exposure:
include: health,info,metrics,gateway
endpoint:
health:
show-details: always
gateway:
enabled: true
@@ -0,0 +1,105 @@
server:
port: 9000
spring:
application:
name: emotion-gateway
autoconfigure:
exclude:
- org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
- org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
- com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration
data:
redis:
host: ${REDIS_HOST:localhost}
port: ${REDIS_PORT:6379}
database: 0
timeout: 3000ms
lettuce:
pool:
max-active: 20
max-idle: 10
min-idle: 5
max-wait: 3000ms
cloud:
nacos:
discovery:
server-addr: ${NACOS_SERVER_ADDR:localhost:8848}
namespace: public
group: DEFAULT_GROUP
enabled: true
ip: ${SERVER_IP:localhost}
metadata:
version: 1.0.0
environment: prod
config:
enabled: false
gateway:
discovery:
locator:
enabled: true
lower-case-service-id: true
routes:
# 用户服务路由
- id: emotion-user
uri: lb://emotion-user
predicates:
- Path=/api/user/**
# AI服务路由
- id: emotion-ai
uri: lb://emotion-ai
predicates:
- Path=/api/ai/**
# 记录服务路由
- id: emotion-record
uri: lb://emotion-record
predicates:
- Path=/api/record/**
filters:
- StripPrefix=1
# 成长服务路由
- id: emotion-growth
uri: lb://emotion-growth
predicates:
- Path=/api/growth/**
filters:
- StripPrefix=1
# 探索服务路由
- id: emotion-explore
uri: lb://emotion-explore
predicates:
- Path=/api/explore/**
filters:
- StripPrefix=1
# 奖励服务路由
- id: emotion-reward
uri: lb://emotion-reward
predicates:
- Path=/api/reward/**
filters:
- StripPrefix=1
# 统计服务路由
- id: emotion-stats
uri: lb://emotion-stats
predicates:
- Path=/api/stats/**
filters:
- StripPrefix=1
# 日志配置
logging:
level:
com.emotionmuseum: INFO
org.springframework.cloud.gateway: DEBUG
pattern:
console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"
# 管理端点
management:
endpoints:
web:
exposure:
include: health,info,gateway
endpoint:
health:
show-details: always
@@ -0,0 +1,118 @@
server:
port: 19000
spring:
application:
name: emotion-gateway
profiles:
active: dev
autoconfigure:
exclude:
- org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
- org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
- com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration
data:
redis:
host: localhost
port: 6379
database: 0
timeout: 3000ms
lettuce:
pool:
max-active: 20
max-idle: 10
min-idle: 5
max-wait: 3000ms
cloud:
nacos:
discovery:
server-addr: localhost:8848
namespace: emotion-dev
group: DEFAULT_GROUP
enabled: false
config:
enabled: false
gateway:
discovery:
locator:
enabled: true
lower-case-service-id: true
routes:
# 用户服务路由
- id: emotion-user
uri: lb://emotion-user
predicates:
- Path=/api/user/**
filters:
- StripPrefix=2
# AI对话服务路由
- id: emotion-ai
uri: lb://emotion-ai
predicates:
- Path=/api/ai/**
filters:
- StripPrefix=2
# 情绪记录服务路由
- id: emotion-record
uri: lb://emotion-record
predicates:
- Path=/api/record/**
filters:
- StripPrefix=2
# 成长课题服务路由
- id: emotion-growth
uri: lb://emotion-growth
predicates:
- Path=/api/growth/**
filters:
- StripPrefix=2
# 地图探索服务路由
- id: emotion-explore
uri: lb://emotion-explore
predicates:
- Path=/api/explore/**
filters:
- StripPrefix=2
# 成就奖励服务路由
- id: emotion-reward
uri: lb://emotion-reward
predicates:
- Path=/api/reward/**
filters:
- StripPrefix=2
# 统计分析服务路由
- id: emotion-stats
uri: lb://emotion-stats
predicates:
- Path=/api/stats/**
filters:
- StripPrefix=2
# 全局过滤器 (暂时禁用,需要实现对应的过滤器类)
# default-filters:
# - name: GlobalAuthFilter
# - name: GlobalLogFilter
# 监控配置
management:
endpoints:
web:
exposure:
include: health,info,gateway
endpoint:
health:
show-details: always
# 日志配置
logging:
level:
com.emotionmuseum: debug
org.springframework.cloud.gateway: debug
pattern:
console: "%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level [%logger{50}] - %msg%n"
@@ -0,0 +1,3 @@
artifactId=emotion-gateway
groupId=com.emotionmuseum
version=1.0.0
@@ -0,0 +1 @@
com/emotionmuseum/gateway/GatewayApplication.class
@@ -0,0 +1 @@
/Users/huazhongmin/peanut/AppleDevelop/EmotionMuseum/backend/emotion-gateway/src/main/java/com/emotionmuseum/gateway/GatewayApplication.java