Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct {
UserID string `gorm:"column:user_id;primary_key;type:char(64)"`
Password string `gorm:"column:password;type:varchar(32)"`
CreateTime time.Time `gorm:"column:create_time;autoCreateTime"`
ChangeTime time.Time `gorm:"column:change_time;autoUpdateTime"`
OperatorUserID string `gorm:"column:operator_user_id;type:varchar(64)"`
}
Account 账号密码表.
type AccountInterface ¶
type AccountInterface interface {
NewTx(tx any) AccountInterface
Create(ctx context.Context, accounts ...*Account) error
Take(ctx context.Context, userId string) (*Account, error)
Update(ctx context.Context, userID string, data map[string]any) error
UpdatePassword(ctx context.Context, userId string, password string) error
}
type Attribute ¶
type Attribute struct {
UserID string `gorm:"column:user_id;primary_key;type:char(64)"`
Account string `gorm:"column:account;type:char(64)"`
PhoneNumber string `gorm:"column:phone_number;type:varchar(32)"`
AreaCode string `gorm:"column:area_code;type:varchar(8)"`
Email string `gorm:"column:email;type:varchar(64)" `
Nickname string `gorm:"column:nickname;type:varchar(64)" `
FaceURL string `gorm:"column:face_url;type:varchar(255)" `
Gender int32 `gorm:"column:gender"`
CreateTime time.Time `gorm:"column:create_time"`
ChangeTime time.Time `gorm:"column:change_time"`
BirthTime time.Time `gorm:"column:birth_time"`
Level int32 `gorm:"column:level;default:1"`
AllowVibration int32 `gorm:"column:allow_vibration;default:1"`
AllowBeep int32 `gorm:"column:allow_beep;default:1"`
AllowAddFriend int32 `gorm:"column:allow_add_friend;default:1"`
GlobalRecvMsgOpt int32 `gorm:"column:global_recv_msg_opt;default:0"`
}
Attribute 用户属性表.
type AttributeInterface ¶
type AttributeInterface interface {
NewTx(tx any) AttributeInterface
Create(ctx context.Context, attribute ...*Attribute) error
Update(ctx context.Context, userID string, data map[string]any) error
Find(ctx context.Context, userIds []string) ([]*Attribute, error)
FindAccount(ctx context.Context, accounts []string) ([]*Attribute, error)
Search(ctx context.Context, keyword string, genders []int32, page int32, size int32) (uint32, []*Attribute, error)
TakePhone(ctx context.Context, areaCode string, phoneNumber string) (*Attribute, error)
TakeAccount(ctx context.Context, account string) (*Attribute, error)
Take(ctx context.Context, userID string) (*Attribute, error)
SearchNormalUser(ctx context.Context, keyword string, forbiddenID []string, genders []int32, page int32, size int32) (uint32, []*Attribute, error)
}
type Register ¶
type Register struct {
UserID string `gorm:"column:user_id;primary_key;type:char(64)"`
DeviceID string `gorm:"column:device_id;type:varchar(255)"`
IP string `gorm:"column:ip;type:varchar(64)"`
Platform string `gorm:"column:platform;type:varchar(32)"`
AccountType string `gorm:"column:account_type;type:varchar(32)"` // email phone account
Mode string `gorm:"column:mode;type:varchar(32)"` // user admin
CreateTime time.Time `gorm:"column:create_time"`
}
Register 注册信息表.
type RegisterInterface ¶
type UserLoginRecord ¶
type UserLoginRecord struct {
UserID string `gorm:"column:user_id;size:64"`
LoginTime time.Time `gorm:"column:login_time"`
IP string `gorm:"column:ip;type:varchar(32)"`
DeviceID string `gorm:"column:device_id;type:varchar(255)"`
Platform string `gorm:"column:platform;type:varchar(32)"`
}
用户登录信息表.
func (UserLoginRecord) TableName ¶
func (UserLoginRecord) TableName() string
type UserLoginRecordInterface ¶
type UserLoginRecordInterface interface {
NewTx(tx any) UserLoginRecordInterface
Create(ctx context.Context, records ...*UserLoginRecord) error
}
type VerifyCode ¶
type VerifyCode struct {
ID uint `gorm:"column:id;primary_key;autoIncrement"`
Account string `gorm:"column:account;type:char(64)"`
Platform string `gorm:"column:platform;type:varchar(32)"`
Code string `gorm:"column:verify_code;type:varchar(16)"`
Duration uint `gorm:"column:duration;type:int(11)"`
Count int `gorm:"column:count;type:int(11)"`
Used bool `gorm:"column:used"`
CreateTime time.Time `gorm:"column:create_time;autoCreateTime"`
}
func (VerifyCode) TableName ¶
func (VerifyCode) TableName() string
type VerifyCodeInterface ¶
type VerifyCodeInterface interface {
NewTx(tx any) VerifyCodeInterface
Add(ctx context.Context, ms []*VerifyCode) error
RangeNum(ctx context.Context, account string, start time.Time, end time.Time) (uint32, error)
TakeLast(ctx context.Context, account string) (*VerifyCode, error)
Incr(ctx context.Context, id uint) error
Delete(ctx context.Context, id uint) error
}
Click to show internal directories.
Click to hide internal directories.