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 WarpGetWithdrawValueHandler(ctx *gin.Context) { handler := newGetWithdrawValueHandler(ctx) BaseRun(handler) } type GetWithdrawValueHandler struct { ctx *gin.Context req *http_model.GetWithdrawValueRequest resp *http_model.CommonResponse } func (g GetWithdrawValueHandler) getContext() *gin.Context { return g.ctx } func (g GetWithdrawValueHandler) getResponse() interface{} { return g.resp } func (g GetWithdrawValueHandler) getRequest() interface{} { return g.req } func (g GetWithdrawValueHandler) run() { req := g.req data, err := db.GetWithdrawValue(g.ctx, *req) if err != nil { logrus.WithContext(g.ctx).Errorf("[GetWithdrawValueHandler] error GetWithdrawValue, err:%+v", err) util.HandlerPackErrorResp(g.resp, consts.ErrorInternal, consts.DefaultToast) return } g.resp.Data = data } func (g GetWithdrawValueHandler) checkParam() error { return nil } func newGetWithdrawValueHandler(ctx *gin.Context) *GetWithdrawValueHandler { return &GetWithdrawValueHandler{ ctx: ctx, req: http_model.NewGetWithdrawValueRequest(), resp: http_model.NewGetWithdrawValueResponse(), } }