init
This commit is contained in:
79
server/configs/config.dev.yaml
Normal file
79
server/configs/config.dev.yaml
Normal file
@@ -0,0 +1,79 @@
|
||||
# 开发环境配置
|
||||
server:
|
||||
port: 8081
|
||||
mode: debug # debug, release, test
|
||||
|
||||
# 数据库配置 - 开发环境
|
||||
database:
|
||||
driver: mysql
|
||||
host: 127.0.0.1
|
||||
port: 3306
|
||||
username: root
|
||||
password: "JKjk20011115"
|
||||
dbname: ai_dianshang
|
||||
charset: utf8mb4
|
||||
parseTime: true
|
||||
loc: Local
|
||||
autoMigrate: true # 开发环境启用自动迁移
|
||||
logLevel: info # 开发环境显示SQL日志
|
||||
|
||||
# Redis配置 - 开发环境
|
||||
redis:
|
||||
host: localhost
|
||||
port: 6379
|
||||
password: ""
|
||||
db: 0
|
||||
|
||||
# JWT配置 - 开发环境
|
||||
jwt:
|
||||
secret: "dev-jwt-secret-key-not-for-production"
|
||||
expire: 7200 # 2小时,单位:秒
|
||||
|
||||
# 日志配置 - 开发环境
|
||||
log:
|
||||
level: debug # debug, info, warn, error
|
||||
filename: logs/app.dev.log
|
||||
maxSize: 100 # MB
|
||||
maxAge: 7 # 天 (开发环境保留时间短)
|
||||
maxBackups: 3 # 保留文件数
|
||||
enableConsole: true
|
||||
enableFile: true
|
||||
format: text # 开发环境使用text格式便于阅读
|
||||
enableCaller: true
|
||||
enableOperation: true
|
||||
enablePerf: true
|
||||
perfThreshold: 500 # 开发环境更严格的性能阈值
|
||||
|
||||
# 微信小程序配置 - 开发环境
|
||||
wechat:
|
||||
appId: "wxccc7018b3bfff234"
|
||||
appSecret: "fa5802a24e7dca8a3cf91ad1e2f288e8"
|
||||
|
||||
# 微信支付配置 - 开发环境
|
||||
wechatPay:
|
||||
environment: "production" # sandbox(沙箱) 或 production(生产)
|
||||
appId: "wxccc7018b3bfff234" # 您的真实微信小程序AppID
|
||||
mchId: "1726717114" # 您的真实微信支付商户号
|
||||
apiV3Key: "M2nB4vCxZ7qW8eKrDtA1jHlP5gF3sN9y" # 您的真实APIv3密钥(32位)
|
||||
certPath: "certs/apiclient_cert.pem" # 商户证书路径
|
||||
keyPath: "certs/apiclient_key.pem" # 商户私钥路径
|
||||
serialNo: "26DA8C2BC03B796222DA3FCFC6825B236A8C7538" # 证书序列号
|
||||
notifyUrl: "http://192.168.10.109:8081/api/v1/payment/notify" # 支付回调地址
|
||||
refundNotifyUrl: "http://192.168.10.109:8081/api/refunds/callback" # 退款回调地址
|
||||
|
||||
upload:
|
||||
maxImageSize: 5242880 # 5MB (5 * 1024 * 1024)
|
||||
maxFileSize: 10485760 # 10MB (10 * 1024 * 1024)
|
||||
imageTypes: [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg"]
|
||||
staticPath: "./static"
|
||||
baseUrl: "http://localhost:8080"
|
||||
storageType: "oss" # local(本地存储) 或 oss(阿里云OSS)
|
||||
|
||||
# 阿里云OSS配置(当storageType为oss时生效)
|
||||
oss:
|
||||
endpoint: "oss-cn-beijing.aliyuncs.com" # OSS访问域名,根据你的地域修改
|
||||
accessKeyId: "LTAI5tNesdhDH4ErqEUZmEg2" # 你的AccessKey ID
|
||||
accessKeySecret: "xZn7WUkTW76TqOLTh01zZATnU6p3Tf" # 你的AccessKey Secret
|
||||
bucketName: "bxmkb-beijing" # 你的Bucket名称
|
||||
basePath: "dianshang/" # 文件存储基础路径
|
||||
domain: "" # 自定义域名(可选,如果有CDN加速域名)
|
||||
132
server/configs/config.oss.example.yaml
Normal file
132
server/configs/config.oss.example.yaml
Normal file
@@ -0,0 +1,132 @@
|
||||
# 阿里云OSS配置示例
|
||||
# 将此文件复制为 config.yaml 或 config.prod.yaml,并填入你的实际配置信息
|
||||
|
||||
server:
|
||||
port: 8080
|
||||
mode: release
|
||||
|
||||
database:
|
||||
driver: mysql
|
||||
host: 127.0.0.1
|
||||
port: 3306
|
||||
username: root
|
||||
password: "your-password"
|
||||
dbname: ai_dianshang
|
||||
charset: utf8mb4
|
||||
parseTime: true
|
||||
loc: Local
|
||||
|
||||
redis:
|
||||
host: localhost
|
||||
port: 6379
|
||||
password: ""
|
||||
db: 0
|
||||
|
||||
jwt:
|
||||
secret: "your-jwt-secret-key-change-this-in-production"
|
||||
expire: 7200
|
||||
|
||||
log:
|
||||
level: info
|
||||
filename: logs/app.log
|
||||
maxSize: 100
|
||||
maxAge: 30
|
||||
maxBackups: 5
|
||||
enableConsole: true
|
||||
enableFile: true
|
||||
format: json
|
||||
enableCaller: true
|
||||
enableOperation: true
|
||||
enablePerf: true
|
||||
perfThreshold: 1000
|
||||
|
||||
wechat:
|
||||
appId: "your-wechat-appid"
|
||||
appSecret: "your-wechat-appsecret"
|
||||
|
||||
wechatPay:
|
||||
environment: "production"
|
||||
appId: "your-wechat-appid"
|
||||
mchId: "your-merchant-id"
|
||||
apiV3Key: "your-api-v3-key-32-characters"
|
||||
certPath: "certs/apiclient_cert.pem"
|
||||
keyPath: "certs/apiclient_key.pem"
|
||||
serialNo: "your-certificate-serial-number"
|
||||
notifyUrl: "https://yourdomain.com/api/v1/payment/notify"
|
||||
refundNotifyUrl: "https://yourdomain.com/api/refunds/callback"
|
||||
|
||||
# ========== 文件上传配置 ==========
|
||||
upload:
|
||||
maxImageSize: 5242880 # 5MB
|
||||
maxFileSize: 10485760 # 10MB
|
||||
imageTypes: [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg"]
|
||||
|
||||
# 存储类型选择:
|
||||
# - local: 本地存储(默认)
|
||||
# - oss: 阿里云OSS
|
||||
storageType: "oss"
|
||||
|
||||
# 本地存储配置(storageType为local时使用)
|
||||
staticPath: "./static"
|
||||
baseUrl: "https://yourdomain.com"
|
||||
|
||||
# 阿里云OSS配置(storageType为oss时使用)
|
||||
oss:
|
||||
# OSS访问域名(Endpoint)
|
||||
# 根据你的Bucket所在地域选择:
|
||||
# - 华东1(杭州):oss-cn-hangzhou.aliyuncs.com
|
||||
# - 华东2(上海):oss-cn-shanghai.aliyuncs.com
|
||||
# - 华北1(青岛):oss-cn-qingdao.aliyuncs.com
|
||||
# - 华北2(北京):oss-cn-beijing.aliyuncs.com
|
||||
# - 华南1(深圳):oss-cn-shenzhen.aliyuncs.com
|
||||
# 更多地域请参考:https://help.aliyun.com/document_detail/31837.html
|
||||
endpoint: "oss-cn-hangzhou.aliyuncs.com"
|
||||
|
||||
# AccessKey ID(在阿里云控制台获取)
|
||||
# 建议使用RAM子账号的AccessKey,并授予最小权限
|
||||
accessKeyId: "your-access-key-id"
|
||||
|
||||
# AccessKey Secret(在阿里云控制台获取)
|
||||
accessKeySecret: "your-access-key-secret"
|
||||
|
||||
# Bucket名称(需要提前在OSS控制台创建)
|
||||
bucketName: "your-bucket-name"
|
||||
|
||||
# 文件存储基础路径(可选,建议设置以便文件分类管理)
|
||||
# 例如:dianshang/ 表示所有文件都存储在 dianshang/ 目录下
|
||||
basePath: "dianshang/"
|
||||
|
||||
# 自定义域名(可选)
|
||||
# 如果你配置了CDN加速域名或自定义域名,填写这里
|
||||
# 例如:https://cdn.yourdomain.com
|
||||
# 如果不填写,将使用默认的OSS域名:https://bucket-name.endpoint/
|
||||
domain: ""
|
||||
|
||||
# ========== OSS配置说明 ==========
|
||||
#
|
||||
# 1. 创建OSS Bucket:
|
||||
# - 登录阿里云OSS控制台:https://oss.console.aliyun.com/
|
||||
# - 创建Bucket,选择合适的地域和存储类型
|
||||
# - 设置读写权限为"公共读"(如果需要直接访问)或"私有"(使用签名URL访问)
|
||||
#
|
||||
# 2. 获取AccessKey:
|
||||
# - 访问:https://ram.console.aliyun.com/manage/ak
|
||||
# - 建议创建RAM子账号,只授予OSS相关权限(AliyunOSSFullAccess)
|
||||
# - 获取AccessKey ID和AccessKey Secret
|
||||
#
|
||||
# 3. 配置跨域(CORS):
|
||||
# - 在OSS控制台的Bucket设置中配置CORS规则
|
||||
# - 允许的来源:* 或你的域名
|
||||
# - 允许的方法:GET, POST, PUT, DELETE, HEAD
|
||||
# - 允许的Headers:*
|
||||
#
|
||||
# 4. CDN加速(可选但推荐):
|
||||
# - 在OSS控制台绑定自定义域名
|
||||
# - 开启CDN加速以提升访问速度
|
||||
# - 配置HTTPS证书
|
||||
# - 将domain设置为你的CDN域名
|
||||
#
|
||||
# 5. 切换存储方式:
|
||||
# - 修改 storageType 为 "local" 使用本地存储
|
||||
# - 修改 storageType 为 "oss" 使用阿里云OSS
|
||||
# - 系统支持降级:OSS上传失败时自动切换到本地存储
|
||||
65
server/configs/config.prod.example.yaml
Normal file
65
server/configs/config.prod.example.yaml
Normal file
@@ -0,0 +1,65 @@
|
||||
# 生产环境微信支付配置示例
|
||||
# 请复制此文件为 config.prod.yaml 并填入真实参数
|
||||
|
||||
server:
|
||||
port: 8080
|
||||
mode: release
|
||||
|
||||
# 数据库配置 - 生产环境
|
||||
database:
|
||||
driver: mysql
|
||||
host: your_db_host
|
||||
port: 3306
|
||||
username: your_db_user
|
||||
password: "your_db_password"
|
||||
dbname: ai_dianshang
|
||||
charset: utf8mb4
|
||||
parseTime: true
|
||||
loc: Local
|
||||
|
||||
# Redis配置 - 生产环境
|
||||
redis:
|
||||
host: your_redis_host
|
||||
port: 6379
|
||||
password: "your_redis_password"
|
||||
db: 0
|
||||
|
||||
# JWT配置 - 生产环境
|
||||
jwt:
|
||||
secret: "your-production-jwt-secret-key-must-be-complex"
|
||||
expire: 7200
|
||||
|
||||
# 日志配置 - 生产环境
|
||||
log:
|
||||
level: info
|
||||
filename: logs/app.log
|
||||
maxSize: 100
|
||||
maxAge: 30
|
||||
maxBackups: 10
|
||||
enableConsole: true
|
||||
enableFile: true
|
||||
format: json
|
||||
enableCaller: false
|
||||
enableOperation: true
|
||||
enablePerf: true
|
||||
perfThreshold: 1000
|
||||
|
||||
# 微信小程序配置 - 生产环境
|
||||
wechat:
|
||||
appId: "wx1234567890abcdef" # 替换为您的真实AppID
|
||||
appSecret: "your_real_app_secret" # 替换为您的真实AppSecret
|
||||
|
||||
# 微信支付配置 - 生产环境
|
||||
wechatPay:
|
||||
appId: "wx1234567890abcdef" # 您的真实微信小程序AppID
|
||||
mchId: "1600000000" # 您的真实微信支付商户号
|
||||
apiKey: "your_real_32_character_api_v3_key_here" # 您的真实APIv3密钥(32位)
|
||||
certPath: "certs/apiclient_cert.pem" # 商户证书路径
|
||||
keyPath: "certs/apiclient_key.pem" # 商户私钥路径
|
||||
notifyUrl: "https://yourdomain.com/api/v1/payment/notify" # 您的真实支付回调URL(必须HTTPS)
|
||||
|
||||
# 重要提醒:
|
||||
# 1. 所有以 "your_" 开头的值都需要替换为真实值
|
||||
# 2. 证书文件需要从微信支付商户平台下载
|
||||
# 3. 回调URL必须是可公网访问的HTTPS地址
|
||||
# 4. 商户号需要通过微信支付商户资质审核获得
|
||||
80
server/configs/config.prod.yaml
Normal file
80
server/configs/config.prod.yaml
Normal file
@@ -0,0 +1,80 @@
|
||||
# 生产环境配置
|
||||
server:
|
||||
port: 8060
|
||||
mode: release # debug, release, test
|
||||
|
||||
# 数据库配置 - 生产环境
|
||||
database:
|
||||
driver: mysql
|
||||
host: 8.149.233.36
|
||||
port: 3306
|
||||
username: ai_dianshang
|
||||
password: "7aK_H2yvokVumr84lLNDt8fDBp6P"
|
||||
dbname: ai_dianshang
|
||||
charset: utf8mb4
|
||||
parseTime: true
|
||||
loc: Local
|
||||
autoMigrate: false # 生产环境禁用自动迁移
|
||||
logLevel: silent # 生产环境关闭GORM SQL日志
|
||||
|
||||
# Redis配置 - 生产环境
|
||||
redis:
|
||||
host: localhost
|
||||
port: 6379
|
||||
password: ""
|
||||
db: 0
|
||||
|
||||
# JWT配置 - 生产环境
|
||||
jwt:
|
||||
secret: "your-production-jwt-secret-key"
|
||||
expire: 7200
|
||||
|
||||
# 日志配置 - 生产环境
|
||||
log:
|
||||
level: info # debug, info, warn, error
|
||||
filename: logs/app.prod.log
|
||||
maxSize: 200 # MB
|
||||
maxAge: 30 # 天
|
||||
maxBackups: 10 # 保留文件数
|
||||
enableConsole: true # 生产环境不输出到控制台
|
||||
enableFile: true
|
||||
format: json
|
||||
enableCaller: true # 生产环境关闭调用者信息
|
||||
enableOperation: true
|
||||
enablePerf: true
|
||||
perfThreshold: 2000 # 生产环境更宽松的性能阈值
|
||||
|
||||
# 微信小程序配置 - 生产环境
|
||||
wechat:
|
||||
appId: "wxccc7018b3bfff234"
|
||||
appSecret: "fa5802a24e7dca8a3cf91ad1e2f288e8"
|
||||
|
||||
# 微信支付配置 - 开发环境
|
||||
wechatPay:
|
||||
environment: "production" # sandbox(沙箱) 或 production(生产)
|
||||
appId: "wxccc7018b3bfff234" # 您的真实微信小程序AppID
|
||||
mchId: "1726717114" # 您的真实微信支付商户号
|
||||
apiV3Key: "M2nB4vCxZ7qW8eKrDtA1jHlP5gF3sN9y" # 您的真实APIv3密钥(32位)
|
||||
certPath: "certs/apiclient_cert.pem" # 商户证书路径
|
||||
keyPath: "certs/apiclient_key.pem" # 商户私钥路径
|
||||
serialNo: "26DA8C2BC03B796222DA3FCFC6825B236A8C7538" # 证书序列号
|
||||
notifyUrl: "https://tral.cc/api/v1/payment/notify" # 支付回调地址
|
||||
refundNotifyUrl: "https://tral.cc/api/refunds/callback" # 退款回调地址
|
||||
|
||||
# 文件上传配置 - 生产环境
|
||||
upload:
|
||||
maxImageSize: 5242880 # 5MB (5 * 1024 * 1024)
|
||||
maxFileSize: 10485760 # 10MB (10 * 1024 * 1024)
|
||||
imageTypes: [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg"]
|
||||
staticPath: "./static"
|
||||
baseUrl: "http://localhost:8080"
|
||||
storageType: "oss" # local(本地存储) 或 oss(阿里云OSS)
|
||||
|
||||
# 阿里云OSS配置(当storageType为oss时生效)
|
||||
oss:
|
||||
endpoint: "oss-cn-beijing.aliyuncs.com" # OSS访问域名,根据你的地域修改
|
||||
accessKeyId: "LTAI5tNesdhDH4ErqEUZmEg2" # 你的AccessKey ID
|
||||
accessKeySecret: "xZn7WUkTW76TqOLTh01zZATnU6p3Tf" # 你的AccessKey Secret
|
||||
bucketName: "bxmkb-beijing" # 你的Bucket名称
|
||||
basePath: "dianshang/" # 文件存储基础路径
|
||||
domain: "" # 自定义域名(可选,如果有CDN加速域名)
|
||||
68
server/configs/config.test.yaml
Normal file
68
server/configs/config.test.yaml
Normal file
@@ -0,0 +1,68 @@
|
||||
# 测试环境配置
|
||||
server:
|
||||
port: 8080
|
||||
mode: test # debug, release, test
|
||||
|
||||
# 数据库配置 - 测试环境
|
||||
database:
|
||||
driver: mysql
|
||||
host: 127.0.0.1
|
||||
port: 3306
|
||||
username: root
|
||||
password: "test_password_123"
|
||||
dbname: ai_dianshang_test
|
||||
charset: utf8mb4
|
||||
parseTime: true
|
||||
loc: Local
|
||||
|
||||
# Redis配置 - 测试环境
|
||||
redis:
|
||||
host: localhost
|
||||
port: 6379
|
||||
password: ""
|
||||
db: 1 # 使用不同的数据库
|
||||
|
||||
# JWT配置 - 测试环境
|
||||
jwt:
|
||||
secret: "test-jwt-secret-key-for-testing-only"
|
||||
expire: 3600 # 1小时,测试环境较短
|
||||
|
||||
# 日志配置 - 测试环境
|
||||
log:
|
||||
level: info # debug, info, warn, error
|
||||
filename: logs/app.test.log
|
||||
maxSize: 50 # MB
|
||||
maxAge: 3 # 天
|
||||
maxBackups: 2 # 保留文件数
|
||||
enableConsole: true
|
||||
enableFile: true
|
||||
format: json
|
||||
enableCaller: true
|
||||
enableOperation: true
|
||||
enablePerf: true
|
||||
perfThreshold: 1000
|
||||
|
||||
# 微信小程序配置 - 测试环境
|
||||
wechat:
|
||||
appId: "wxccc7018b3bfff234"
|
||||
appSecret: "fa5802a24e7dca8a3cf91ad1e2f288e8"
|
||||
|
||||
# 微信支付配置 - 测试环境
|
||||
wechatPay:
|
||||
environment: "sandbox" # sandbox(沙箱) 或 production(生产)
|
||||
appId: "wxccc7018b3bfff234" # 测试环境微信小程序AppID
|
||||
mchId: "test_mch_id" # 测试商户号
|
||||
apiV3Key: "test_api_v3_key_for_testing_only" # 测试APIv3密钥
|
||||
certPath: "certs/test_apiclient_cert.pem" # 测试商户证书路径
|
||||
keyPath: "certs/test_apiclient_key.pem" # 测试商户私钥路径
|
||||
serialNo: "TEST_SERIAL_NO" # 测试证书序列号
|
||||
notifyUrl: "http://localhost:8080/api/v1/payment/notify" # 支付回调地址
|
||||
refundNotifyUrl: "http://localhost:8080/api/refunds/callback" # 退款回调地址
|
||||
|
||||
# 文件上传配置 - 测试环境
|
||||
upload:
|
||||
maxImageSize: 5242880 # 5MB
|
||||
maxFileSize: 10485760 # 10MB
|
||||
imageTypes: [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg"]
|
||||
staticPath: "./static"
|
||||
baseUrl: "http://localhost:8080"
|
||||
78
server/configs/config.yaml
Normal file
78
server/configs/config.yaml
Normal file
@@ -0,0 +1,78 @@
|
||||
# 开发环境配置
|
||||
server:
|
||||
port: 8080
|
||||
mode: debug # debug, release, test
|
||||
|
||||
# 数据库配置 - 开发环境
|
||||
database:
|
||||
driver: mysql
|
||||
host: 127.0.0.1
|
||||
port: 3306
|
||||
username: root
|
||||
password: "JKjk20011115"
|
||||
dbname: ai_dianshang
|
||||
charset: utf8mb4
|
||||
parseTime: true
|
||||
loc: Local
|
||||
|
||||
# Redis配置 - 开发环境
|
||||
redis:
|
||||
host: localhost
|
||||
port: 6379
|
||||
password: ""
|
||||
db: 0
|
||||
|
||||
# JWT配置 - 开发环境
|
||||
jwt:
|
||||
secret: "dev-jwt-secret-key-not-for-production"
|
||||
expire: 7200 # 2小时,单位:秒
|
||||
|
||||
# 日志配置 - 开发环境
|
||||
log:
|
||||
level: debug # debug, info, warn, error
|
||||
filename: logs/app.dev.log
|
||||
maxSize: 100 # MB
|
||||
maxAge: 7 # 天 (开发环境保留时间短)
|
||||
maxBackups: 3 # 保留文件数
|
||||
enableConsole: true
|
||||
enableFile: true
|
||||
format: text # 开发环境使用text格式便于阅读
|
||||
enableCaller: true
|
||||
enableOperation: true
|
||||
enablePerf: true
|
||||
perfThreshold: 500 # 开发环境更严格的性能阈值
|
||||
|
||||
# 微信小程序配置 - 开发环境
|
||||
wechat:
|
||||
appId: "wxccc7018b3bfff234"
|
||||
appSecret: "fa5802a24e7dca8a3cf91ad1e2f288e8"
|
||||
|
||||
# 微信支付配置 - 生产环境
|
||||
wechatPay:
|
||||
environment: "production" # sandbox(沙箱) 或 production(生产)
|
||||
appId: "wxccc7018b3bfff234" # 您的真实微信小程序AppID
|
||||
mchId: "1726717114" # 您的真实微信支付商户号
|
||||
apiV3Key: "M2nB4vCxZ7qW8eKrDtA1jHlP5gF3sN9y" # 您的真实APIv3密钥(32位)
|
||||
certPath: "certs/apiclient_cert.pem" # 商户证书路径
|
||||
keyPath: "certs/apiclient_key.pem" # 商户私钥路径
|
||||
serialNo: "26DA8C2BC03B796222DA3FCFC6825B236A8C7538" # 证书序列号
|
||||
notifyUrl: "http://localhost:8080/api/v1/payment/notify" # 支付回调地址
|
||||
refundNotifyUrl: "http://localhost:8080/api/refunds/callback" # 退款回调地址
|
||||
|
||||
# 文件上传配置 - 开发环境
|
||||
upload:
|
||||
maxImageSize: 5242880 # 5MB (5 * 1024 * 1024)
|
||||
maxFileSize: 10485760 # 10MB (10 * 1024 * 1024)
|
||||
imageTypes: [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg"]
|
||||
staticPath: "./static"
|
||||
baseUrl: "http://localhost:8080"
|
||||
storageType: "local" # local(本地存储) 或 oss(阿里云OSS)
|
||||
|
||||
# 阿里云OSS配置(当storageType为oss时生效)
|
||||
oss:
|
||||
endpoint: "oss-cn-shanghai.aliyuncs.com" # OSS访问域名,根据你的地域修改
|
||||
accessKeyId: "LTAI5tNesdhDH4ErqEUZmEg2" # 你的AccessKey ID
|
||||
accessKeySecret: "xZn7WUkTW76TqOLTh01zZATnU6p3Tf" # 你的AccessKey Secret
|
||||
bucketName: "oss-pai-apou8llecyqfa7c9du-cn-shanghai" # 你的Bucket名称
|
||||
basePath: "dianshang/" # 文件存储基础路径
|
||||
domain: "" # 自定义域名(可选,如果有CDN加速域名)
|
||||
Reference in New Issue
Block a user