123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- package handler
- import (
- "github.com/gin-gonic/gin"
- "youngee_b_api/model/http_model"
- "youngee_b_api/service"
- )
- func WrapSupplierWithdrawCountHandler(ctx *gin.Context) {
- handler := newSupplierWithdrawCountHandler(ctx)
- baseRun(handler)
- }
- func newSupplierWithdrawCountHandler(ctx *gin.Context) *SupplierWithdrawCountHandler {
- return &SupplierWithdrawCountHandler{
- req: http_model.NewSupplierWithdrawCountRequest(),
- resp: http_model.NewSupplierWithdrawCountResponse(),
- ctx: ctx,
- }
- }
- type SupplierWithdrawCountHandler struct {
- req *http_model.SupplierWithdrawCountRequest
- resp *http_model.CommonResponse
- ctx *gin.Context
- }
- func (h *SupplierWithdrawCountHandler) getRequest() interface{} {
- return h.req
- }
- func (h *SupplierWithdrawCountHandler) getContext() *gin.Context {
- return h.ctx
- }
- func (h *SupplierWithdrawCountHandler) getResponse() interface{} {
- return h.resp
- }
- func (h *SupplierWithdrawCountHandler) run() {
- toWithdrawCount, err := service.Supplier.GetSupplierWithdrawCount(h.ctx, h.req)
- if err != nil {
- h.resp.Status = 40000
- h.resp.Message = err.Error()
- return
- }
- h.resp.Status = 20000
- h.resp.Message = "ok"
- h.resp.Data = toWithdrawCount
- }
- func (h *SupplierWithdrawCountHandler) checkParam() error {
- return nil
- }
|