userStatistics

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CancelFollower

func CancelFollower(userId uint64) int64

取消粉丝数量

func CancelFollowing

func CancelFollowing(userId uint64) int64

取消关注

func CancelGivenLike

func CancelGivenLike(userId uint64) int64

func CancelLikeArticle

func CancelLikeArticle(userId uint64) int64

func Follower

func Follower(userId uint64) int64

增加粉丝数

func Following

func Following(userId uint64) int64

增加关注

func GivenLike

func GivenLike(userId uint64) int64

func LikeArticle

func LikeArticle(userId uint64) int64

func SaveOrCreateById

func SaveOrCreateById(entity *Entity) int64

func WriteArticle

func WriteArticle(userId uint64) int64

func WriteComment

func WriteComment(userId uint64) int64

Types

type Entity

type Entity struct {
	UserId            uint64     `gorm:"primaryKey;column:user_id;autoIncrement;not null;" json:"userId"`                           // 用户ID
	ArticleCount      uint       `gorm:"column:article_count;type:int unsigned;not null;default:0;" json:"articleCount"`            // 发表文章数
	ReplyCount        uint       `gorm:"column:reply_count;type:int unsigned;not null;default:0;" json:"replyCount"`                // 评论数
	FollowerCount     uint       `gorm:"column:follower_count;type:int unsigned;not null;default:0;" json:"followerCount"`          // 粉丝数
	FollowingCount    uint       `gorm:"column:following_count;type:int unsigned;not null;default:0;" json:"followingCount"`        // 关注数
	LikeReceivedCount uint       `gorm:"column:like_received_count;type:int unsigned;not null;default:0;" json:"likeReceivedCount"` // 收到的点赞数
	LikeGivenCount    uint       `gorm:"column:like_given_count;type:int unsigned;not null;default:0;" json:"likeGivenCount"`       // 给出的点赞数
	CollectionCount   uint       `gorm:"column:collection_count;type:int unsigned;not null;default:0;" json:"collectionCount"`      // 收藏数
	LastActiveTime    *time.Time `gorm:"column:last_active_time;type:datetime;" json:"lastActiveTime"`                              // 最后活跃时间
	CreatedAt         time.Time  `gorm:"column:created_at;index;autoCreateTime;<-:create;" json:"createdAt"`                        //
	UpdatedAt         time.Time  `gorm:"column:updated_at;autoUpdateTime;" json:"updatedAt"`
}

func Get

func Get(id any) (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