Files
bj_power/bj_power_mes/internal/config/config.go
T

56 lines
1.5 KiB
Go
Raw 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.
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 stationCodestring),value=内部 dockNoint
// 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"`
}
Mom MomConfig `json:"MOM"`
}