Bladeren bron

文章

master
huangjiajun 2 dagen geleden
bovenliggende
commit
d0942f48d1
2 gewijzigde bestanden met toevoegingen van 13 en 0 verwijderingen
  1. +1
    -0
      app/md/md_article.go
  2. +12
    -0
      app/svc/article/svc_list.go

+ 1
- 0
app/md/md_article.go Bestand weergeven

@@ -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 {


+ 12
- 0
app/svc/article/svc_list.go Bestand weergeven

@@ -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{


Laden…
Annuleren
Opslaan