- 添加个人客户微信登录和手机验证码登录接口 - 实现个人客户设备、ICCID、手机号关联管理 - 添加短信发送服务(HTTP 客户端) - 添加微信认证服务(含 mock 实现) - 添加 JWT Token 生成和验证工具 - 创建数据库迁移脚本(personal_customer 关联表) - 修复测试文件中的路由注册参数错误 - 重构 scripts 目录结构(分离独立脚本到子目录) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
101 lines
2.4 KiB
YAML
101 lines
2.4 KiB
YAML
server:
|
||
address: ":3000"
|
||
read_timeout: "10s"
|
||
write_timeout: "10s"
|
||
shutdown_timeout: "30s"
|
||
prefork: false
|
||
|
||
redis:
|
||
address: "cxd.whcxd.cn"
|
||
password: "cpNbWtAaqgo1YJmbMp3h"
|
||
port: 16299
|
||
db: 0
|
||
pool_size: 10
|
||
min_idle_conns: 5
|
||
dial_timeout: "5s"
|
||
read_timeout: "3s"
|
||
write_timeout: "3s"
|
||
|
||
database:
|
||
host: "cxd.whcxd.cn"
|
||
port: 16159
|
||
user: "erp_pgsql"
|
||
password: "erp_2025"
|
||
dbname: "junhong_cmp_test"
|
||
sslmode: "disable"
|
||
max_open_conns: 25
|
||
max_idle_conns: 10
|
||
conn_max_lifetime: "5m"
|
||
|
||
queue:
|
||
concurrency: 10
|
||
queues:
|
||
critical: 6
|
||
default: 3
|
||
low: 1
|
||
retry_max: 5
|
||
timeout: "10m"
|
||
|
||
logging:
|
||
level: "info"
|
||
development: false
|
||
app_log:
|
||
filename: "logs/app.log"
|
||
max_size: 100 # MB
|
||
max_backups: 30
|
||
max_age: 30 # 天
|
||
compress: true
|
||
access_log:
|
||
filename: "logs/access.log"
|
||
max_size: 500 # MB
|
||
max_backups: 90
|
||
max_age: 90 # 天
|
||
compress: true
|
||
|
||
middleware:
|
||
# 认证中间件开关
|
||
enable_auth: true
|
||
|
||
# 限流中间件开关(默认禁用,按需启用)
|
||
enable_rate_limiter: false
|
||
|
||
# 限流器配置
|
||
rate_limiter:
|
||
# 每个时间窗口允许的最大请求数
|
||
# 建议值:
|
||
# - 公开 API(严格): 60-100
|
||
# - 公开 API(宽松): 1000-5000
|
||
# - 内部 API: 5000-10000
|
||
max: 100
|
||
|
||
# 时间窗口(限流重置周期)
|
||
# 支持格式:
|
||
# - "30s" (30秒)
|
||
# - "1m" (1分钟,推荐)
|
||
# - "5m" (5分钟)
|
||
# - "1h" (1小时)
|
||
expiration: "1m"
|
||
|
||
# 限流存储方式
|
||
# 选项:
|
||
# - "memory": 内存存储(单机部署,快速,重启后重置)
|
||
# - "redis": Redis存储(分布式部署,持久化,跨服务器共享)
|
||
# 建议:
|
||
# - 开发/测试环境:使用 "memory"
|
||
# - 生产环境(单机):使用 "memory"
|
||
# - 生产环境(多机):使用 "redis"
|
||
storage: "memory"
|
||
|
||
# 短信服务配置
|
||
sms:
|
||
gateway_url: "https://gateway.sms.whjhft.com:8443/sms"
|
||
username: "JH0001" # TODO: 替换为实际的短信服务账号
|
||
password: "wwR8E4qnL6F0" # TODO: 替换为实际的短信服务密码
|
||
signature: "【JHFTIOT】" # TODO: 替换为报备通过的短信签名
|
||
timeout: "10s"
|
||
|
||
# JWT 配置(用于个人客户认证)
|
||
jwt:
|
||
secret_key: "your-secret-key-change-this-in-production" # TODO: 生产环境必须修改
|
||
token_duration: "168h" # Token 有效期(7天)
|