package controllers import ( "encoding/json" "eta/eta_mini_api/models" "eta/eta_mini_api/models/request" ) type MyChartController 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 /collect [get] func (this *MyChartController) Collect() { br := new(models.BaseResponse).Init() defer func() { this.Data["json"] = br this.ServeJSON() }() var req request.MyChartCollectReq if err := json.Unmarshal(this.Ctx.Input.RequestBody, &req); err != nil { br.Msg = "参数解析失败" br.ErrMsg = "参数解析失败,Err:" + err.Error() return } user := this.User if user.Status != 2 { br.Msg = "用户没有权限收藏" return } }