package handler import ( "github.com/gin-gonic/gin" "youngee_b_api/model/http_model" "youngee_b_api/service" ) func WrapManageInvoiceInfoHandler(ctx *gin.Context) { handler := newManageInvoiceInfoHandler(ctx) baseRun(handler) } func newManageInvoiceInfoHandler(ctx *gin.Context) *ManageInvoiceInfoHandler { return &ManageInvoiceInfoHandler{ req: http_model.NewManageInvoiceInfoRequest(), resp: http_model.NewManageInvoiceInfoResponse(), ctx: ctx, } } type ManageInvoiceInfoHandler struct { req *http_model.ManageInvoiceInfoRequest resp *http_model.CommonResponse ctx *gin.Context } func (h *ManageInvoiceInfoHandler) getRequest() interface{} { return h.req } func (h *ManageInvoiceInfoHandler) getContext() *gin.Context { return h.ctx } func (h *ManageInvoiceInfoHandler) getResponse() interface{} { return h.resp } func (h *ManageInvoiceInfoHandler) run() { supplierInvoice, err := service.Supplier.GetManageInvoiceInfo(h.ctx, h.req) if err != nil { h.resp.Data = err h.resp.Message = "查询失败" } h.resp.Data = supplierInvoice h.resp.Message = "查询成功" } func (h *ManageInvoiceInfoHandler) checkParam() error { return nil }