分类管理
This commit is contained in:
parent
a1a62b3ab7
commit
5c0b6e2e16
|
@ -81,7 +81,7 @@ func GetCategoryById(id uint32) (*Category, error) {
|
||||||
|
|
||||||
type CategoryModel struct {
|
type CategoryModel struct {
|
||||||
Category
|
Category
|
||||||
SubCategory []*CategoryModel
|
SubCategory []*CategoryModel `json:"sub_category" gorm:"-"` //子分类
|
||||||
}
|
}
|
||||||
|
|
||||||
func ScopeOnlyDisplay(db *gorm.DB) *gorm.DB {
|
func ScopeOnlyDisplay(db *gorm.DB) *gorm.DB {
|
||||||
|
|
|
@ -3120,7 +3120,8 @@ const docTemplate = `{
|
||||||
"description": "父分类的编号",
|
"description": "父分类的编号",
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
"subCategory": {
|
"sub_category": {
|
||||||
|
"description": "子分类",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"$ref": "#/definitions/models.CategoryModel"
|
"$ref": "#/definitions/models.CategoryModel"
|
||||||
|
|
|
@ -3112,7 +3112,8 @@
|
||||||
"description": "父分类的编号",
|
"description": "父分类的编号",
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
"subCategory": {
|
"sub_category": {
|
||||||
|
"description": "子分类",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"$ref": "#/definitions/models.CategoryModel"
|
"$ref": "#/definitions/models.CategoryModel"
|
||||||
|
|
|
@ -237,7 +237,8 @@ definitions:
|
||||||
pid:
|
pid:
|
||||||
description: 父分类的编号
|
description: 父分类的编号
|
||||||
type: integer
|
type: integer
|
||||||
subCategory:
|
sub_category:
|
||||||
|
description: 子分类
|
||||||
items:
|
items:
|
||||||
$ref: '#/definitions/models.CategoryModel'
|
$ref: '#/definitions/models.CategoryModel'
|
||||||
type: array
|
type: array
|
||||||
|
|
Loading…
Reference in New Issue
Block a user