db

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB
View Source
var RecordNotFound = gorm.ErrRecordNotFound

Functions

func FollowAction

func FollowAction(ctx context.Context, follow *Follow) error

关注

func FollowCount

func FollowCount(ctx context.Context, uid int64) (int64, error)

func FollowListAction

func FollowListAction(ctx context.Context, uid int64) (*[]int64, error)

关注列表(获取to_user_id的列表)

func FollowerCount

func FollowerCount(ctx context.Context, uid int64) (int64, error)

func FollowerListAction

func FollowerListAction(ctx context.Context, uid int64) (*[]int64, error)

粉丝列表(获取user_id的列表)

func FriendListAction

func FriendListAction(ctx context.Context, uid int64) (*[]int64, error)

好友列表(先获取to_user_id的列表)

func Init

func Init()

func IsFollow

func IsFollow(ctx context.Context, uid, tid int64) (bool, error)

func UnFollowAction

func UnFollowAction(ctx context.Context, follow *Follow) error

取消关注

Types

type Follow

type Follow struct {
	Id        int64
	UserID    int64
	ToUserID  int64
	Status    int64 // 1-关注, 2-取消关注
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt `gorm:"index"`
}

Jump to

Keyboard shortcuts

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