Files
bj_power/bj_power_mes/internal/config/config.go
T
SunYF cbd55338f1 feat: add run.ps1 script to start projects easily
add a powershell script that supports starting MES, WMS, WMSClient, Workstation and Dashboard projects with one command, includes build and run logic for backend services and npm dev for dashboard
2026-08-28 17:03:03 +08:00

57 lines
1.4 KiB
Go

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
}
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"`
}