topicCategoryIndex

package
v0.2.76 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActiveCategoryIDsByTopicWithDB added in v0.2.68

func ActiveCategoryIDsByTopicWithDB(db *gorm.DB, topicID uint64) ([]uint64, error)

func ActiveTopicIDsByCategory added in v0.2.61

func ActiveTopicIDsByCategory(categoryID uint64, maxIDs int) ([]uint64, bool, error)

func ActiveTopicIDsByCategoryWithDB added in v0.2.61

func ActiveTopicIDsByCategoryWithDB(db *gorm.DB, categoryID uint64, maxIDs int) (topicIDs []uint64, complete bool, err error)

func DeleteByTopicId

func DeleteByTopicId(topicId uint64) int64

func DeleteByTopicIdWithDB added in v0.2.68

func DeleteByTopicIdWithDB(db *gorm.DB, topicID uint64) (int64, error)

func MultiCategoryTopicCounts added in v0.2.61

func MultiCategoryTopicCounts(categoryIDs []uint64) (map[uint64]int64, error)

func MultiCategoryTopicCountsWithDB added in v0.2.61

func MultiCategoryTopicCountsWithDB(db *gorm.DB, categoryIDs []uint64) (map[uint64]int64, error)

func ReplaceTopicCategories

func ReplaceTopicCategories(topicId uint64, categoryIDs []uint64) error

func ReplaceTopicCategoriesWithDB added in v0.2.61

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

func SaveOrCreateById

func SaveOrCreateById(entity *Entity) int64

Types

type Entity

type Entity struct {
	Id         uint64    `gorm:"primaryKey;column:id;autoIncrement;not null;" json:"id"`
	TopicId    uint64    `` /* 175-byte string literal not displayed */
	CategoryId uint64    `` /* 169-byte string literal not displayed */
	Effective  int       `gorm:"column:effective;type:int;not null;default:0;index:idx_topic_category_effective,priority:1;" json:"effective"`
	CreatedAt  time.Time `gorm:"column:created_at;autoCreateTime;<-:create;" json:"createdAt"`
	UpdatedAt  time.Time `gorm:"column:updated_at;autoUpdateTime;" json:"updatedAt"`
}

func GetByTopicId

func GetByTopicId(topicId uint64) (entities []*Entity)

func GetOneByCategoryId

func GetOneByCategoryId(categoryId uint64) (entity Entity)

func (*Entity) TableName

func (itself *Entity) TableName() string

type MultiCategoryTopicCount added in v0.2.61

type MultiCategoryTopicCount struct {
	CategoryID uint64 `gorm:"column:category_id"`
	TopicCount int64  `gorm:"column:topic_count"`
}

Jump to

Keyboard shortcuts

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