Files
junhong_cmp_fiber/internal/routes/my_commission.go
huang e87513541b
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 5m41s
feat: 实现一次性佣金功能
- 新增佣金计算服务,支持一次性佣金和返佣计算
- 新增 ShopSeriesOneTimeCommissionTier 模型和存储层
- 新增两个数据库迁移:一次性佣金表和订单佣金字段
- 更新 Commission 模型,新增佣金来源和关联字段
- 更新 CommissionRecord 存储层,支持一次性佣金查询
- 更新 MyCommission 服务,集成一次性佣金计算逻辑
- 更新 ShopCommission 服务,支持一次性佣金统计
- 新增佣金计算异步任务处理器
- 更新 API 路由,新增一次性佣金相关端点
- 归档 OpenSpec 变更文档,同步规范到主规范库
2026-01-29 09:36:12 +08:00

63 lines
2.0 KiB
Go

package routes
import (
"github.com/gofiber/fiber/v2"
"github.com/break/junhong_cmp_fiber/internal/handler/admin"
"github.com/break/junhong_cmp_fiber/internal/model/dto"
"github.com/break/junhong_cmp_fiber/pkg/openapi"
)
func registerMyCommissionRoutes(router fiber.Router, handler *admin.MyCommissionHandler, doc *openapi.Generator, basePath string) {
my := router.Group("/my")
groupPath := basePath + "/my"
Register(my, doc, groupPath, "GET", "/commission-summary", handler.GetSummary, RouteSpec{
Summary: "我的佣金概览",
Tags: []string{"我的佣金"},
Input: nil,
Output: new(dto.MyCommissionSummaryResp),
Auth: true,
})
Register(my, doc, groupPath, "POST", "/withdrawal-requests", handler.CreateWithdrawal, RouteSpec{
Summary: "发起提现申请",
Tags: []string{"我的佣金"},
Input: new(dto.CreateMyWithdrawalReq),
Output: new(dto.CreateMyWithdrawalResp),
Auth: true,
})
Register(my, doc, groupPath, "GET", "/withdrawal-requests", handler.ListWithdrawals, RouteSpec{
Summary: "我的提现记录",
Tags: []string{"我的佣金"},
Input: new(dto.MyWithdrawalListReq),
Output: new(dto.WithdrawalRequestPageResult),
Auth: true,
})
Register(my, doc, groupPath, "GET", "/commission-records", handler.ListRecords, RouteSpec{
Summary: "我的佣金明细",
Tags: []string{"我的佣金"},
Input: new(dto.MyCommissionRecordListReq),
Output: new(dto.MyCommissionRecordPageResult),
Auth: true,
})
Register(my, doc, groupPath, "GET", "/commission-stats", handler.GetStats, RouteSpec{
Summary: "我的佣金统计",
Tags: []string{"我的佣金"},
Input: new(dto.CommissionStatsRequest),
Output: new(dto.CommissionStatsResponse),
Auth: true,
})
Register(my, doc, groupPath, "GET", "/commission-daily-stats", handler.GetDailyStats, RouteSpec{
Summary: "我的每日佣金统计",
Tags: []string{"我的佣金"},
Input: new(dto.DailyCommissionStatsRequest),
Output: []dto.DailyCommissionStatsResponse{},
Auth: true,
})
}