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 WrapRefuseTalentWithdrawalHandler(ctx *gin.Context) { handler := newRefuseTalentWithdrawalHandler(ctx) BaseRun(handler) } type RefuseTalentWithdrawalHandler struct { ctx *gin.Context req *http_model.RefuseTalentWithdrawalRequest resp *http_model.CommonResponse } func (c RefuseTalentWithdrawalHandler) getContext() *gin.Context { return c.ctx } func (c RefuseTalentWithdrawalHandler) getResponse() interface{} { return c.resp } func (c RefuseTalentWithdrawalHandler) getRequest() interface{} { return c.req } func (c RefuseTalentWithdrawalHandler) run() { err := db.RefuseTalentWithdrawal(c.ctx, c.req) if err != nil { logrus.WithContext(c.ctx).Errorf("[RefuseTalentWithdrawalHandler] error RefuseTalentWithdrawal, err:%+v", err) util.HandlerPackErrorResp(c.resp, consts.ErrorInternal, consts.DefaultToast) return } c.resp.Message = "驳回提现成功" } func (c RefuseTalentWithdrawalHandler) checkParam() error { return nil } func newRefuseTalentWithdrawalHandler(ctx *gin.Context) *RefuseTalentWithdrawalHandler { return &RefuseTalentWithdrawalHandler{ ctx: ctx, req: http_model.NewRefuseTalentWithdrawalRequest(), resp: http_model.NewRefuseTalentWithdrawalResponse(), } }