package handler import ( "fmt" "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 WrapGetWithDrawInfoHandler(ctx *gin.Context) { handler := newGetWithDrawInfoHandler(ctx) BaseRun(handler) } type GetWithDrawInfoHandler struct { ctx *gin.Context req *http_model.GetWithDrawInfoRequest resp *http_model.CommonResponse } func (g GetWithDrawInfoHandler) getContext() *gin.Context { return g.ctx } func (g GetWithDrawInfoHandler) getResponse() interface{} { return g.resp } func (g GetWithDrawInfoHandler) getRequest() interface{} { return g.req } func (g GetWithDrawInfoHandler) run() { req := g.req fmt.Println(req.Withdrawid) data, err := db.GetWithDrawInfo(g.ctx, *req) if err != nil { logrus.WithContext(g.ctx).Errorf("[GetWithDrawInfoHandler] error GetWithDrawInfo, err:%+v", err) util.HandlerPackErrorResp(g.resp, consts.ErrorInternal, consts.DefaultToast) return } g.resp.Data = data g.resp.Status = consts.ErrorSuccess g.resp.Message = "成功查询" } func (g GetWithDrawInfoHandler) checkParam() error { return nil } func newGetWithDrawInfoHandler(ctx *gin.Context) *GetWithDrawInfoHandler { return &GetWithDrawInfoHandler{ ctx: ctx, req: http_model.NewGetWithDrawInfoRequest(), resp: http_model.NewGetWithDrawInfoResponse(), } }