瀏覽代碼

no message

xingzai 1 年之前
父節點
當前提交
77a8650075
共有 5 個文件被更改,包括 33 次插入9 次删除
  1. 4 5
      controllers/collection.go
  2. 5 4
      models/apply_collection.go
  3. 1 0
      models/db.go
  4. 18 0
      routers/commentsRouter.go
  5. 5 0
      routers/router.go

+ 4 - 5
controllers/collection.go

@@ -33,15 +33,14 @@ func (this *CollectionController) BannerList() {
 
 	resp := new(models.CollectionBannerListResp)
 	var listA []*models.CollectionBannerResp
-	var listB []*models.CollectionBannerResp
+	listB := new(models.CollectionBannerResp)
 	listA = []*models.CollectionBannerResp{
 		&models.CollectionBannerResp{Title: "B1", IndexImg: "https://hzstatic.hzinsights.com/banner/yx/web_1.png", Path: "/index/"},
 		&models.CollectionBannerResp{Title: "B2", IndexImg: "https://hzstatic.hzinsights.com/banner/yx/web_2.png", Path: ""},
 	}
-
-	listB = []*models.CollectionBannerResp{
-		&models.CollectionBannerResp{Title: "B2", IndexImg: "https://hzstatic.hzinsights.com/banner/yx/web_3.png", Path: "/index/"},
-	}
+	listB.Title = "B2"
+	listB.IndexImg = "https://hzstatic.hzinsights.com/banner/yx/web_3.png"
+	listB.IsShowSustainable = true
 	resp.ListA = listA
 	resp.ListB = listB
 	br.Ret = 200

+ 5 - 4
models/apply_collection.go

@@ -6,14 +6,15 @@ import (
 )
 
 type CollectionBannerResp struct {
-	Title    string `description:"标题"`
-	IndexImg string `description:"小程序封面图"`
-	Path     string `description:"小程序路径"`
+	Title             string `description:"标题"`
+	IndexImg          string `description:"小程序封面图"`
+	Path              string `description:"小程序路径"`
+	IsShowSustainable bool   `description:"是否展示限免标签"`
 }
 
 type CollectionBannerListResp struct {
 	ListA []*CollectionBannerResp
-	ListB []*CollectionBannerResp
+	ListB *CollectionBannerResp
 }
 
 type CollectionDetailResp struct {

+ 1 - 0
models/db.go

@@ -77,6 +77,7 @@ func init() {
 		new(CygxTagHistory),
 		new(CygxActivitySpecialMeetingDetail),
 		new(CygxActivityVoiceHistory),
+		new(CygxApplyCollection),
 	)
 	// 记录ORM查询日志
 	orm.Debug = true

+ 18 - 0
routers/commentsRouter.go

@@ -331,6 +331,24 @@ func init() {
             Filters: nil,
             Params: nil})
 
+    beego.GlobalControllerRouter["hongze/hongze_clpt/controllers:CollectionController"] = append(beego.GlobalControllerRouter["hongze/hongze_clpt/controllers:CollectionController"],
+        beego.ControllerComments{
+            Method: "ApplyAdd",
+            Router: `/apply/add`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_clpt/controllers:CollectionController"] = append(beego.GlobalControllerRouter["hongze/hongze_clpt/controllers:CollectionController"],
+        beego.ControllerComments{
+            Method: "BannerList",
+            Router: `/banner/list`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
     beego.GlobalControllerRouter["hongze/hongze_clpt/controllers:ConfigController"] = append(beego.GlobalControllerRouter["hongze/hongze_clpt/controllers:ConfigController"],
         beego.ControllerComments{
             Method: "AboutUs",

+ 5 - 0
routers/router.go

@@ -144,6 +144,11 @@ func init() {
 				&controllers.TagController{},
 			),
 		),
+		web.NSNamespace("/collection",
+			web.NSInclude(
+				&controllers.CollectionController{},
+			),
+		),
 	)
 	web.AddNamespace(ns)
 }