27 lines
636 B
Go
27 lines
636 B
Go
package noauthprobe
|
|
|
|
import (
|
|
"git.loafle.net/overflow/commons-go/core/util"
|
|
)
|
|
|
|
type AuthStateType int
|
|
|
|
const (
|
|
AuthStateTypeNotRegisterd AuthStateType = iota
|
|
AuthStateTypeRegisterd
|
|
)
|
|
|
|
type Auth struct {
|
|
TempKey *string `json:"tempKey,omitempty" yaml:"tempKey" toml:"tempKey"`
|
|
|
|
AcceptedDate *util.Timestamp `json:"acceptedDate,omitempty" yaml:"acceptedDate" toml:"acceptedDate"`
|
|
DeniedDate *util.Timestamp `json:"deniedDate,omitempty" yaml:"deniedDate" toml:"deniedDate"`
|
|
}
|
|
|
|
func (a *Auth) State() AuthStateType {
|
|
if nil != a.TempKey && "" != *a.TempKey {
|
|
return AuthStateTypeRegisterd
|
|
}
|
|
return AuthStateTypeNotRegisterd
|
|
}
|