repository

package
v0.0.0-...-e90a31b Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2023 License: MIT Imports: 11 Imported by: 0

README

Repository

数据访问层: 包含数据库、cache、RPC、HTTP请求等

Documentation

Index

Constants

This section is empty.

Variables

ProviderSet is repo providers.

Functions

This section is empty.

Types

type UserFollowerRepo

type UserFollowerRepo interface {
	CreateUserFollower(ctx context.Context, db *gorm.DB, data *model.UserFollowerModel) (id int64, err error)
	UpdateUserFollowerStatus(ctx context.Context, db *gorm.DB, userID, followerUID int64, status int) error
	GetUserFollower(ctx context.Context, userID, followedUID int64) (ret *model.UserFollowerModel, err error)
	// 获取粉丝用户列表
	GetFollowerUserList(ctx context.Context, userID, lastID int64, limit int) ([]*model.UserFollowerModel, error)
}

UserFollowerRepo define a repo interface

func NewUserFollower

func NewUserFollower(db *gorm.DB, cache cache.UserFollowerCache) UserFollowerRepo

NewUserFollower new a repository and return

type UserFollowingRepo

type UserFollowingRepo interface {
	CreateUserFollowing(ctx context.Context, db *gorm.DB, data *model.UserFollowingModel) (id int64, err error)
	UpdateUserFollowingStatus(ctx context.Context, db *gorm.DB, userID, followedUID int64, status int) error
	GetUserFollowing(ctx context.Context, userID, followedUID int64) (ret *model.UserFollowingModel, err error)
	GetUserFollowingWithoutCache(ctx context.Context, userID, followedUID int64) (ret *model.UserFollowingModel, err error)
	GetFollowingUserList(ctx context.Context, userID, lastID int64, limit int) ([]*model.UserFollowingModel, error)
	BatchGetUserFollowing(ctx context.Context, userID int64, ids []int64) (ret []*model.UserFollowingModel, err error)
}

UserFollowingRepo define a repo interface

func NewUserFollowing

func NewUserFollowing(db *gorm.DB, cache cache.UserFollowingCache) UserFollowingRepo

NewUserFollowing new a repository and return

Jump to

Keyboard shortcuts

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