supplier_amount_bill_list.go 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 WrapSupplierAmountBillListHandler(ctx *gin.Context) {
  8. handler := newSupplierAmountBillListHandler(ctx)
  9. baseRun(handler)
  10. }
  11. func newSupplierAmountBillListHandler(ctx *gin.Context) *SupplierAmountBillListHandler {
  12. return &SupplierAmountBillListHandler{
  13. req: http_model.SupplierAmountBillRequest(),
  14. resp: http_model.SupplierAmountBillResponse(),
  15. ctx: ctx,
  16. }
  17. }
  18. type SupplierAmountBillListHandler struct {
  19. req *http_model.SupplierAmountBillListRequest
  20. resp *http_model.CommonResponse
  21. ctx *gin.Context
  22. }
  23. func (h *SupplierAmountBillListHandler) getRequest() interface{} {
  24. return h.req
  25. }
  26. func (h *SupplierAmountBillListHandler) getContext() *gin.Context {
  27. return h.ctx
  28. }
  29. func (h *SupplierAmountBillListHandler) getResponse() interface{} {
  30. return h.resp
  31. }
  32. func (h *SupplierAmountBillListHandler) run() {
  33. data, err := service.Supplier.GetSupplierAmountBillList(h.ctx, h.req)
  34. if err != nil {
  35. h.resp.Message = err.Error()
  36. }
  37. h.resp.Data = data
  38. h.resp.Message = "成功查询"
  39. }
  40. func (h *SupplierAmountBillListHandler) checkParam() error {
  41. return nil
  42. }