repository

package
v0.0.0-...-877ca1b Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2022 License: MulanPSL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IUserRepository

type IUserRepository interface {
	// InitTable 初始化数据表
	InitTable() error

	// FindUserByName 根据用户名称查找信息
	FindUserByName(name string) (*model.User, error)

	// FindUserById 根据Id查找用户
	FindUserById(id int64) (*model.User, error)

	// CreateUser 创建用户
	CreateUser(user *model.User) (id int64, err error)

	// DeleteUserById 删除用户
	DeleteUserById(id int64) error

	// UpdateUser 更新用户
	UpdateUser(user *model.User) error

	// FindAll 查找所有用户
	FindAll() ([]*model.User, error)
}

type UserRepository

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

func NewUserRepository

func NewUserRepository(db *gorm.DB) *UserRepository

func (*UserRepository) CreateUser

func (u *UserRepository) CreateUser(user *model.User) (id int64, err error)

func (*UserRepository) DeleteUserById

func (u *UserRepository) DeleteUserById(id int64) error

func (*UserRepository) FindAll

func (u *UserRepository) FindAll() ([]*model.User, error)

func (*UserRepository) FindUserById

func (u *UserRepository) FindUserById(id int64) (*model.User, error)

func (*UserRepository) FindUserByName

func (u *UserRepository) FindUserByName(name string) (*model.User, error)

func (*UserRepository) InitTable

func (u *UserRepository) InitTable() error

func (*UserRepository) UpdateUser

func (u *UserRepository) UpdateUser(user *model.User) error

UpdateUser @Description: 更新用户纪录 @receiver u @param user *model.User @return error

Jump to

Keyboard shortcuts

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