实现长效套餐创建逻辑,并整合不同套餐类型的创建流程
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package edge
|
||||
|
||||
import "strings"
|
||||
|
||||
type ISP int32
|
||||
|
||||
const (
|
||||
@@ -9,6 +11,18 @@ const (
|
||||
IspChinaMobile // 中国移动
|
||||
)
|
||||
|
||||
func ISPFromStr(str string) ISP {
|
||||
switch {
|
||||
case strings.Contains(str, "电信"):
|
||||
return IspChinaTelecom
|
||||
case strings.Contains(str, "联通"):
|
||||
return IspChinaUnicom
|
||||
case strings.Contains(str, "移动"):
|
||||
return IspChinaMobile
|
||||
}
|
||||
return IspUnknown
|
||||
}
|
||||
|
||||
type Type int32
|
||||
|
||||
const (
|
||||
|
||||
Reference in New Issue
Block a user