withdraw_payment_info.go 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. package handler
  2. import (
  3. "github.com/gin-gonic/gin"
  4. "youngee_b_api/model/http_model"
  5. "youngee_b_api/service"
  6. )
  7. func WrapWithdrawPaymentInfoHandler(ctx *gin.Context) {
  8. handler := newWithdrawPaymentInfoHandler(ctx)
  9. baseRun(handler)
  10. }
  11. func newWithdrawPaymentInfoHandler(ctx *gin.Context) *WithdrawPaymentInfoHandler {
  12. return &WithdrawPaymentInfoHandler{
  13. req: http_model.NewWithdrawPaymentInfoRequest(),
  14. resp: http_model.NewWithdrawPaymentInfoResponse(),
  15. ctx: ctx,
  16. }
  17. }
  18. type WithdrawPaymentInfoHandler struct {
  19. req *http_model.WithdrawPaymentInfoRequest
  20. resp *http_model.CommonResponse
  21. ctx *gin.Context
  22. }
  23. func (h *WithdrawPaymentInfoHandler) getRequest() interface{} {
  24. return h.req
  25. }
  26. func (h *WithdrawPaymentInfoHandler) getContext() *gin.Context {
  27. return h.ctx
  28. }
  29. func (h *WithdrawPaymentInfoHandler) getResponse() interface{} {
  30. return h.resp
  31. }
  32. func (h *WithdrawPaymentInfoHandler) run() {
  33. amount, err := service.Supplier.GetWithdrawPaymentInfo(h.ctx, h.req)
  34. if err != nil {
  35. h.resp.Status = 40000
  36. h.resp.Message = err.Error()
  37. return
  38. }
  39. h.resp.Data = amount
  40. h.resp.Message = "成功添加"
  41. }
  42. func (h *WithdrawPaymentInfoHandler) checkParam() error {
  43. return nil
  44. }