Parcourir la source

Merge branch 'ETA_2.0.5' into debug

zwxi il y a 1 mois
Parent
commit
ab40f883c8
2 fichiers modifiés avec 54 ajouts et 0 suppressions
  1. 45 0
      controllers/hisugar_data.go
  2. 9 0
      routers/commentsRouter.go

+ 45 - 0
controllers/hisugar_data.go

@@ -1037,3 +1037,48 @@ func (this *TradeCommonController) GetHisugarIndexInfo() {
 	br.Msg = "获取成功"
 	br.Data = indexInfoPage
 }
+
+
+// FrequencyList
+// @Title 指标频度列表
+// @Description 指标频度列表
+// @Success 200 string "获取成功"
+// @router /data/hisugar/frequency_list [get]
+func (this *TradeCommonController) FrequencyList() {
+	br := new(models.BaseResponse).Init()
+	defer func() {
+		if br.ErrMsg == "" {
+			br.IsSendEmail = false
+		}
+		this.Data["json"] = br
+		this.ServeJSON()
+	}()
+	sysUser := this.SysUser
+	if sysUser == nil {
+		br.Msg = "请登录"
+		br.ErrMsg = "请登录,SysUser Is Empty"
+		return
+	}
+
+	classifyId, _ := this.GetInt("ClassifyId")
+
+	var condition string
+	var pars []interface{}
+
+	if classifyId > 0 {
+		condition += ` AND classify_id=? `
+		pars = append(pars, classifyId)
+	}
+
+
+	frequencies, err := data_manage.GetHisugarFrequencyByCondition(condition, pars)
+	if err != nil {
+		fmt.Println("GetSciFrequency err:", err.Error())
+		utils.FileLog.Info("GetSciFrequency err:" + err.Error())
+		return
+	}
+	br.Data = frequencies
+	br.Ret = 200
+	br.Success = true
+	br.Msg = "获取成功"
+}

+ 9 - 0
routers/commentsRouter.go

@@ -11113,6 +11113,15 @@ func init() {
             Filters: nil,
             Params: nil})
 
+    beego.GlobalControllerRouter["eta/eta_api/controllers:TradeCommonController"] = append(beego.GlobalControllerRouter["eta/eta_api/controllers:TradeCommonController"],
+        beego.ControllerComments{
+            Method: "FrequencyList",
+            Router: `/data/hisugar/frequency_list`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
     beego.GlobalControllerRouter["eta/eta_api/controllers:TradeCommonController"] = append(beego.GlobalControllerRouter["eta/eta_api/controllers:TradeCommonController"],
         beego.ControllerComments{
             Method: "HisugarIndexData",