supplier_to_withdraw_list.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 WrapSupplierToWithdrawListHandler(ctx *gin.Context) {
  8. handler := newSupplierToWithdrawListHandler(ctx)
  9. baseRun(handler)
  10. }
  11. func newSupplierToWithdrawListHandler(ctx *gin.Context) *SupplierToWithdrawListHandler {
  12. return &SupplierToWithdrawListHandler{
  13. req: http_model.NewSupplierToWithdrawListRequest(),
  14. resp: http_model.NewSupplierToWithdrawListResponse(),
  15. ctx: ctx,
  16. }
  17. }
  18. type SupplierToWithdrawListHandler struct {
  19. req *http_model.SupplierToWithdrawListRequest
  20. resp *http_model.CommonResponse
  21. ctx *gin.Context
  22. }
  23. func (h *SupplierToWithdrawListHandler) getRequest() interface{} {
  24. return h.req
  25. }
  26. func (h *SupplierToWithdrawListHandler) getContext() *gin.Context {
  27. return h.ctx
  28. }
  29. func (h *SupplierToWithdrawListHandler) getResponse() interface{} {
  30. return h.resp
  31. }
  32. func (h *SupplierToWithdrawListHandler) run() {
  33. toWithdrawList, err := service.Supplier.GetSupplierToWithdrawList(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.Status = 50000
  40. h.resp.Data = toWithdrawList
  41. }
  42. func (h *SupplierToWithdrawListHandler) checkParam() error {
  43. return nil
  44. }