package config import ( "bj_power_mes/common/logx" "bj_power_mes/internal/db" "github.com/zeromicro/go-zero/core/stores/redis" "github.com/zeromicro/go-zero/rest" ) // Config 全局配置 type Config struct { rest.RestConf // 自带 Host/Port 等 Database db.DatabaseConf Redis RedisConfWrapper Auth AuthConf Internal InternalConf Cli CliConf Logger logx.LogConf Wms WmsConf Plc PlcConf Upload UploadConf } type RedisConfWrapper struct { redis.RedisConf } // AuthConf 鉴权配置:JWT Secret / 有效期 type AuthConf struct { AccessSecret string `json:",default=Hardman_2026"` AccessExpire int64 `json:",default=1800"` // access token 短有效(秒) RefreshExpire int64 `json:",default=86400"` // refresh token(秒) } // InternalConf 内部服务间鉴权 type InternalConf struct { Token string `json:",default=Hardman_2026"` } // CliConf 命令行敏感操作门禁密码(与管理员账号密码保持一致,改密时自动同步) type CliConf struct { AdminPassword string `json:"AdminPassword,default=Hardman_2026"` } // WmsConf WMS 内部服务地址 type WmsConf struct { BaseURL string `json:",default="` Token string `json:",default=Hardman_2026"` } // PlcConf PLC 对接配置(mock 时不用) type PlcConf struct { Enable bool `json:",default=false"` Host string `json:",default=127.0.0.1"` Port int `json:",default=102"` } // UploadConf 工艺图纸 PDF / 巡检照片 等文件上传目录 type UploadConf struct { Dir string `json:",default=uploads"` MaxMB int64 `json:",default=20"` }