12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- 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 WrapGetSupplierWithdrawListHandler(ctx *gin.Context) {
- handler := newGetSupplierWithdrawListHandler(ctx)
- BaseRun(handler)
- }
- type GetSupplierWithdrawList struct {
- ctx *gin.Context
- req *http_model.GetSupplierWithdrawListRequest
- resp *http_model.CommonResponse
- }
- func (c GetSupplierWithdrawList) getContext() *gin.Context {
- return c.ctx
- }
- func (c GetSupplierWithdrawList) getResponse() interface{} {
- return c.resp
- }
- func (c GetSupplierWithdrawList) getRequest() interface{} {
- return c.req
- }
- func (c GetSupplierWithdrawList) run() {
- data := *c.req
- res, err := db.GetSupplierWithdrawList(c.ctx, data)
- if err != nil {
- logrus.Errorf("[GetSupplierWithdrawList] call GetSupplierWithdrawList err:%+v\n", err)
- util.HandlerPackErrorResp(c.resp, consts.ErrorInternal, "")
- logrus.Info("GetSupplierWithdrawList fail,req:%+v", c.req)
- return
- }
- c.resp.Message = "成功查询开票列表"
- c.resp.Data = res
- }
- func (c GetSupplierWithdrawList) checkParam() error {
- return nil
- }
- func newGetSupplierWithdrawListHandler(ctx *gin.Context) *GetSupplierWithdrawList {
- return &GetSupplierWithdrawList{
- ctx: ctx,
- req: http_model.NewGetSupplierWithdrawListRequest(),
- resp: http_model.NewGetSupplierWithdrawListResponse(),
- }
- }
|