dao

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

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

func NewUser

func NewUser() *User

func (*User) Add

func (u *User) Add(data *UserAddData) error

func (*User) CountList

func (u *User) CountList(params *UserQuery) (int64, error)

func (*User) DeleteByID

func (u *User) DeleteByID(id int64) error

func (*User) FindByID

func (u *User) FindByID(id int64) (*models.User, error)

GetUserByID 根据ID获取用户信息

func (*User) FindByName

func (u *User) FindByName(username string) (*models.User, error)

func (*User) FindForUniqueCheck

func (u *User) FindForUniqueCheck(name string, id ...int64) (*models.User, error)

func (*User) FindList

func (u *User) FindList(params *UserQuery) ([]*models.User, error)

func (*User) UpdateByID

func (u *User) UpdateByID(id int64, data yiigo.X) error

type UserAddData

type UserAddData struct {
	Name      string `db:"name"`
	EMail     string `db:"email"`
	Role      int    `db:"role"`
	Password  string `db:"password"`
	Salt      string `db:"salt"`
	CreatedAt int64  `db:"created_at"`
	UpdatedAt int64  `db:"updated_at"`
}

type UserQuery

type UserQuery struct {
	Name  string
	Role  int
	Page  int
	Limit int
}

Jump to

Keyboard shortcuts

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