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 WrapGetSupplierInvoiceValueHandler(ctx *gin.Context) { handler := newGetSupplierInvoiceValueHandler(ctx) BaseRun(handler) } type GetSupplierInvoiceValueHandler struct { ctx *gin.Context req *http_model.GetSupplierInvoiceValueRequest resp *http_model.CommonResponse } func (g GetSupplierInvoiceValueHandler) getContext() *gin.Context { return g.ctx } func (g GetSupplierInvoiceValueHandler) getResponse() interface{} { return g.resp } func (g GetSupplierInvoiceValueHandler) getRequest() interface{} { return g.req } func (g GetSupplierInvoiceValueHandler) run() { req := g.req data, err := db.GetSupplierInvoiceValue(g.ctx, *req) if err != nil { logrus.WithContext(g.ctx).Errorf("[GetSupplierInvoiceValueHandler] error GetSupplierInvoiceValue, err:%+v", err) util.HandlerPackErrorResp(g.resp, consts.ErrorInternal, consts.DefaultToast) return } g.resp.Data = data } func (g GetSupplierInvoiceValueHandler) checkParam() error { return nil } func newGetSupplierInvoiceValueHandler(ctx *gin.Context) *GetSupplierInvoiceValueHandler { return &GetSupplierInvoiceValueHandler{ ctx: ctx, req: http_model.NewGetSupplierInvoiceValueRequest(), resp: http_model.NewGetSupplierInvoiceValueResponse(), } }