articleCategoryRs

package
v0.2.13 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BatchCreate

func BatchCreate(entities []*Entity) int64

BatchCreate 批量创建分类关系

func DeleteByArticleId

func DeleteByArticleId(articleId uint64) int64

DeleteByArticleId 删除文章的所有分类关系

func SaveOrCreateById

func SaveOrCreateById(entity *Entity) int64

Types

type Entity

type Entity struct {
	Id        uint64 `gorm:"primaryKey;column:id;autoIncrement;not null;" json:"id"` //
	ArticleId uint64 ``                                                              //
	/* 140-byte string literal not displayed */
	ArticleCategoryId uint64 `` //
	/* 143-byte string literal not displayed */
	Effective int       `gorm:"column:effective;type:int;not null;default:0;index:idx_article_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 Get

func Get(id any) (entity Entity)

func GetByArticleId

func GetByArticleId(articleId uint64) (entities []*Entity)

GetByArticleId 获取文章的所有分类关系

func GetByArticleIds

func GetByArticleIds(articleIds []uint64) (entities []*Entity)

GetByArticleIds 批量获取文章的分类关系

func GetByArticleIdsEffective

func GetByArticleIdsEffective(articleIds []uint64) (entities []*Entity)

GetByArticleIdsEffective 批量获取文章的分类关系

func GetOneByCategoryId added in v0.0.4

func GetOneByCategoryId(cId uint64) (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