Przeglądaj źródła

买方研选默认展示研选分类下的数据,报告榜单,榜单列表接口

xingzai 2 lat temu
rodzic
commit
9186edd070

+ 35 - 0
controllers/report_billboard.go

@@ -0,0 +1,35 @@
+package controllers
+
+import (
+	"hongze/hongze_cygx/models"
+)
+
+//报告榜单
+type ReportBillboardController struct {
+	BaseAuthController
+}
+
+// @Title 报告榜单table栏
+// @Description 报告榜单table栏
+// @Success 200 {object} cygx.UserRemarksListResp
+// @router /table/list [get]
+func (this *ReportBillboardController) CompanyTableList() {
+	br := new(models.BaseResponse).Init()
+	defer func() {
+		this.Data["json"] = br
+		this.ServeJSON()
+	}()
+	user := this.User
+	if user == nil {
+		br.Msg = "请重新登录"
+		br.Ret = 408
+		return
+	}
+	List := []*models.ReportBillboardTableResp{{Name: "产业关注", Source: 1}, {Name: "阅读飙升", Source: 2}, {Name: "报告收藏", Source: 3}}
+	resp := new(models.ReportBillboardTableListResp)
+	resp.List = List
+	br.Ret = 200
+	br.Success = true
+	br.Msg = "获取成功"
+	br.Data = resp
+}

+ 20 - 21
controllers/research.go

@@ -29,11 +29,11 @@ func (this *ResearchController) NewList() {
 		br.Ret = 408
 		return
 	}
-	chartPermissionId, _ := this.GetInt("ChartPermissionId")
-	if chartPermissionId < 1 {
-		br.Msg = "请输入分类ID"
-		return
-	}
+	//chartPermissionId, _ := this.GetInt("ChartPermissionId")
+	//if chartPermissionId < 1 {
+	//	br.Msg = "请输入分类ID"
+	//	return
+	//}
 	list, err := models.GetIndustrialManagementNewList()
 	if err != nil {
 		br.Msg = "获取信息失败"
@@ -82,11 +82,11 @@ func (this *ResearchController) CollectionList() {
 		br.Ret = 408
 		return
 	}
-	chartPermissionId, _ := this.GetInt("ChartPermissionId")
-	if chartPermissionId < 1 {
-		br.Msg = "请输入分类ID"
-		return
-	}
+	//chartPermissionId, _ := this.GetInt("ChartPermissionId")
+	//if chartPermissionId < 1 {
+	//	br.Msg = "请输入分类ID"
+	//	return
+	//}
 	var condition string
 	condition = `   AND a.article_type_id > 0  AND publish_status = 1 GROUP BY a.article_id ORDER BY collect_num_order DESC, publish_date DESC LIMIT 15 `
 	list, err := models.GetArticleCollectionList(condition, user.UserId)
@@ -128,12 +128,12 @@ func (this *ResearchController) HotList() {
 		br.Ret = 408
 		return
 	}
-	chartPermissionId, _ := this.GetInt("ChartPermissionId")
+	//chartPermissionId, _ := this.GetInt("ChartPermissionId")
+	//if chartPermissionId < 1 {
+	//	br.Msg = "请输入分类ID"
+	//	return
+	//}
 	themeType, _ := this.GetInt("ThemeType")
-	if chartPermissionId < 1 {
-		br.Msg = "请输入分类ID"
-		return
-	}
 	pageSize, _ := this.GetInt("PageSize")
 	currentIndex, _ := this.GetInt("CurrentIndex")
 	var startSize int
@@ -235,11 +235,11 @@ func (this *ResearchController) KolList() {
 		br.Ret = 408
 		return
 	}
-	chartPermissionId, _ := this.GetInt("ChartPermissionId")
-	if chartPermissionId < 1 {
-		br.Msg = "请输入分类ID"
-		return
-	}
+	//chartPermissionId, _ := this.GetInt("ChartPermissionId")
+	//if chartPermissionId < 1 {
+	//	br.Msg = "请输入分类ID"
+	//	return
+	//}
 
 	list, err := models.GetDepartmentList(user.UserId)
 	if err != nil {
@@ -374,7 +374,6 @@ func (this *ResearchController) ThemeDetail() {
 		for _, v := range itemsNull {
 			resp.List = append(resp.List, v)
 		}
-
 	}
 	br.Ret = 200
 	br.Success = true

+ 11 - 0
models/report.go

@@ -689,3 +689,14 @@ func GetSearchResourceList(condition string) (items []*IndustrialManagementHotRe
 	_, err = o.Raw(sql).QueryRows(&items)
 	return
 }
+
+//切换列表
+type ReportBillboardTableResp struct {
+	Name   string `description:"名称"`
+	Source int    `description:"类型"`
+}
+
+//切换列表
+type ReportBillboardTableListResp struct {
+	List []*ReportBillboardTableResp
+}

+ 9 - 0
routers/commentsRouter_controllers.go

@@ -484,6 +484,15 @@ func init() {
             Filters: nil,
             Params: nil})
 
+    beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:ReportBillboardController"] = append(beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:ReportBillboardController"],
+        beego.ControllerComments{
+            Method: "CompanyTableList",
+            Router: "/table/list",
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
     beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:ReportController"] = append(beego.GlobalControllerRouter["hongze/hongze_cygx/controllers:ReportController"],
         beego.ControllerComments{
             Method: "Fllow",

+ 5 - 0
routers/router.go

@@ -109,6 +109,11 @@ func init() {
 				&controllers.ChartController{},
 			),
 		),
+		web.NSNamespace("/report_billboard",
+			web.NSInclude(
+				&controllers.ReportBillboardController{},
+			),
+		),
 	)
 	web.AddNamespace(ns)
 }