暂存一下,防止丢失
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"github.com/gofiber/fiber/v2"
|
||||
|
||||
"github.com/break/junhong_cmp_fiber/internal/model/dto"
|
||||
shopQuery "github.com/break/junhong_cmp_fiber/internal/query/shop"
|
||||
shopCommissionService "github.com/break/junhong_cmp_fiber/internal/service/shop_commission"
|
||||
"github.com/break/junhong_cmp_fiber/pkg/errors"
|
||||
"github.com/break/junhong_cmp_fiber/pkg/response"
|
||||
@@ -13,7 +14,8 @@ import (
|
||||
|
||||
// ShopCommissionHandler 代理商资金管理 Handler
|
||||
type ShopCommissionHandler struct {
|
||||
service *shopCommissionService.Service
|
||||
service *shopCommissionService.Service
|
||||
fundSummaryQuery *shopQuery.FundSummaryQuery
|
||||
}
|
||||
|
||||
// NewShopCommissionHandler 创建代理商资金管理 Handler
|
||||
@@ -21,6 +23,11 @@ func NewShopCommissionHandler(service *shopCommissionService.Service) *ShopCommi
|
||||
return &ShopCommissionHandler{service: service}
|
||||
}
|
||||
|
||||
// SetFundSummaryQuery 注入代理商资金概况 Query。
|
||||
func (h *ShopCommissionHandler) SetFundSummaryQuery(query *shopQuery.FundSummaryQuery) {
|
||||
h.fundSummaryQuery = query
|
||||
}
|
||||
|
||||
// ListFundSummary 代理商资金概况列表
|
||||
// GET /api/admin/shops/fund-summary
|
||||
func (h *ShopCommissionHandler) ListFundSummary(c *fiber.Ctx) error {
|
||||
@@ -29,7 +36,10 @@ func (h *ShopCommissionHandler) ListFundSummary(c *fiber.Ctx) error {
|
||||
return errors.New(errors.CodeInvalidParam)
|
||||
}
|
||||
|
||||
result, err := h.service.ListShopFundSummary(c.UserContext(), &req)
|
||||
if h.fundSummaryQuery == nil {
|
||||
return errors.New(errors.CodeInternalError, "代理商资金概况查询能力未配置")
|
||||
}
|
||||
result, err := h.fundSummaryQuery.List(c.UserContext(), req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user