Merge remote-tracking branch 'origin/main' into lichang
This commit is contained in:
@@ -150,6 +150,16 @@ type DbConfig struct {
|
||||
Backup string `yaml:"backup"`
|
||||
}
|
||||
|
||||
//type codingType int
|
||||
|
||||
const (
|
||||
// Short message data coding type
|
||||
CODING_UCS2 int = iota
|
||||
CODING_ASCII
|
||||
CODING_LATIN1
|
||||
CODING_NODEF
|
||||
)
|
||||
|
||||
type AlarmConfig struct {
|
||||
SplitEventAlarm bool `yaml:"splitEventAlarm"`
|
||||
//ForwardAlarm bool `yaml:"forwardAlarm"`
|
||||
@@ -164,12 +174,14 @@ type AlarmConfig struct {
|
||||
TLSSkipVerify bool `yaml:"tlsSkipVerify" json:"tlsSkipVerify"`
|
||||
} `yaml:"alarmEmailForward"`
|
||||
SMSCForward struct {
|
||||
Enable bool `yaml:"enable" json:"enable"`
|
||||
MobileList string `yaml:"mobileList" json:"mobileList"`
|
||||
SMSCAddr string `yaml:"smscAddr" json:"smscAddr"`
|
||||
SystemID string `yaml:"systemID" json:"systemID"`
|
||||
Password string `yaml:"password" json:"password"`
|
||||
SystemType string `yaml:"systemType" json:"systemType"`
|
||||
Enable bool `yaml:"enable" json:"enable"`
|
||||
MobileList string `yaml:"mobileList" json:"mobileList"`
|
||||
SMSCAddr string `yaml:"smscAddr" json:"smscAddr"`
|
||||
SystemID string `yaml:"systemID" json:"systemID"`
|
||||
Password string `yaml:"password" json:"password"`
|
||||
SystemType string `yaml:"systemType" json:"systemType"`
|
||||
DataCoding int `yaml:"dataCoding" json:"dataCoding"`
|
||||
ServiceNumber string `yaml:"serviceNumber" json:"serviceNumber"`
|
||||
} `yaml:"alarmSMSForward"`
|
||||
SMS struct {
|
||||
ApiURL string `yaml:"apiURL"`
|
||||
@@ -304,7 +316,19 @@ func WriteOrignalConfig(configFile string, paramName string, paramData map[strin
|
||||
for j := i + 1; j < len(lines); j++ {
|
||||
if strings.Contains(lines[j], k+":") {
|
||||
index := strings.Index(lines[j], k)
|
||||
lines[j] = lines[j][:index] + fmt.Sprintf("%s: %v", k, v)
|
||||
// Determine the type of v
|
||||
switch v := v.(type) {
|
||||
case string:
|
||||
lines[j] = lines[j][:index] + fmt.Sprintf("%s: \"%s\"", k, v)
|
||||
// case int:
|
||||
// lines[j] = lines[j][:index] + fmt.Sprintf("%s: %d", k, v)
|
||||
// case float64:
|
||||
// lines[j] = lines[j][:index] + fmt.Sprintf("%s: %f", k, v)
|
||||
case bool:
|
||||
lines[j] = lines[j][:index] + fmt.Sprintf("%s: %t", k, v)
|
||||
default:
|
||||
lines[j] = lines[j][:index] + fmt.Sprintf("%s: %v", k, v)
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,13 +132,14 @@ omc:
|
||||
# TLS Skip verify: true/false
|
||||
# email/sms
|
||||
# smProxy: sms(Short Message Service)/smsc(SMS Centre)
|
||||
# dataCoding: 0:UCS2, 1:ASCII, 2:LATIN1
|
||||
alarm:
|
||||
alarmEmailForward:
|
||||
enable: true
|
||||
emailList:
|
||||
smtp: mail.agrandtech.com
|
||||
smtp: mail.smtp.com
|
||||
port: 25
|
||||
user: smtpext@agrandtech.com
|
||||
user: smtpext@smtp.com
|
||||
password: "1000smtp@omc!"
|
||||
tlsSkipVerify: true
|
||||
alarmSMSForward:
|
||||
@@ -148,6 +149,8 @@ alarm:
|
||||
systemID: "omc"
|
||||
password: "omc123"
|
||||
systemType: "UTRAN"
|
||||
dataCoding: 0
|
||||
serviceNumber: "OMC"
|
||||
sms:
|
||||
apiURL: http://smsc.xxx.com/
|
||||
accessKeyID: xxxx
|
||||
|
||||
Reference in New Issue
Block a user