package controllers import ( "eta/eta_mini_api/models" "eta/eta_mini_api/models/response" "eta/eta_mini_api/services" ) type ChartController struct { BaseAuthController } // @Title List // @Description create users // @Param PageSize query int true "每页数据条数" // @Param CurrentIndex query int true "当前页页码,从1开始" // @Success 200 {object} models.BaseResponse // @Failure 403 {object} models.BaseResponse // @router /list [get] func (this *ChartController) List() { br := new(models.BaseResponse).Init() defer func() { this.Data["json"] = br this.ServeJSON() }() pageSize, _ := this.GetInt("PageSize") currentIndex, _ := this.GetInt("CurrentIndex") result, err := services.GetChartList(pageSize, currentIndex) if err != nil { br.Msg = "查询图表失败" br.ErrMsg = "查询图表失败,系统异常,Err:" + err.Error() return } if result.Ret != 200 { br.Msg = "查询图表失败" br.ErrMsg = result.ErrMsg return } resp := new(response.ChartListResp) resp.List = result.Data.List resp.Paging = result.Data.Paging br.Msg = "查询图表成功" br.Data = result.Data br.Success = true br.Ret = 200 }