From e8b6ad0c160a39b024b0f2b996d603bdd9b22db9 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期四, 28 九月 2023 17:44:07 +0800
Subject: [PATCH] 工艺参数列表增加是否可以更新字段
---
conf/config.go | 99 +++++++++++++++++++------------------------------
1 files changed, 39 insertions(+), 60 deletions(-)
diff --git a/conf/config.go b/conf/config.go
index 44b9eab..53f53ea 100644
--- a/conf/config.go
+++ b/conf/config.go
@@ -3,9 +3,7 @@
import (
"apsClient/pkg/convertx"
"apsClient/pkg/logx"
- "apsClient/pkg/mysqlx"
- "apsClient/pkg/redisx"
- "flag"
+ "apsClient/pkg/sqlitex"
"github.com/spf13/viper"
"log"
)
@@ -23,31 +21,13 @@
)
type (
- Captcha struct {
- KeyLong int // 楠岃瘉鐮侀暱搴�
- ImgWidth int // 楠岃瘉鐮佸搴�
- ImgHeight int // 楠岃瘉鐮侀珮搴�
- OpenCaptcha int // 闃茬垎鐮撮獙璇佺爜寮�鍚鏁帮紝0浠h〃姣忔鐧诲綍閮介渶瑕侀獙璇佺爜锛屽叾浠栨暟瀛椾唬琛ㄩ敊璇瘑鐮佹鏁帮紝濡�3浠h〃閿欒涓夋鍚庡嚭鐜伴獙璇佺爜
- OpenCaptchaTimeOut int // 闃茬垎鐮撮獙璇佺爜瓒呮椂鏃堕棿锛屽崟浣嶏細s(绉�)
- }
-
- JWT struct {
- SigningKey string // jwt绛惧悕
- ExpiresTime string // 杩囨湡鏃堕棿
- BufferTime string // 缂撳啿鏃堕棿
- Issuer string // 绛惧彂鑰�
- }
-
System struct {
- Env string // 鐜鍊� develop test public
- Port int // 绔彛
- DbType string // 鏁版嵁搴撶被鍨�
- UseMultipoint bool // 澶氱偣鐧诲綍鎷︽埅
- UseRedis bool // 浣跨敤redis
- LimitCountIP int
- LimitTimeIP int
- RouterPrefix string // 璺敱鍓嶇紑
- SudoPassword string // sudo瀵嗙爜
+ Env string // 鐜鍊� develop test public
+ Port int // 绔彛
+ DeviceId string //璁惧id
+ NetSetShellPath string //缃戠粶璁剧疆鑴氭湰璺緞
+ NetUpShellName string //缃戠粶鍋滅敤鑴氭湰
+ NetDownShellName string //缃戠粶寮�鍚剼鏈�
}
Etcd struct {
@@ -78,6 +58,27 @@
Services struct {
ApsServer string
+ Serial string
+ }
+
+ nsqConf struct {
+ NodeId string
+ NsqdAddr string
+ NsqlookupdAddr string
+ }
+
+ plc struct {
+ FinishNumberTimeInterval int
+ TotalNumberTimeInterval int
+ ModbusIntType string
+ SlaveId int
+ Package string
+ StandbyTime int64
+ }
+
+ Prompt struct {
+ SafeProduce string `json:"safeProduce,omitempty"`
+ PlcNotConnected string `json:"plcNotConnected,omitempty"`
}
config struct {
@@ -88,28 +89,18 @@
Log logx.Conf
// mysql閰嶇疆
- Mysql mysqlx.Conf
-
- // redis閰嶇疆
- Redis redisx.Conf
-
- // 楠岃瘉鐮�
- Captcha Captcha
-
- // JWT閰嶇疆
- JWT JWT
-
- // etcd閰嶇疆
- Etcd Etcd
-
- // rancher閰嶇疆
- Rancher Rancher
-
- // k8s閰嶇疆
- K8s K8s
+ Sqlite sqlitex.Conf
//Services Address
Services Services
+
+ //NsqConf
+ NsqConf nsqConf
+
+ //PLC
+ PLC plc
+
+ Prompt Prompt
}
)
@@ -119,14 +110,6 @@
)
func init() {
- var configFile string
- flag.StringVar(&configFile, "config", "", "config file in json")
- flag.Parse()
-
- if len(configFile) > 0 {
- configName = configFile
- }
-
Viper = viper.New()
Viper.SetConfigName(configName)
for _, path := range configPaths {
@@ -156,11 +139,7 @@
log.Println("......................................................")
log.Printf(" System: %+v", Conf.System)
log.Printf(" Log: %+v", Conf.Log)
- log.Printf(" Mysql: %+v", Conf.Mysql)
- log.Printf(" Captcha: %+v", Conf.Captcha)
- log.Printf(" JWT: %+v", Conf.JWT)
- log.Printf(" etcd: %+v", Conf.Etcd)
- log.Printf(" rancher: %+v", Conf.Rancher)
- log.Printf(" k8s: %+v", Conf.K8s)
+ log.Printf(" plc : %+v", Conf.PLC)
+ log.Printf(" services : %+v", Conf.Services)
log.Println("......................................................")
}
--
Gitblit v1.8.0