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" "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(model.MyCommissionSummaryResp), Auth: true, }) Register(my, doc, groupPath, "POST", "/withdrawal-requests", handler.CreateWithdrawal, RouteSpec{ Summary: "发起提现申请", Tags: []string{"我的佣金"}, Input: new(model.CreateMyWithdrawalReq), Output: new(model.CreateMyWithdrawalResp), Auth: true, }) Register(my, doc, groupPath, "GET", "/withdrawal-requests", handler.ListWithdrawals, RouteSpec{ Summary: "我的提现记录", Tags: []string{"我的佣金"}, Input: new(model.MyWithdrawalListReq), Output: new(model.WithdrawalRequestPageResult), Auth: true, }) Register(my, doc, groupPath, "GET", "/commission-records", handler.ListRecords, RouteSpec{ Summary: "我的佣金明细", Tags: []string{"我的佣金"}, Input: new(model.MyCommissionRecordListReq), Output: new(model.MyCommissionRecordPageResult), Auth: true, }) }