articleCategoryRs

package
v0.2.78 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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    `gorm:"column:article_id;not null;index:idx_article_id;index:idx_article_category_effective,priority:3" json:"articleId"`    //
	ArticleCategoryId uint64    `gorm:"column:article_category_id;not null;index;index:idx_article_category_effective,priority:2;" json:"articleCategoryId"` //
	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 GetByArticleId

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

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

func GetOneByCategoryId

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