1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- package handler
- import (
- "github.com/gin-gonic/gin"
- "youngee_b_api/model/http_model"
- "youngee_b_api/service"
- )
- func WrapSupplierWithdrawListHandler(ctx *gin.Context) {
- handler := newSupplierWithdrawListHandler(ctx)
- baseRun(handler)
- }
- func newSupplierWithdrawListHandler(ctx *gin.Context) *SupplierWithdrawListHandler {
- return &SupplierWithdrawListHandler{
- req: http_model.NewSupplierWithdrawListRequest(),
- resp: http_model.NewSupplierWithdrawListResponse(),
- ctx: ctx,
- }
- }
- type SupplierWithdrawListHandler struct {
- req *http_model.SupplierWithdrawListRequest
- resp *http_model.CommonResponse
- ctx *gin.Context
- }
- func (h *SupplierWithdrawListHandler) getRequest() interface{} {
- return h.req
- }
- func (h *SupplierWithdrawListHandler) getContext() *gin.Context {
- return h.ctx
- }
- func (h *SupplierWithdrawListHandler) getResponse() interface{} {
- return h.resp
- }
- func (h *SupplierWithdrawListHandler) run() {
- toWithdrawList, err := service.Supplier.GetSupplierWithdrawList(h.ctx, h.req)
- if err != nil {
- h.resp.Status = 40000
- h.resp.Message = err.Error()
- return
- }
- h.resp.Status = 50000
- h.resp.Data = toWithdrawList
- }
- func (h *SupplierWithdrawListHandler) checkParam() error {
- return nil
- }
|