package handler import ( "github.com/gin-gonic/gin" "youngee_b_api/model/http_model" "youngee_b_api/service" ) func WrapSupplierBillAmountHandler(ctx *gin.Context) { handler := newSupplierBillAmountHandler(ctx) baseRun(handler) } func newSupplierBillAmountHandler(ctx *gin.Context) *SupplierBillAmountHandler { return &SupplierBillAmountHandler{ req: http_model.SupplierBillAmountRequest(), resp: http_model.SupplierBillAmountResponse(), ctx: ctx, } } type SupplierBillAmountHandler struct { req *http_model.SupplierAmountRequest resp *http_model.CommonResponse ctx *gin.Context } func (h *SupplierBillAmountHandler) getRequest() interface{} { return h.req } func (h *SupplierBillAmountHandler) getContext() *gin.Context { return h.ctx } func (h *SupplierBillAmountHandler) getResponse() interface{} { return h.resp } func (h *SupplierBillAmountHandler) run() { data, err := service.Supplier.GetSupplierBillAmount(h.ctx, h.req) if err != nil { h.resp.Message = err.Error() } h.resp.Data = data // fmt.Println(data) h.resp.Message = "成功查询" } func (h *SupplierBillAmountHandler) checkParam() error { return nil }