plugin/dctw/v1/api/direct/vo.go

29 lines
494 B
Go
Raw Normal View History

2024-11-14 18:33:56 +08:00
package direct
import (
"gitea.cdlsxd.cn/sdk/plugin/utils"
)
type AccountType int
const (
AccountTypeDefault AccountType = iota
AccountTypePhone
AccountTypeQQ
)
func (o AccountType) AccountType(account string) AccountType {
if account == "" {
return AccountTypeDefault
} else if utils.IsPhoneNumber(account) {
return AccountTypePhone
} else if utils.IsValidQQ(account) {
return AccountTypeQQ
}
return AccountTypeDefault
}
func (o AccountType) Value() int {
return int(o)
}