user

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: May 30, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FollowRepo added in v1.0.5

type FollowRepo interface {
	CreateUserFollow(db *gorm.DB, userID, followedUID uint64) error
	CreateUserFans(db *gorm.DB, userID, followerUID uint64) error
	UpdateUserFollowStatus(db *gorm.DB, userID, followedUID uint64, status int) error
	UpdateUserFansStatus(db *gorm.DB, userID, followerUID uint64, status int) error
	GetFollowingUserList(userID, lastID uint64, limit int) ([]*model.UserFollowModel, error)
	GetFollowerUserList(userID, lastID uint64, limit int) ([]*model.UserFansModel, error)
	GetFollowByUIds(userID uint64, followingUID []uint64) (map[uint64]*model.UserFollowModel, error)
	GetFansByUIds(userID uint64, followerUID []uint64) (map[uint64]*model.UserFansModel, error)
}

FollowRepo 定义用户仓库接口

func NewUserFollowRepo added in v1.0.5

func NewUserFollowRepo() FollowRepo

NewUserFollowRepo 实例化用户仓库

type Repo

type Repo interface {
	Create(db *gorm.DB, user model.UserModel) (id uint64, err error)
	Update(db *gorm.DB, id uint64, userMap map[string]interface{}) error
	GetUserByID(db *gorm.DB, id uint64) (*model.UserModel, error)
	GetUserByPhone(db *gorm.DB, phone int) (*model.UserModel, error)
	GetUserByEmail(db *gorm.DB, email string) (*model.UserModel, error)
	GetUsersByIds(ids []uint64) ([]*model.UserModel, error)
	IncrFollowCount(db *gorm.DB, userID uint64, step int) error
	IncrFollowerCount(db *gorm.DB, userID uint64, step int) error
	GetUserStatByID(db *gorm.DB, userID uint64) (*model.UserStatModel, error)
	GetUserStatByIDs(db *gorm.DB, userID []uint64) (map[uint64]*model.UserStatModel, error)
}

Repo 定义用户仓库接口

func NewUserRepo

func NewUserRepo() Repo

NewUserRepo 实例化用户仓库

Jump to

Keyboard shortcuts

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