supplier_bill_amount.go 1.1 KB

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