package handler import ( "github.com/gin-gonic/gin" "github.com/sirupsen/logrus" "youngee_m_api/consts" "youngee_m_api/db" "youngee_m_api/model/http_model" "youngee_m_api/util" ) func WrapGetTalentWithdrawInfoHandler(ctx *gin.Context) { handler := newGetTalentWithdrawInfoHandler(ctx) BaseRun(handler) } type GetTalentWithdrawInfoHandler struct { ctx *gin.Context req *http_model.GetTalentWithdrawInfoRequest resp *http_model.CommonResponse } func (g GetTalentWithdrawInfoHandler) getContext() *gin.Context { return g.ctx } func (g GetTalentWithdrawInfoHandler) getResponse() interface{} { return g.resp } func (g GetTalentWithdrawInfoHandler) getRequest() interface{} { return g.req } func (g GetTalentWithdrawInfoHandler) run() { req := g.req data, err := db.GetTalentWithdrawInfo(g.ctx, *req) if err != nil { logrus.WithContext(g.ctx).Errorf("[GetTalentWithdrawInfoHandler] error GetTalentWithdrawInfo, err:%+v", err) util.HandlerPackErrorResp(g.resp, consts.ErrorInternal, consts.DefaultToast) return } g.resp.Data = data g.resp.Status = consts.ErrorSuccess g.resp.Message = "ok" } func (g GetTalentWithdrawInfoHandler) checkParam() error { return nil } func newGetTalentWithdrawInfoHandler(ctx *gin.Context) *GetTalentWithdrawInfoHandler { return &GetTalentWithdrawInfoHandler{ ctx: ctx, req: http_model.NewGetTalentWithdrawInfoRequest(), resp: http_model.NewGetTalentWithdrawInfoResponse(), } }