初始化
This commit is contained in:
@@ -1,75 +0,0 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
xlog "bj_power_mes/common/logx"
|
||||
"bj_power_mes/internal/db"
|
||||
"bj_power_mes/internal/plc"
|
||||
|
||||
"bjhardman.cn/bjhardman/mom"
|
||||
"github.com/zeromicro/go-zero/core/stores/redis"
|
||||
"github.com/zeromicro/go-zero/rest"
|
||||
)
|
||||
|
||||
// MomConfig 扩展 MOM SDK 配置,增加启用开关 + 业务配置
|
||||
type MomConfig struct {
|
||||
Enable bool `json:",default=false"`
|
||||
mom.MomConf
|
||||
// InstoreType 入库类型 1:立库 2:平库
|
||||
InstoreType int `json:",default=1"`
|
||||
// EquipUploadHour 设备数据每日上传整点(0-23),上传前一日数据
|
||||
EquipUploadHour int `json:",default=10"`
|
||||
// EquipUploadDevices 上传范围 device_type 列表,留空则上传所有 OKUMA 设备
|
||||
EquipUploadDeviceTypes []string `json:",optional"`
|
||||
// StationDockMap MOM站台码 ↔ 内部接驳台号 映射表
|
||||
// key=MOM stationCode(string),value=内部 dockNo(int)
|
||||
// stationCode 格式: 9 + 两位产线编号 + 三位流水号 (如 901001 = 产线01, 1号接驳台)
|
||||
StationDockMap map[string]int `json:",optional"`
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
rest.RestConf
|
||||
Logger xlog.LogConf
|
||||
Auth struct {
|
||||
AccessSecret string
|
||||
AccessExpire int
|
||||
RefreshExpire int
|
||||
}
|
||||
|
||||
Upload struct {
|
||||
Dir string `json:",default=./uploads"`
|
||||
RetentionDays int `json:",default=30"`
|
||||
}
|
||||
|
||||
Redis redis.RedisConf
|
||||
|
||||
Database db.DatabaseConf
|
||||
|
||||
Plc plc.PlcConf `json:"PLC"`
|
||||
|
||||
Mock struct {
|
||||
Enable bool `json:",default=false"`
|
||||
MockRun bool `json:",default=false"`
|
||||
}
|
||||
|
||||
// WMS 服务(库存系统 C)
|
||||
Wms struct {
|
||||
BaseURL string `json:",default=http://127.0.0.1:8890"`
|
||||
Token string `json:",default=Hardman_2026"` // X-API-TOKEN 写死内部 token
|
||||
}
|
||||
|
||||
// 海康 RCS-2000 AGV 调度
|
||||
AgvRcs struct {
|
||||
Sim bool `json:",default=true"` // 模拟模式:不真正调 RCS,直接成功
|
||||
BaseURL string `json:",optional"` // 如 http://192.168.1.210:8099
|
||||
AppKey string `json:",optional"`
|
||||
AppSecret string `json:",optional"`
|
||||
Version string `json:",default=v1.0"` // 接口版本号,签名必填项之一
|
||||
}
|
||||
|
||||
// 项目间内部 API(工位终端 D 等调用)写死 token
|
||||
Internal struct {
|
||||
Token string `json:",default=Hardman_2026"`
|
||||
}
|
||||
|
||||
Mom MomConfig `json:"MOM"`
|
||||
}
|
||||
Reference in New Issue
Block a user