refactor: 重命名 backend-single 目录为 server
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
# 本地开发环境配置
|
||||
# Local Development Environment Configuration
|
||||
|
||||
server:
|
||||
port: 19089
|
||||
|
||||
spring:
|
||||
# 数据库配置 - 与prod一致
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://101.200.208.45:3306/emotion_museum?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai&useSSL=false&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password: EmotionMuseum2025*#
|
||||
hikari:
|
||||
minimum-idle: 10
|
||||
maximum-pool-size: 50
|
||||
auto-commit: true
|
||||
idle-timeout: 120000
|
||||
pool-name: EmotionHikariCP-Local
|
||||
max-lifetime: 300000
|
||||
keepalive-time: 60000
|
||||
connection-timeout: 10000
|
||||
validation-timeout: 5000
|
||||
leak-detection-threshold: 60000
|
||||
|
||||
# Redis配置 - 远程Redis,增加超时和连接池优化
|
||||
redis:
|
||||
host: 101.200.208.45
|
||||
port: 6379
|
||||
timeout: 15000ms
|
||||
database: 0
|
||||
password: EmotionMuseum2025*#
|
||||
lettuce:
|
||||
pool:
|
||||
max-active: 20
|
||||
max-wait: 10000ms
|
||||
max-idle: 10
|
||||
min-idle: 5
|
||||
shutdown-timeout: 100ms
|
||||
client-name: emotion-museum-client
|
||||
|
||||
# 日志配置 - 本地开发详细日志
|
||||
logging:
|
||||
level:
|
||||
com.emotion: debug
|
||||
org.springframework.security: debug
|
||||
org.springframework.web: debug
|
||||
org.mybatis: debug
|
||||
root: info
|
||||
file:
|
||||
name: logs/emotion-single-local.log
|
||||
|
||||
# 本地开发特定配置
|
||||
emotion:
|
||||
# 文件上传路径 - 本地开发
|
||||
upload:
|
||||
path: ./uploads/emotion-museum
|
||||
|
||||
# 开发模式配置
|
||||
dev:
|
||||
mock-enabled: true
|
||||
debug-mode: true
|
||||
hot-reload: true
|
||||
|
||||
# 雪花算法配置
|
||||
snowflake:
|
||||
machine-id: 1
|
||||
@@ -0,0 +1,89 @@
|
||||
# 生产环境配置
|
||||
# Production Environment Configuration
|
||||
|
||||
server:
|
||||
port: 19089
|
||||
|
||||
spring:
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 10MB
|
||||
max-request-size: 10MB
|
||||
|
||||
# 数据库配置 - 生产MySQL
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://101.200.208.45:3306/emotion_museum?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai&useSSL=false&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password: EmotionMuseum2025*#
|
||||
hikari:
|
||||
minimum-idle: 10
|
||||
maximum-pool-size: 50
|
||||
auto-commit: true
|
||||
idle-timeout: 120000
|
||||
pool-name: EmotionHikariCP-Prod
|
||||
max-lifetime: 300000
|
||||
keepalive-time: 60000
|
||||
connection-timeout: 10000
|
||||
validation-timeout: 5000
|
||||
leak-detection-threshold: 60000
|
||||
|
||||
# Redis配置 - 生产Redis
|
||||
redis:
|
||||
host: 101.200.208.45
|
||||
port: 6379
|
||||
timeout: 5000ms
|
||||
database: 0
|
||||
password: EmotionMuseum2025*#
|
||||
lettuce:
|
||||
pool:
|
||||
max-active: 20
|
||||
max-wait: -1ms
|
||||
max-idle: 10
|
||||
min-idle: 5
|
||||
time-between-eviction-runs: 30s
|
||||
client-name: emotion-museum-client
|
||||
|
||||
# 日志配置 - 生产环境
|
||||
logging:
|
||||
level:
|
||||
com.emotion: info
|
||||
org.springframework.security: warn
|
||||
root: warn
|
||||
file:
|
||||
name: /data/logs/emotion-museum/emotion-single.log
|
||||
max-size: 200MB
|
||||
max-history: 60
|
||||
|
||||
# 生产环境特定配置
|
||||
emotion:
|
||||
# 文件上传路径 - 生产环境
|
||||
upload:
|
||||
path: /data/uploads/emotion-museum
|
||||
|
||||
# Text-to-speech config
|
||||
tts:
|
||||
enabled: true
|
||||
engine-url: http://127.0.0.1:19110
|
||||
engine-connect-timeout-ms: 5000
|
||||
engine-read-timeout-ms: 240000
|
||||
output-dir: /data/uploads/emotion-museum/tts
|
||||
public-url-prefix: /tts/audio
|
||||
max-text-length: 5000
|
||||
default-voice: default_zh_female
|
||||
default-speech-rate: 0.92
|
||||
default-pitch: 0
|
||||
default-emotion: story
|
||||
|
||||
# Speech-to-text config
|
||||
asr:
|
||||
enabled: true
|
||||
engine-url: http://127.0.0.1:19120
|
||||
max-file-size: 10485760
|
||||
allowed-types: wav,mp3,m4a,mp4,aac,amr
|
||||
|
||||
# 生产模式配置
|
||||
prod:
|
||||
performance-monitoring: true
|
||||
security-enhanced: true
|
||||
cache-enabled: true
|
||||
@@ -0,0 +1,68 @@
|
||||
# 测试环境配置
|
||||
# Test Environment Configuration
|
||||
|
||||
server:
|
||||
port: 19089
|
||||
|
||||
spring:
|
||||
# 数据库配置 - 测试MySQL
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://101.200.208.45:3306/emotion_museum?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai&useSSL=false&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password: EmotionMuseum2025*#
|
||||
hikari:
|
||||
minimum-idle: 5
|
||||
maximum-pool-size: 30
|
||||
auto-commit: true
|
||||
idle-timeout: 300000
|
||||
pool-name: EmotionHikariCP-Test
|
||||
max-lifetime: 1800000
|
||||
connection-timeout: 30000
|
||||
validation-timeout: 3000
|
||||
leak-detection-threshold: 60000
|
||||
|
||||
# Redis配置 - 测试Redis
|
||||
redis:
|
||||
host: 101.200.208.45
|
||||
port: 6379
|
||||
password: EmotionMuseum2025*#
|
||||
timeout: 3000ms
|
||||
database: 1
|
||||
lettuce:
|
||||
pool:
|
||||
max-active: 10
|
||||
max-wait: -1ms
|
||||
max-idle: 8
|
||||
min-idle: 2
|
||||
time-between-eviction-runs: 30s
|
||||
client-name: emotion-museum-client
|
||||
|
||||
# 日志配置 - 测试环境
|
||||
logging:
|
||||
level:
|
||||
com.emotion: debug
|
||||
org.springframework.security: info
|
||||
org.springframework.web: info
|
||||
org.mybatis: info
|
||||
root: info
|
||||
file:
|
||||
name: /data/logs/emotion-museum/emotion-single-test.log
|
||||
max-size: 100MB
|
||||
max-history: 30
|
||||
|
||||
# 测试环境特定配置
|
||||
emotion:
|
||||
# 文件上传路径 - 测试环境
|
||||
upload:
|
||||
path: /data/uploads/emotion-museum-test
|
||||
|
||||
# 测试模式配置
|
||||
test:
|
||||
mock-enabled: false
|
||||
debug-mode: true
|
||||
performance-monitoring: true
|
||||
|
||||
# 雪花算法配置
|
||||
snowflake:
|
||||
machine-id: 2
|
||||
@@ -0,0 +1,144 @@
|
||||
server:
|
||||
port: 19089
|
||||
servlet:
|
||||
context-path: /api
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: emotion-single
|
||||
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 10MB
|
||||
max-request-size: 10MB
|
||||
|
||||
profiles:
|
||||
active: ${SPRING_PROFILES_ACTIVE:local}
|
||||
|
||||
# Jackson配置 - 所有环境统一
|
||||
jackson:
|
||||
date-format: yyyy-MM-dd HH:mm:ss
|
||||
time-zone: GMT+8
|
||||
serialization:
|
||||
write-dates-as-timestamps: false
|
||||
default-property-inclusion: non_null
|
||||
|
||||
# MyBatis Plus配置 - 所有环境统一
|
||||
mybatis-plus:
|
||||
configuration:
|
||||
map-underscore-to-camel-case: true
|
||||
cache-enabled: false
|
||||
call-setters-on-nulls: true
|
||||
jdbc-type-for-null: "null"
|
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
global-config:
|
||||
db-config:
|
||||
id-type: assign_id
|
||||
logic-delete-field: isDeleted
|
||||
logic-delete-value: 1
|
||||
logic-not-delete-value: 0
|
||||
banner: false
|
||||
mapper-locations: classpath*:mapper/*.xml
|
||||
|
||||
# 日志配置 - 所有环境统一
|
||||
logging:
|
||||
level:
|
||||
com.emotion: info
|
||||
org.springframework.security: warn
|
||||
root: info
|
||||
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-single.log
|
||||
max-size: 100MB
|
||||
max-history: 30
|
||||
|
||||
# 管理端点配置 - 所有环境统一
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: health,info,metrics
|
||||
endpoint:
|
||||
health:
|
||||
show-details: always
|
||||
|
||||
# 应用配置 - 所有环境统一
|
||||
emotion:
|
||||
# JWT配置
|
||||
jwt:
|
||||
secret: EmotionMuseumJWTSecretKey2025ForAuthenticationAndAuthorizationSecureEnoughForHS512Algorithm
|
||||
expiration: 86400000 # 24小时
|
||||
header: Authorization
|
||||
prefix: "Bearer "
|
||||
|
||||
wechat:
|
||||
mini-program:
|
||||
app-id: ${WECHAT_MINI_PROGRAM_APP_ID:wxaf2eaba72d28f0e4}
|
||||
app-secret: ${WECHAT_MINI_PROGRAM_APP_SECRET:4f087bd363a4147ef543d634f9f6950d}
|
||||
base-url: https://api.weixin.qq.com
|
||||
|
||||
# Coze API配置 - 所有环境统一
|
||||
coze:
|
||||
api:
|
||||
token: sat_WgqusMh5gTfgRhsEFycGA5n9NailrJYV1rHeruJCHNB1gAvJz4laprLsvK8i2jEL
|
||||
base-url: https://api.coze.cn
|
||||
# 对话聊天
|
||||
chat:
|
||||
path: /v3/chat
|
||||
talk:
|
||||
bot-id: 7523042446285439016
|
||||
workflow-id: 7523047462895796287
|
||||
# 聊天记录总结
|
||||
summary:
|
||||
bot-id: 7529062814150295595
|
||||
workflow-id: 7523047462895796287
|
||||
timeout: 30000
|
||||
retry-count: 3
|
||||
retry-delay: 1000
|
||||
|
||||
# 文件上传配置
|
||||
upload:
|
||||
path: /data/uploads/emotion-museum
|
||||
max-file-size: 10MB
|
||||
allowed-types: jpg,jpeg,png,gif,pdf,doc,docx
|
||||
|
||||
# Text-to-speech config
|
||||
tts:
|
||||
enabled: true
|
||||
engine-url: http://127.0.0.1:19110
|
||||
engine-connect-timeout-ms: 5000
|
||||
engine-read-timeout-ms: 240000
|
||||
output-dir: /data/uploads/emotion-museum/tts
|
||||
public-url-prefix: /tts/audio
|
||||
max-text-length: 5000
|
||||
default-voice: default_zh_female
|
||||
default-speech-rate: 0.92
|
||||
default-pitch: 0
|
||||
default-emotion: story
|
||||
|
||||
# Speech-to-text config
|
||||
asr:
|
||||
enabled: true
|
||||
engine-url: http://127.0.0.1:19120
|
||||
max-file-size: 10485760
|
||||
allowed-types: wav,mp3,m4a,mp4,aac,amr
|
||||
|
||||
# 安全配置
|
||||
security:
|
||||
ignore-urls:
|
||||
- /api/auth/login
|
||||
- /api/auth/register
|
||||
- /api/health
|
||||
- /api/health/info
|
||||
- /api/actuator/**
|
||||
- /api/websocket/**
|
||||
- /api/ai/guest/**
|
||||
|
||||
async:
|
||||
core-pool-size: 10
|
||||
max-pool-size: 50
|
||||
queue-capacity: 200
|
||||
keep-alive-seconds: 60
|
||||
thread-name-prefix: single-async-
|
||||
@@ -0,0 +1,38 @@
|
||||
-- 接口端点表
|
||||
CREATE TABLE IF NOT EXISTS api_endpoint (
|
||||
id VARCHAR(64) PRIMARY KEY,
|
||||
path VARCHAR(500) NOT NULL,
|
||||
method VARCHAR(10) NOT NULL,
|
||||
operation_id VARCHAR(200),
|
||||
summary VARCHAR(500),
|
||||
description TEXT,
|
||||
tags VARCHAR(500),
|
||||
deprecated TINYINT(1) DEFAULT 0,
|
||||
request_schema JSON,
|
||||
response_schema JSON,
|
||||
create_by VARCHAR(64),
|
||||
create_time DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
update_by VARCHAR(64),
|
||||
update_time DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
is_deleted TINYINT(1) DEFAULT 0,
|
||||
remarks VARCHAR(500),
|
||||
|
||||
UNIQUE INDEX idx_operation_id (operation_id)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
-- 接口参数表
|
||||
CREATE TABLE IF NOT EXISTS api_param (
|
||||
id VARCHAR(64) PRIMARY KEY,
|
||||
endpoint_id VARCHAR(64) NOT NULL,
|
||||
param_type VARCHAR(20) NOT NULL,
|
||||
name VARCHAR(100) NOT NULL,
|
||||
required TINYINT(1) DEFAULT 0,
|
||||
param_type_def VARCHAR(50),
|
||||
description VARCHAR(500),
|
||||
default_value VARCHAR(200),
|
||||
enum_values JSON,
|
||||
example VARCHAR(500),
|
||||
|
||||
INDEX idx_endpoint (endpoint_id),
|
||||
FOREIGN KEY (endpoint_id) REFERENCES api_endpoint(id) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
@@ -0,0 +1,2 @@
|
||||
-- 调用日志表新增 user_name 字段
|
||||
ALTER TABLE t_ai_call_log ADD COLUMN user_name VARCHAR(100) DEFAULT NULL COMMENT '用户昵称' AFTER user_id;
|
||||
@@ -0,0 +1,4 @@
|
||||
-- 用户档案表新增标签库字段,用于存储用户专属的完整标签列表(含剩余预设 + 自定义)
|
||||
ALTER TABLE t_user_profile
|
||||
ADD COLUMN personality_tag_library TEXT DEFAULT NULL COMMENT '用户完整性格标签库(JSON数组)',
|
||||
ADD COLUMN hobby_library TEXT DEFAULT NULL COMMENT '用户完整兴趣爱好库(JSON数组)';
|
||||
Reference in New Issue
Block a user