Documentation ¶
Overview ¶
Package taxonomy 处理分类相关的问题,菜单也是放在这里解决的 这里一定要注意,termID 不是用于界面上传递的主Key而是TermTaxonomyID 代码质量还行
Index ¶
- func APIGETCategory(c *gin.Context)
- func APIGETCategoryByTermTaxonomyID(c *gin.Context)
- func APIGETTaxonomy(c *gin.Context)
- func APIPOSTTaxonomy(c *gin.Context)
- func APIPUTTaxonomy(c *gin.Context)
- func GETCategory(req *GETCategoryReq) (*[]model.Category, error)
- func GETCategoryByTermTaxonomyID(req *GETCategoryByTermTaxonomyIDReq) (*model.Category, error)
- func GetTaxonomy(taxonomy string, parent uint64) (*[]model.Taxonomy, error)
- func GetTaxonomyIDs(taxonomy string) ([]uint64, error)
- func GetTaxonomyMeta(termTaxonomyID uint64) (*map[string]model.DBTaxonomyMeta, error)
- func POSTTaxonomy(name string, taxonomy string, description string, parent uint64, order int) error
- func POSTTermTaxonomy(tx *sqlx.Tx, termID uint64, taxonomy string, description string, parent uint64, ...) (sql.Result, error)
- func POSTTerms(tx *sqlx.Tx, name string, slug string, termGroup int) (sql.Result, error)
- func PUTTaxonomy(req *PUTTaxonomyReq) (sql.Result, error)
- func PostTermRelationships(tx *sql.Tx, objectID uint64, termTaxonomyID uint64) (sql.Result, error)
- func Register()
- type APIGetTaxonomyForm
- type APIPOSTTaxonomyForm
- type GETCategoryByTermTaxonomyIDReq
- type GETCategoryReq
- type PUTTaxonomyReq
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func APIGETCategoryByTermTaxonomyID ¶
APIGETCategoryByTermTaxonomyID @since 0.0.17
func APIGETTaxonomy ¶
APIGETTaxonomy 根据类型查询所有分类 @since 0.0.12 @since 0.0.17 换标准方法名称
func GETCategory ¶
func GETCategory(req *GETCategoryReq) (*[]model.Category, error)
func GETCategoryByTermTaxonomyID ¶
func GETCategoryByTermTaxonomyID(req *GETCategoryByTermTaxonomyIDReq) (*model.Category, error)
func GetTaxonomyMeta ¶ added in v0.0.25
func GetTaxonomyMeta(termTaxonomyID uint64) (*map[string]model.DBTaxonomyMeta, error)
func POSTTaxonomy ¶
func POSTTermTaxonomy ¶
func POSTTerms ¶
func PUTTaxonomy ¶
func PUTTaxonomy(req *PUTTaxonomyReq) (sql.Result, error)
func PostTermRelationships ¶ added in v0.0.22
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 GETCategoryByTermTaxonomyIDReq ¶
type GETCategoryByTermTaxonomyIDReq struct {
TermTaxonomyID uint64 `form:"term_taxonomy_id" json:"term_taxonomy_id" binding:"required"`
}
type PUTTaxonomyReq ¶
type PUTTaxonomyReq struct { APIPOSTTaxonomyForm TermTaxonomyID uint64 `json:"term_taxonomy_id" binding:"required"` // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.