2023-08-28 14:51:31 +08:00

54 lines
1.3 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 dtos
type NetIface struct {
Ifaces []string `json:"ifaces"`
}
type EdgeBaseConfig struct {
}
type EdgeGwConfig struct {
GwId string `json:"gwId"`
SecKey string `json:"secKey"`
LocalKey string `json:"localKey"`
Status bool `json:"status"`
}
type EdgeConfig struct {
//BaseConfig EdgeBaseConfig `yaml:"baseconfig"`
//GwConfig EdgeGwConfig `yaml:"gwconfig"`
//SubDeviceLimit int64 `yaml:"subdevicelimit"`
//ExpiryTime int64 `yaml:"expiry"`
//ActiveTime int64 `yaml:"activeTime"`
//LastExitTime int64 `yaml:"lastExitTime"`
//IsExpired bool `yaml:"isExpired"`
GwId string `yaml:"gwid"`
SecKey string `yaml:"seckey"`
Status bool `yaml:"status"`
ActiveTime string `yaml:"activetime"`
VersionNumber string `yaml:"versionnumber"`
SubDeviceLimit int64 `yaml:"subdevicelimit"`
}
func (c EdgeConfig) GetGatewayNumber() string {
switch c.VersionNumber {
case "ireland":
return "Ireland爱尔兰"
case "seattle":
return "Seattle西雅图"
case "kamakura镰仓":
return "Kamakura"
default:
return c.VersionNumber
}
}
func (c EdgeConfig) IsActivated() bool {
return c.Status
}
func (c EdgeConfig) CheckThingModelActiveGw() bool {
return c.GwId != "" && c.SecKey != ""
}