- first edition of auth2
This commit is contained in:
43
business/model/user.go
Normal file
43
business/model/user.go
Normal file
@@ -0,0 +1,43 @@
|
||||
package model
|
||||
|
||||
type User struct {
|
||||
ModelIDCULD
|
||||
UserID string `orm:"size(48);column(user_id)" json:"userID"` // 内部唯一标识
|
||||
UserID2 string `orm:"size(48);column(user_id2)" json:"userID2"` // 外部唯一标识(一般用于登录)
|
||||
Name string `orm:"size(48)" json:"name"` // 外部唯一显示 标识(一般用于显示)
|
||||
Mobile string `orm:"size(32)" json:"mobile"`
|
||||
Email string `orm:"size(32)" json:"email"`
|
||||
Status int8 `json:"status"`
|
||||
IDCardNo string `orm:"size(18);column(id_card_no)" json:"idCardNo"` // 身份证号
|
||||
}
|
||||
|
||||
func (*User) TableUnique() [][]string {
|
||||
return [][]string{
|
||||
[]string{"UserID", "DeletedAt"},
|
||||
[]string{"UserID2", "DeletedAt"},
|
||||
[]string{"Name", "DeletedAt"},
|
||||
[]string{"Mobile", "DeletedAt"},
|
||||
[]string{"Email", "DeletedAt"},
|
||||
[]string{"IDCardNo", "DeletedAt"},
|
||||
}
|
||||
}
|
||||
|
||||
func (user *User) GetID() string {
|
||||
return user.UserID
|
||||
}
|
||||
|
||||
func (user *User) GetID2() string {
|
||||
return user.UserID2
|
||||
}
|
||||
|
||||
func (user *User) GetMobile() string {
|
||||
return user.Mobile
|
||||
}
|
||||
|
||||
func (user *User) GetEmail() string {
|
||||
return user.Email
|
||||
}
|
||||
|
||||
func (user *User) GetName() string {
|
||||
return user.Name
|
||||
}
|
||||
Reference in New Issue
Block a user