articleBookmark

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: May 22, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUserBookmarkedArticleIds

func GetUserBookmarkedArticleIds(userId uint64, page, pageSize int) ([]uint64, int64)

GetUserBookmarkedArticleIds 获取用户收藏的文章ID列表

func SaveOrCreateById

func SaveOrCreateById(entity *Entity) int64

Types

type Entity

type Entity struct {
	Id     uint64 `gorm:"primaryKey;column:id;autoIncrement;not null;" json:"id"` // 主键
	UserId uint64 ``                                                              // 用户
	/* 161-byte string literal not displayed */
	ArticleId uint64 `` //
	/* 127-byte string literal not displayed */
	Status    int       `gorm:"column:status;type:int;not null;default:1;index:idx_user_bookmark_list,priority:2" json:"status"` // 收藏状态(1:有效点赞 0:取消点赞)
	CreatedAt time.Time `gorm:"column:created_at;autoCreateTime;<-:create;" json:"createdAt"`                                    //
	UpdatedAt time.Time `gorm:"column:updated_at;autoUpdateTime;index;index:idx_user_bookmark_list,priority:3" json:"updatedAt"`
}

func Get

func Get(id any) (entity Entity)

func GetByArticleId

func GetByArticleId(userId, articleId 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