Documentation
¶
Index ¶
- func CancelFollower(userId uint64) int64
- func CancelFollowing(userId uint64) int64
- func CancelGivenLike(userId uint64) int64
- func CancelLikeArticle(userId uint64) int64
- func Follower(userId uint64) int64
- func Following(userId uint64) int64
- func GivenLike(userId uint64) int64
- func LikeArticle(userId uint64) int64
- func SaveOrCreateById(entity *Entity) int64
- func UpdateUserActivity(userId uint64, lastActiveTime time.Time) int64
- func WriteArticle(userId uint64) int64
- func WriteComment(userId uint64) int64
- type Entity
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CancelGivenLike ¶
func CancelLikeArticle ¶
func SaveOrCreateById ¶
func UpdateUserActivity ¶ added in v0.0.7
更新活跃时间
func WriteArticle ¶
func WriteComment ¶
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"`
}
Click to show internal directories.
Click to hide internal directories.