diff --git a/app/md/md_article.go b/app/md/md_article.go index a77a6ac..fcac0ce 100644 --- a/app/md/md_article.go +++ b/app/md/md_article.go @@ -34,6 +34,7 @@ type ArticleListReq struct { type ArticleListResp struct { Total int64 `json:"total"` SelectData []map[string]interface{} `json:"select_data"` + CateData []map[string]interface{} `json:"cate_data"` List []ArticleList `json:"list"` } type ArticleList struct { diff --git a/app/svc/article/svc_list.go b/app/svc/article/svc_list.go index eaffad5..e2e87cf 100644 --- a/app/svc/article/svc_list.go +++ b/app/svc/article/svc_list.go @@ -40,10 +40,22 @@ func List(c *gin.Context) { } list = append(list, tmp1) } + tmp["list"] = list } resp.SelectData = append(resp.SelectData, tmp) } } + resp.CateData = make([]map[string]interface{}, 0) + cate, _, _ := NewArticleCateDb.FindArticleCateAndTotalPid("1", "100") + if cate != nil { + for _, v := range *cate { + list := make([]map[string]string, 0) + tmp := map[string]interface{}{ + "name": v.Name, "value": utils.IntToStr(v.Id), "list": list, + } + resp.CateData = append(resp.CateData, tmp) + } + } if notice != nil { for _, v := range *notice { tmp := md.ArticleList{