taxonomy

package
v0.0.25 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2019 License: Apache-2.0, Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package taxonomy 处理分类相关的问题,菜单也是放在这里解决的 这里一定要注意,termID 不是用于界面上传递的主Key而是TermTaxonomyID 代码质量还行

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIGETCategory

func APIGETCategory(c *gin.Context)

func APIGETCategoryByTermTaxonomyID

func APIGETCategoryByTermTaxonomyID(c *gin.Context)

APIGETCategoryByTermTaxonomyID @since 0.0.17

func APIGETTaxonomy

func APIGETTaxonomy(c *gin.Context)

APIGETTaxonomy 根据类型查询所有分类 @since 0.0.12 @since 0.0.17 换标准方法名称

func APIPOSTTaxonomy

func APIPOSTTaxonomy(c *gin.Context)

APIPOSTTaxonomy 添加分类 @since 0.0.17

func APIPUTTaxonomy

func APIPUTTaxonomy(c *gin.Context)

func GETCategory

func GETCategory(req *GETCategoryReq) (*[]model.Category, error)

func GETCategoryByTermTaxonomyID

func GETCategoryByTermTaxonomyID(req *GETCategoryByTermTaxonomyIDReq) (*model.Category, error)

func GetTaxonomy

func GetTaxonomy(taxonomy string, parent uint64) (*[]model.Taxonomy, error)

func GetTaxonomyIDs

func GetTaxonomyIDs(taxonomy string) ([]uint64, error)

func GetTaxonomyMeta added in v0.0.25

func GetTaxonomyMeta(termTaxonomyID uint64) (*map[string]model.DBTaxonomyMeta, error)

func POSTTaxonomy

func POSTTaxonomy(name string, taxonomy string, description string, parent uint64, order int) error

func POSTTermTaxonomy

func POSTTermTaxonomy(tx *sqlx.Tx, termID uint64, taxonomy string, description string, parent uint64, count int, order int) (sql.Result, error)

func POSTTerms

func POSTTerms(tx *sqlx.Tx, name string, slug string, termGroup int) (sql.Result, error)

func PUTTaxonomy

func PUTTaxonomy(req *PUTTaxonomyReq) (sql.Result, error)

func PostTermRelationships added in v0.0.22

func PostTermRelationships(tx *sql.Tx, objectID uint64, termTaxonomyID uint64) (sql.Result, error)

PostTermRelationships 创建对象与分类的对应关系 @since 0.0.22

func Register

func Register()

Types

type APIGetTaxonomyForm

type APIGetTaxonomyForm struct {
	Taxonomy string `form:"taxonomy" json:"taxonomy"`
	Parent   uint64 `form:"parent" json:"parent"` // TODO 改成 ParentTermTaxonomyID
}

@since 0.0.22 取消 Taxonomy 的必填设置

type APIPOSTTaxonomyForm

type APIPOSTTaxonomyForm struct {
	Name        string `json:"name" binding:"required"`
	Taxonomy    string `json:"taxonomy" binding:"required"`
	Description string `json:"description"`
	Parent      uint64 `json:"parent"`
	Order       int    `json:"order"`
}

type GETCategoryByTermTaxonomyIDReq

type GETCategoryByTermTaxonomyIDReq struct {
	TermTaxonomyID uint64 `form:"term_taxonomy_id" json:"term_taxonomy_id" binding:"required"`
}

type GETCategoryReq

type GETCategoryReq struct {
	Taxonomy string `form:"taxonomy"`
}

type PUTTaxonomyReq

type PUTTaxonomyReq struct {
	APIPOSTTaxonomyForm
	TermTaxonomyID uint64 `json:"term_taxonomy_id" binding:"required"`
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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