Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type AccountInterface ¶
type AccountInterface interface {
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
Delete(ctx context.Context, userIDs []string) error
}
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"`
}
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)
Delete(ctx context.Context, userIDs []string) error
}
type Credential ¶ added in v1.8.3
type Credential struct {
UserID string `bson:"user_id"`
Account string `bson:"account"`
Type int `bson:"type"` // 1:phone;2:email
AllowChange bool `bson:"allow_change"`
}
func (Credential) TableName ¶ added in v1.8.3
func (Credential) TableName() string
type CredentialInterface ¶ added in v1.8.3
type CredentialInterface interface {
Create(ctx context.Context, credential ...*Credential) error
CreateOrUpdateAccount(ctx context.Context, credential *Credential) error
Update(ctx context.Context, userID string, data map[string]any) error
Find(ctx context.Context, userID string) ([]*Credential, error)
FindAccount(ctx context.Context, accounts []string) ([]*Credential, error)
Search(ctx context.Context, keyword string, pagination pagination.Pagination) (int64, []*Credential, error)
TakeAccount(ctx context.Context, account string) (*Credential, error)
Take(ctx context.Context, userID string) (*Credential, error)
SearchNormalUser(ctx context.Context, keyword string, forbiddenID []string, pagination pagination.Pagination) (int64, []*Credential, error)
SearchUser(ctx context.Context, keyword string, userIDs []string, pagination pagination.Pagination) (int64, []*Credential, error)
Delete(ctx context.Context, userIDs []string) error
DeleteByUserIDType(ctx context.Context, credentials ...*Credential) error
}
type 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.