userFollow

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: May 20, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllFollowingIds added in v0.1.1

func GetAllFollowingIds(userId uint64) []uint64

GetAllFollowingIds returns all followed user IDs.

func GetFollowerCount added in v0.0.3

func GetFollowerCount(userId uint64) int64

func GetFollowerList added in v0.0.7

func GetFollowerList(userId uint64, page, pageSize int) []*users.EntityComplete

GetFollowerList returns followers for a page.

func GetFollowingCount added in v0.0.3

func GetFollowingCount(userId uint64) int64

func GetFollowingList added in v0.0.7

func GetFollowingList(userId uint64, page, pageSize int) []*users.EntityComplete

GetFollowingList returns followed users for a page.

func IsFollowing added in v0.1.1

func IsFollowing(userId, followUserId uint64) bool

IsFollowing reports whether userId follows followUserId.

func SaveOrCreateById added in v0.0.3

func SaveOrCreateById(entity *Entity) int64

Types

type Entity

type Entity struct {
	Id           uint64 `gorm:"primaryKey;column:id;autoIncrement;not null;" json:"id"`                                             //
	UserId       uint64 `gorm:"column:user_id;type:bigint unsigned;not null;uniqueIndex:uniq_user_follow,priority:1" json:"userId"` // 主体
	FollowUserId uint64 ``                                                                                                          // 被关注者
	/* 136-byte string literal not displayed */
	Status    int       `gorm:"column:status;type:int;not null;default:1;" json:"status"`           // 1 关注 0 取消关注
	CreatedAt time.Time `gorm:"column:created_at;index;autoCreateTime;<-:create;" json:"createdAt"` //
	UpdatedAt time.Time `gorm:"column:updated_at;autoUpdateTime;" json:"updatedAt"`
}

func Get added in v0.0.3

func Get(id any) (entity Entity)

func GetAll added in v0.1.1

func GetAll(offset, limit int) ([]*Entity, error)

GetAll returns paginated follow records for export and repair jobs.

func GetByUserId added in v0.0.3

func GetByUserId(userId, followUserId uint64) (entity Entity)

func (*Entity) TableName

func (itself *Entity) TableName() string

Jump to

Keyboard shortcuts

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