articleCollection

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCollectionCount

func GetCollectionCount(userId uint64) int64

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    `gorm:"column:user_id;type:bigint unsigned;not null;" json:"userId"`        // 用户ID
	ArticleId uint64    `gorm:"column:article_id;type:bigint unsigned;not null;" json:"articleId"`  // 文章ID
	Status    int8      `gorm:"column:status;type:tinyint;not null;default:0;" json:"status"`       // 有效收藏 1 无效收藏 0
	CreatedAt time.Time `gorm:"column:created_at;index;autoCreateTime;<-:create;" json:"createdAt"` //
	UpdatedAt time.Time `gorm:"column:updated_at;autoUpdateTime;" json:"updatedAt"`
}

func Get

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