|
@@ -60,3 +60,35 @@ func (this *ChartController) List() {
|
|
|
br.Data = resp
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+// @Title Detail
|
|
|
+// @Description 获得图表详情
|
|
|
+// @Param ChartInfoId query int true "图表详情id"
|
|
|
+// @Success 200 {object} models.BaseResponse
|
|
|
+// @Failure 403 {object} models.BaseResponse
|
|
|
+// @router /detail [get]
|
|
|
+func (this *ChartController) Detail() {
|
|
|
+ br := new(models.BaseResponse).Init()
|
|
|
+ defer func() {
|
|
|
+ this.Data["json"] = br
|
|
|
+ this.ServeJSON()
|
|
|
+ }()
|
|
|
+
|
|
|
+ chartInfoId, _ := this.GetInt("ChartInfoId")
|
|
|
+ if chartInfoId <= 0 {
|
|
|
+ br.Msg = "图表id错误"
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ chart, err := models.GetChartById(chartInfoId)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "获取图表列表失败"
|
|
|
+ br.ErrMsg = "获取图表列表失败,系统错误,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ br.Ret = 200
|
|
|
+ br.Msg = "获取图表列表成功"
|
|
|
+ br.Success = true
|
|
|
+ br.Data = chart
|
|
|
+}
|