package controllers import ( "eta/eta_mini_api/models" "eta/eta_mini_api/models/response" ) type MiniConfigController struct { BaseCommonController } // @Title 获取小程序配置项 // @Description 获取小程序配置项 // @Param ReportId query int true "报告id" // @Param chartPermissionId query int true "品种ID" // @Param PageSize query int true "每页数据条数" // @Param CurrentIndex query int true "当前页页码,从1开始" // @Success 200 {object} models.ReportDetailResp // @router /config [get] func (this *MiniConfigController) MiniConfig() { br := new(models.BaseResponse).Init() defer func() { if br.ErrMsg == "" { br.IsSendEmail = false } this.Data["json"] = br this.ServeJSON() }() list := make([]response.MiniConfigResp, 0) miniConf, err := models.GetMiniConf() if err != nil { br.Msg = "获取小程序配置项失败" br.ErrMsg = "获取小程序配置项失败,系统异常,Err:" + err.Error() return } list = append(list, response.MiniConfigResp{ ConfKey: "ChartViewUrl", ConfVal: miniConf["ChartViewUrl"], }, response.MiniConfigResp{ ConfKey: "H5Url", ConfVal: miniConf["H5Url"], }, response.MiniConfigResp{ ConfKey: "Disclaimers", ConfVal: miniConf["Disclaimers"], }, response.MiniConfigResp{ ConfKey: "ServiceAgreement", ConfVal: miniConf["ServiceAgreement"], }, response.MiniConfigResp{ ConfKey: "MostReport", ConfVal: miniConf["MostReport"], }, response.MiniConfigResp{ ConfKey: "ServicePhone", ConfVal: miniConf["ServicePhone"], }, response.MiniConfigResp{ ConfKey: "Colors", ConfVal: miniConf["Colors"], }, response.MiniConfigResp{ ConfKey: "EmptyImg", ConfVal: miniConf["EmptyImg"], }, response.MiniConfigResp{ ConfKey: "Logo", ConfVal: miniConf["Logo"], }, response.MiniConfigResp{ ConfKey: "WxAppId", ConfVal: miniConf["WxAppId"], }, response.MiniConfigResp{ ConfKey: "BindImg", ConfVal: miniConf["BindImg"], }) br.Data = list br.Ret = 200 br.Success = true br.Msg = "获取成功" }