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 `bson:"user_id"`
Password string `bson:"password"`
CreateTime time.Time `bson:"create_time"`
ChangeTime time.Time `bson:"change_time"`
OperatorUserID string `bson:"operator_user_id"`
}
Account 账号密码表.
type AccountInterface ¶
type Attribute ¶
type Attribute struct {
UserID string `bson:"user_id"`
Account string `bson:"account"`
PhoneNumber string `bson:"phone_number"`
AreaCode string `bson:"area_code"`
Email string `bson:"email"`
Nickname string `bson:"nickname"`
FaceURL string `bson:"face_url"`
Gender int32 `bson:"gender"`
CreateTime time.Time `bson:"create_time"`
ChangeTime time.Time `bson:"change_time"`
BirthTime time.Time `bson:"birth_time"`
Level int32 `bson:"level"`
AllowVibration int32 `bson:"allow_vibration"`
AllowBeep int32 `bson:"allow_beep"`
AllowAddFriend int32 `bson:"allow_add_friend"`
GlobalRecvMsgOpt int32 `bson:"global_recv_msg_opt"`
RegisterType int32 `bson:"register_type"`
}
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, pagination pagination.Pagination) (int64, []*Attribute, error)
TakePhone(ctx context.Context, areaCode string, phoneNumber string) (*Attribute, error)
TakeEmail(ctx context.Context, email 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, gender int32, pagination pagination.Pagination) (int64, []*Attribute, error)
SearchUser(ctx context.Context, keyword string, userIDs []string, genders []int32, pagination pagination.Pagination) (int64, []*Attribute, error)
}
type Register ¶
type Register struct {
UserID string `bson:"user_id"`
DeviceID string `bson:"device_id"`
IP string `bson:"ip"`
Platform string `bson:"platform"`
AccountType string `bson:"account_type"`
Mode string `bson:"mode"`
CreateTime time.Time `bson:"create_time"`
}
Register 注册信息表.
type RegisterInterface ¶
type UserLoginRecord ¶
type UserLoginRecord struct {
UserID string `bson:"user_id"`
LoginTime time.Time `bson:"login_time"`
IP string `bson:"ip"`
DeviceID string `bson:"device_id"`
Platform string `bson:"platform"`
}
用户登录信息表.
func (UserLoginRecord) TableName ¶
func (UserLoginRecord) TableName() string
type VerifyCode ¶
type VerifyCode struct {
ID string `bson:"_id"`
Account string `bson:"account"`
Platform string `bson:"platform"`
Code string `bson:"code"`
Duration uint `bson:"duration"`
Count int `bson:"count"`
Used bool `bson:"used"`
CreateTime time.Time `bson:"create_time"`
}
func (VerifyCode) TableName ¶
func (VerifyCode) TableName() string
type VerifyCodeInterface ¶
type VerifyCodeInterface interface {
Add(ctx context.Context, ms []*VerifyCode) error
RangeNum(ctx context.Context, account string, start time.Time, end time.Time) (int64, error)
TakeLast(ctx context.Context, account string) (*VerifyCode, error)
Incr(ctx context.Context, id string) error
Delete(ctx context.Context, id string) error
}
Click to show internal directories.
Click to hide internal directories.