articleUserAction

package
v0.2.56 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 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(articleId, afterUserId uint64, excludeUserIds []uint64, limit int) []uint64

func SetBookmarked

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

func SetBookmarkedAt

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

func SetLiked

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

func SetLikedAt

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

func SetWatched

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

func SetWatchedAt

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

Types

type Entity

type Entity struct {
	Id           uint64     `gorm:"primaryKey;column:id;autoIncrement;not null;index:idx_aus_user_id,priority:2" json:"id"`
	UserId       uint64     `` /* 269-byte string literal not displayed */
	ArticleId    uint64     `` /* 167-byte string literal not displayed */
	LikedAt      *time.Time `gorm:"column:liked_at" json:"likedAt"`
	BookmarkedAt *time.Time `gorm:"column:bookmarked_at;index:idx_aus_user_bookmark,priority:2" json:"bookmarkedAt"`
	WatchedAt    *time.Time `gorm:"column:watched_at;index:idx_aus_user_watch,priority:2;index:idx_aus_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 GetByArticleId

func GetByArticleId(userId, articleId any) (entity Entity)

func (*Entity) TableName

func (itself *Entity) TableName() string

type LikedArticleRef

type LikedArticleRef struct {
	ID        uint64    `gorm:"column:id"`
	ArticleID uint64    `gorm:"column:article_id"`
	LikedAt   time.Time `gorm:"column:liked_at"`
}

func ListLikedArticleRefsBefore

func ListLikedArticleRefsBefore(userId uint64, cursor string, limit int) ([]LikedArticleRef, string)

Jump to

Keyboard shortcuts

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