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