dao

package
v0.0.0-...-e809d31 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUserNotFound = errors.New("no such user")
	ErrUserExist    = errors.New("user already exist")
)

Functions

This section is empty.

Types

type User

type User struct {
	// contains filtered or unexported fields
}

func NewUser

func NewUser(db *gorm.DB, mdb *mongo.Database, rdb *redis.Client) *User

func (*User) CacheUserInfo

func (u *User) CacheUserInfo(ctx context.Context, userInfo *model.UserM) error

func (*User) ChangeAvatar

func (u *User) ChangeAvatar(ctx context.Context, id int64, avatar string) error

func (*User) ChangeBackground

func (u *User) ChangeBackground(ctx context.Context, id int64, background string) error

func (*User) ClearUserInfoCache

func (u *User) ClearUserInfoCache(ctx context.Context, id int64) error

func (*User) CreateUserInMongo

func (u *User) CreateUserInMongo(ctx context.Context, user *model.UserM) error

func (*User) CreateUserInMysql

func (u *User) CreateUserInMysql(user *model.User) error

func (*User) GetUserByUsername

func (u *User) GetUserByUsername(username string) (user *model.User, err error)

func (*User) GetUserInfo

func (u *User) GetUserInfo(ctx context.Context, id int64) (userInfo *model.UserM, err error)

func (*User) GetVerification

func (u *User) GetVerification(ctx context.Context, email string) (int64, error)

func (*User) SetVerification

func (u *User) SetVerification(ctx context.Context, email string, vCode int32) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL