分类管理

This commit is contained in:
范俊成 2023-10-19 14:12:23 +08:00
parent a1a62b3ab7
commit 5c0b6e2e16
4 changed files with 7 additions and 4 deletions

View File

@ -81,7 +81,7 @@ func GetCategoryById(id uint32) (*Category, error) {
type CategoryModel struct {
Category
SubCategory []*CategoryModel
SubCategory []*CategoryModel `json:"sub_category" gorm:"-"` //子分类
}
func ScopeOnlyDisplay(db *gorm.DB) *gorm.DB {

View File

@ -3120,7 +3120,8 @@ const docTemplate = `{
"description": "父分类的编号",
"type": "integer"
},
"subCategory": {
"sub_category": {
"description": "子分类",
"type": "array",
"items": {
"$ref": "#/definitions/models.CategoryModel"

View File

@ -3112,7 +3112,8 @@
"description": "父分类的编号",
"type": "integer"
},
"subCategory": {
"sub_category": {
"description": "子分类",
"type": "array",
"items": {
"$ref": "#/definitions/models.CategoryModel"

View File

@ -237,7 +237,8 @@ definitions:
pid:
description: 父分类的编号
type: integer
subCategory:
sub_category:
description: 子分类
items:
$ref: '#/definitions/models.CategoryModel'
type: array