chenyang
11 months ago
11 changed files with 274 additions and 33 deletions
-
1app/api/category/category.go
-
45app/api/category/v1/category.go
-
7app/controller/category/category_v1_batch_delete.go
-
7app/controller/category/category_v1_create.go
-
7app/controller/category/category_v1_delete.go
-
7app/controller/category/category_v1_get_list.go
-
14app/controller/category/category_v1_get_tree.go
-
7app/controller/category/category_v1_update.go
-
170app/logic/category/category.go
-
32app/model/category.go
-
10app/service/category.go
@ -0,0 +1,14 @@ |
|||||
|
package category |
||||
|
|
||||
|
import ( |
||||
|
"context" |
||||
|
"xgit.pub/module/cms/app/service" |
||||
|
|
||||
|
"xgit.pub/module/cms/app/api/category/v1" |
||||
|
) |
||||
|
|
||||
|
func (c *ControllerV1) GetTree(ctx context.Context, req *v1.GetTreeReq) (res *v1.GetTreeRes, err error) { |
||||
|
res = &v1.GetTreeRes{} |
||||
|
res.Data, err = service.Category().GetTree(ctx, req) |
||||
|
return |
||||
|
} |
@ -0,0 +1,32 @@ |
|||||
|
package model |
||||
|
|
||||
|
type Category struct { |
||||
|
CategoryExtend |
||||
|
Id int `json:"id" description:""` |
||||
|
ParentId int `json:"parent_id" description:"父节点"` |
||||
|
Name string `json:"name" description:"分类名字"` |
||||
|
Union string `json:"union" description:"关联"` |
||||
|
Sort int `json:"sort" description:"排序"` |
||||
|
Status int `json:"status" description:"状态"` |
||||
|
SeoTitle string `json:"seo_title" description:""` |
||||
|
SeoKey string `json:"seo_key" description:""` |
||||
|
SeoDes string `json:"seo_des" description:""` |
||||
|
TplIndex string `json:"tpl_index" description:"Index"` |
||||
|
TplList string `json:"tpl_list" description:"GetList"` |
||||
|
TplDetail string `json:"tpl_detail" description:"Detail"` |
||||
|
TplDown string `json:"tpl_down" description:"Down"` |
||||
|
TplPlay string `json:"tpl_play" description:"player"` |
||||
|
Extend string `json:"-" description:"extend"` |
||||
|
Children []*Category `json:"children"` |
||||
|
} |
||||
|
|
||||
|
type CategoryExtend struct { |
||||
|
Class string `json:"class" description:"扩展分类 逗号,分隔"` |
||||
|
Area string `json:"area" description:"扩展地区 逗号,分隔"` |
||||
|
Lang string `json:"lang" description:"扩展语言 逗号,分隔"` |
||||
|
Year string `json:"year" description:"扩展年份 逗号,分隔"` |
||||
|
Star string `json:"star" description:"扩展演员 逗号,分隔"` |
||||
|
Director string `json:"director" description:"扩展导演 逗号,分隔"` |
||||
|
State string `json:"state" description:"扩展资源 逗号,分隔"` |
||||
|
Version string `json:"version" description:"扩展版本 逗号,分隔"` |
||||
|
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue