package handler import ( "github.com/gin-gonic/gin" "github.com/sirupsen/logrus" "youngee_m_api/consts" "youngee_m_api/db" "youngee_m_api/model/http_model" "youngee_m_api/util" ) func WrapGetSupplierInvoiceListHandler(ctx *gin.Context) { handler := newGetSupplierInvoiceListHandler(ctx) BaseRun(handler) } type GetSupplierInvoiceList struct { ctx *gin.Context req *http_model.GetSupplierInvoiceListRequest resp *http_model.CommonResponse } func (c GetSupplierInvoiceList) getContext() *gin.Context { return c.ctx } func (c GetSupplierInvoiceList) getResponse() interface{} { return c.resp } func (c GetSupplierInvoiceList) getRequest() interface{} { return c.req } func (c GetSupplierInvoiceList) run() { data := *c.req res, err := db.GetSupplierInvoiceList(c.ctx, data) if err != nil { logrus.Errorf("[GetSupplierInvoiceList] call GetSupplierInvoiceList err:%+v\n", err) util.HandlerPackErrorResp(c.resp, consts.ErrorInternal, "") logrus.Info("GetSupplierInvoiceList fail,req:%+v", c.req) return } c.resp.Message = "成功查询开票列表" c.resp.Data = res } func (c GetSupplierInvoiceList) checkParam() error { return nil } func newGetSupplierInvoiceListHandler(ctx *gin.Context) *GetSupplierInvoiceList { return &GetSupplierInvoiceList{ ctx: ctx, req: http_model.NewGetSupplierInvoiceListRequest(), resp: http_model.NewGetSupplierInvoiceListResponse(), } }