dao

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const UserCollection = "c_user"

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	ID         int64    `bson:"id"`
	Username   string   `bson:"username"`
	Password   string   `bson:"password"`
	Email      string   `bson:"email"`
	Title      string   `bson:"title"`
	SourceType int64    `bson:"source_type"`
	CreateType int64    `bson:"create_type"`
	Status     uint8    `bson:"status"`
	Ctime      int64    `bson:"ctime"`
	Utime      int64    `bson:"utime"`
	RoleCodes  []string `bson:"role_codes"`
}

type UserDAO

type UserDAO interface {
	CreatUser(ctx context.Context, user User) (int64, error)
	FindByUsername(ctx context.Context, username string) (User, error)
	FindById(ctx context.Context, id int64) (User, error)
	ListUser(ctx context.Context, offset, limit int64) ([]User, error)
	AddOrUpdateRoleBind(ctx context.Context, id int64, roleCodes []string) (int64, error)
	Count(ctx context.Context) (int64, error)
}

func NewUserDao

func NewUserDao(db *mongox.Mongo) UserDAO

Jump to

Keyboard shortcuts

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