Documentation ¶
Index ¶
- Constants
- Variables
- type Model
- func (m *Model) CreateUser(user *User) error
- func (m *Model) CreateVerifyCode(vc *VerifyCode) error
- func (m *Model) GetUserByEmail(email string) (user *User, err error)
- func (m *Model) GetUserById(id int) (user *User, err error)
- func (m *Model) GetUserByMobile(mobile string) (user *User, err error)
- func (m *Model) VerifyCode(vc *VerifyCode) bool
- type User
- type VerifyCode
Constants ¶
View Source
const ( CodeRegister = iota CodeFindPassword )
Variables ¶
View Source
var (
ErrNotFound = errors.New("not found")
)
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
func (*Model) CreateUser ¶
func (*Model) CreateVerifyCode ¶
func (m *Model) CreateVerifyCode(vc *VerifyCode) error
func (*Model) GetUserByMobile ¶
func (*Model) VerifyCode ¶
func (m *Model) VerifyCode(vc *VerifyCode) bool
type User ¶
type User struct { ID int `json:"id" xorm:"id pk autoincr"` Mobile string `json:"mobile" xorm:"mobile"` Email string `json:"email" xorm:"email"` Avatar string `json:"avatar" xorm:"avatar"` Password string `json:"-" xorm:"password"` AddVerify bool `json:"add_verify" xorm:"add_verify"` CreateAt time.Time `json:"create_at" xorm:"create_at"` DeleteAt time.Time `json:"delete_at" xorm:"delete_at"` }
type VerifyCode ¶
type VerifyCode struct { Id int `json:"id" xorm:"id pk autoincr"` Code string `json:"code" xorm:"code"` Info string `json:"info" xorm:"info"` Type int `json:"type" xorm:"type"` Verified bool `json:"verified" xorm:"verified"` CreateTime time.Time `json:"create_time" xorm:"create_time"` }
func (VerifyCode) Table ¶
func (VerifyCode) Table() string
Click to show internal directories.
Click to hide internal directories.