dao

package
v0.0.0-...-55e1567 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoSuchUser = 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) *User

NewUser create a user dao.

func (*User) BatchGetUserById

func (u *User) BatchGetUserById(uids []int64) ([]*model.User, error)

BatchGetUserById get users by userid.

func (*User) CreateUser

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

CreateUser creates a user.

func (*User) DeleteUserById

func (u *User) DeleteUserById(userId int64) error

DeleteUserById delete a user by id.

func (*User) GetUserById

func (u *User) GetUserById(uid int64) (*model.User, error)

GetUserById get user by userid.

func (*User) GetUserByUsername

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

GetUserByUsername get user by username

Jump to

Keyboard shortcuts

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