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

29 lines
494 B
Go

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)
}