user

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = gorm.ErrRecordNotFound
)

Functions

This section is empty.

Types

type BaseRepo added in v1.1.2

type BaseRepo interface {
	CreateUser(ctx context.Context, user model.UserBaseModel) (id uint64, err error)
	UpdateUser(ctx context.Context, id uint64, userMap map[string]interface{}) error
	GetOneUser(ctx context.Context, id uint64) (*model.UserBaseModel, error)
	GetUsersByIds(ctx context.Context, ids []uint64) ([]*model.UserBaseModel, error)
	GetUserByPhone(ctx context.Context, phone int64) (*model.UserBaseModel, error)
	GetUserByEmail(ctx context.Context, email string) (*model.UserBaseModel, error)
	Close()
}

BaseRepo 定义用户仓库接口

func NewUserRepo

func NewUserRepo(db *gorm.DB, tracer opentracing.Tracer) BaseRepo

NewUserRepo 实例化用户仓库

type FollowRepo

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

FollowRepo 定义用户仓库接口

func NewUserFollowRepo

func NewUserFollowRepo(db *gorm.DB) FollowRepo

NewUserFollowRepo 实例化用户仓库

type StatRepo added in v1.1.2

type StatRepo interface {
	IncrFollowCount(ctx context.Context, db *gorm.DB, userID uint64, step int) error
	IncrFollowerCount(ctx context.Context, db *gorm.DB, userID uint64, step int) error
	GetUserStatByID(ctx context.Context, userID uint64) (*model.UserStatModel, error)
	GetUserStatByIDs(ctx context.Context, userID []uint64) (map[uint64]*model.UserStatModel, error)
	Close()
}

StatRepo 定义用户仓库接口

func NewUserStatRepo added in v1.1.2

func NewUserStatRepo(db *gorm.DB, tracer opentracing.Tracer) StatRepo

NewUserStatRepo 实例化用户仓库

Jump to

Keyboard shortcuts

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