topicUserAction

package
v0.2.51 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListActiveWatchUserIDsAfter

func ListActiveWatchUserIDsAfter(topicId, afterUserId uint64, excludeUserIds []uint64, limit int) []uint64

func SaveOrCreateById

func SaveOrCreateById(entity *Entity) int64

func SetBookmarked

func SetBookmarked(userId, topicId uint64, bookmarked bool) bool

func SetBookmarkedAt

func SetBookmarkedAt(userId, topicId uint64, bookmarkedAt *time.Time) bool

func SetLiked

func SetLiked(userId, topicId uint64, liked bool) bool

func SetLikedAt

func SetLikedAt(userId, topicId uint64, likedAt *time.Time) bool

func SetWatched

func SetWatched(userId, topicId uint64, watched bool) bool

func SetWatchedAt

func SetWatchedAt(userId, topicId uint64, watchedAt *time.Time) bool

Types

type Entity

type Entity struct {
	Id           uint64     `gorm:"primaryKey;column:id;autoIncrement;not null;index:idx_tua_user_id,priority:2" json:"id"`
	UserId       uint64     `` /* 267-byte string literal not displayed */
	TopicId      uint64     `` /* 161-byte string literal not displayed */
	LikedAt      *time.Time `gorm:"column:liked_at" json:"likedAt"`
	BookmarkedAt *time.Time `gorm:"column:bookmarked_at;index:idx_tua_user_bookmark,priority:2" json:"bookmarkedAt"`
	WatchedAt    *time.Time `gorm:"column:watched_at;index:idx_tua_user_watch,priority:2;index:idx_tua_watch_notify,priority:3" json:"watchedAt"`
	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 GetByTopicId

func GetByTopicId(userId, topicId any) (entity Entity)

func (*Entity) TableName

func (itself *Entity) TableName() string

type LikedTopicRef

type LikedTopicRef struct {
	ID      uint64    `gorm:"column:id"`
	TopicID uint64    `gorm:"column:topic_id"`
	LikedAt time.Time `gorm:"column:liked_at"`
}

func ListLikedTopicRefsBefore

func ListLikedTopicRefsBefore(userId uint64, cursor string, limit int) ([]LikedTopicRef, string)

Jump to

Keyboard shortcuts

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