Files
zhengchiliu 0863234bc5 feat(backend): 对齐业务服务额度与内容治理口径
仪表盘待办与穿搭概况改为公开/私密/已封禁口径,移除恒为零的待审核统计;补齐额度凭证来源 source=4 与流水 change_type=7 枚举及订单商品类型、额度有效期快照字段;管理员发放与回收额度凭证在同一事务内写入人工调整流水,回收流水使用独立 order_no 避免撞唯一索引,并增加凭证归属校验;对齐 Quota 配置免费额度值,同步更新 README 与配置说明。
2026-09-16 02:58:56 +08:00

70 lines
2.9 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
Server:
Domain: admin.example.com #服务域名,用于 CORS 允许来源(http/https 均放行);置 * 或不填则允许所有来源
RunMode: release #gin运行模式,debug 和 release
HttpPort: 8081
ReadTimeout: 60
WriteTimeout: 60
Log:
LogSavePath: storage/logs
LogFileName: app
LogFileExt: .log
MaxSize: 100
MaxBackups: 10
MaxAge: 30
LogLevel: Info #日志级别,Debug, Info, Warn, Error
Mysql:
UserName: your_mysql_user
Password: your_mysql_password
Host: 127.0.0.1
Port: 3306
DBName: your_db_name # 与业务服务(zt-closet-backend)共用同一个库
MaxIdleConns: 30
MaxOpenConns: 100
ConnMaxLifeTime: 3600
ConnMaxIdleTime: 600
Redis:
Host: 127.0.0.1
Port: 6379
Password: ""
DB: 0
PoolSize: 20
MinIdleConns: 5
MaxIdleConns: 20
MaxRetryBackoff: 512
MinRetryBackoff: 8
MaxRetries: 3
DialTimeout: 5
ReadTimeout: 3
WriteTimeout: 3
PoolTimeout: 4
OTel:
Enabled: true
ServiceName: zt-closet-manage-backend
ServiceVersion: 1.0.0
Environment: dev
ExporterEndpoint: 127.0.0.1:4317 # OTLP gRPC 端点
Insecure: true # 本地/内网不开 TLS
SamplerRatio: 1.0 # 采样率 0~1
JWT:
SecretKey: replace_with_a_strong_random_secret # 必填:留空会导致启动失败;务必与业务服务使用不同密钥
Issuer: zt-closet-manage # 签发方,与业务服务 Issuer 区分,防止跨服务 token 混用
AccessTokenExpire: 7200 # access token 有效期(秒)
RefreshTokenExpire: 86400 # refresh token 有效期(秒)
Admin:
# 初始超级管理员账号:服务启动时幂等创建(已存在则跳过),仅用于首次登录,登录后请及时修改密码。
InitialUsername: admin # 必填:留空则跳过初始账号创建
InitialPassword: Admin@123456 # 初始密码(明文仅存在于配置文件中,入库为 bcrypt 哈希)
Quota:
# 免费额度底值(仅用于管理后台计算并展示「总额度」),必须与业务服务 UserDefaultQuota 免费值保持一致;
# 不一致会导致用户详情「每日额度」的 Total/Remain 偏大或偏小。
# 删除某项或整段则回落内置默认(Cos 20 / AI 3 / OutfitShare 10 / ClosetShare 5);负数视为非法,同样回落默认。
Cos: 20 # 免费上传额度(永久)
AI: 3 # 免费 AI 推荐额度(每日)
OutfitShare: 3 # 免费社区分享额度(每日)
ClosetShare: 0 # 免费衣柜分享额度(每日)
Cos:
# CDN 下载配置:用于把衣物图片/头像的相对 COS key 拼接为带鉴权签名的可访问 URL。
# 必须与业务服务(zt-closet-backend)configs/config.yaml 的 Cos 段保持一致,否则图片签名校验失败。
CosDownloadDomain: your_cos_download_domain # CDN 下载域名
CdnDownloadSecretKey: your_cdn_download_secret_key # CDN 下载鉴权密钥(机密)