From 5946bb805d05d39a45f5dfcf030114ed663e7eba Mon Sep 17 00:00:00 2001 From: zcy <290198252@qq.com> Date: Wed, 20 Apr 2022 13:35:51 +0800 Subject: [PATCH] no message --- controller/blog.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/controller/blog.go b/controller/blog.go index f457d7d..1a5f971 100644 --- a/controller/blog.go +++ b/controller/blog.go @@ -17,6 +17,7 @@ import ( type DocTree struct{ ID int64 `json:"id"` Label string `json:"label"` + Level int `json:"level"` Children []*DocTree `json:"children"` } @@ -44,6 +45,7 @@ func InitDocCache(){ for _,v := range articles{ tmp := new (DocTree) tmp.ID = v.ID + tmp.Level = int(v.Level) tmp.Label = v.Title tmp.Children = make([]*DocTree,0) gDocMapCache[int(v.ID)] = tmp @@ -52,6 +54,7 @@ func InitDocCache(){ tmp := new (DocTree) tmp.ID = v.ID tmp.Label = v.Title + tmp.Level = int(v.Level) tmp.Children = make([]*DocTree,0) gDocMapCache[int(v.ID)] = tmp } @@ -487,6 +490,8 @@ func AddArticleTree(c *gin.Context) { rsp.Msg = "title required" return } + log.Print(req.Level) + e := model.CreateDocTree( model.DocTree{ Type: int32(req.Type),