package handler import ( "github.com/gin-gonic/gin" "youngee_b_api/model/http_model" "youngee_b_api/service" ) func WrapWithdrawPaymentInfoHandler(ctx *gin.Context) { handler := newWithdrawPaymentInfoHandler(ctx) baseRun(handler) } func newWithdrawPaymentInfoHandler(ctx *gin.Context) *WithdrawPaymentInfoHandler { return &WithdrawPaymentInfoHandler{ req: http_model.NewWithdrawPaymentInfoRequest(), resp: http_model.NewWithdrawPaymentInfoResponse(), ctx: ctx, } } type WithdrawPaymentInfoHandler struct { req *http_model.WithdrawPaymentInfoRequest resp *http_model.CommonResponse ctx *gin.Context } func (h *WithdrawPaymentInfoHandler) getRequest() interface{} { return h.req } func (h *WithdrawPaymentInfoHandler) getContext() *gin.Context { return h.ctx } func (h *WithdrawPaymentInfoHandler) getResponse() interface{} { return h.resp } func (h *WithdrawPaymentInfoHandler) run() { amount, err := service.Supplier.GetWithdrawPaymentInfo(h.ctx, h.req) if err != nil { h.resp.Status = 40000 h.resp.Message = err.Error() return } h.resp.Data = amount h.resp.Message = "成功添加" } func (h *WithdrawPaymentInfoHandler) checkParam() error { return nil }