no message
parent
81d522ac2b
commit
5946bb805d
|
@ -17,6 +17,7 @@ import (
|
||||||
type DocTree struct{
|
type DocTree struct{
|
||||||
ID int64 `json:"id"`
|
ID int64 `json:"id"`
|
||||||
Label string `json:"label"`
|
Label string `json:"label"`
|
||||||
|
Level int `json:"level"`
|
||||||
Children []*DocTree `json:"children"`
|
Children []*DocTree `json:"children"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,6 +45,7 @@ func InitDocCache(){
|
||||||
for _,v := range articles{
|
for _,v := range articles{
|
||||||
tmp := new (DocTree)
|
tmp := new (DocTree)
|
||||||
tmp.ID = v.ID
|
tmp.ID = v.ID
|
||||||
|
tmp.Level = int(v.Level)
|
||||||
tmp.Label = v.Title
|
tmp.Label = v.Title
|
||||||
tmp.Children = make([]*DocTree,0)
|
tmp.Children = make([]*DocTree,0)
|
||||||
gDocMapCache[int(v.ID)] = tmp
|
gDocMapCache[int(v.ID)] = tmp
|
||||||
|
@ -52,6 +54,7 @@ func InitDocCache(){
|
||||||
tmp := new (DocTree)
|
tmp := new (DocTree)
|
||||||
tmp.ID = v.ID
|
tmp.ID = v.ID
|
||||||
tmp.Label = v.Title
|
tmp.Label = v.Title
|
||||||
|
tmp.Level = int(v.Level)
|
||||||
tmp.Children = make([]*DocTree,0)
|
tmp.Children = make([]*DocTree,0)
|
||||||
gDocMapCache[int(v.ID)] = tmp
|
gDocMapCache[int(v.ID)] = tmp
|
||||||
}
|
}
|
||||||
|
@ -487,6 +490,8 @@ func AddArticleTree(c *gin.Context) {
|
||||||
rsp.Msg = "title required"
|
rsp.Msg = "title required"
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
log.Print(req.Level)
|
||||||
|
|
||||||
e := model.CreateDocTree(
|
e := model.CreateDocTree(
|
||||||
model.DocTree{
|
model.DocTree{
|
||||||
Type: int32(req.Type),
|
Type: int32(req.Type),
|
||||||
|
|
Loading…
Reference in New Issue