topicUserStat

package
v0.2.62 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecrementUserPost

func DecrementUserPost(topicId, userId uint64) error

func IncrementUserPost

func IncrementUserPost(topicId, userId uint64) error

func IncrementUserPostWithDB added in v0.2.61

func IncrementUserPostWithDB(db *gorm.DB, topicId, userId uint64) error

func SaveOrCreateById

func SaveOrCreateById(entity *Entity) int64

func SyncTopicPosters

func SyncTopicPosters(topicId uint64) []uint64

func SyncTopicPostersWithDB added in v0.2.61

func SyncTopicPostersWithDB(db *gorm.DB, topicId uint64) ([]uint64, error)

Types

type Entity

type Entity struct {
	Id          uint64    `gorm:"primaryKey;column:id;autoIncrement;not null;" json:"id"`
	TopicId     uint64    `` /* 144-byte string literal not displayed */
	UserId      uint64    `gorm:"column:user_id;type:bigint unsigned;not null;uniqueIndex:idx_topic_user,priority:2" json:"userId"`
	ReplyCount  uint32    `gorm:"column:reply_count;type:int unsigned;not null;default:0;index:idx_active_topic_user,priority:2" json:"replyCount"`
	LastReplyAt time.Time `` /* 134-byte string literal not displayed */
	CreatedAt   time.Time `gorm:"column:created_at;autoCreateTime;<-:create;" json:"createdAt"`
	UpdatedAt   time.Time `gorm:"column:updated_at;autoUpdateTime;" json:"updatedAt"`
}

func Get

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