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 registerCustomerAccountRoutes(router fiber.Router, handler *admin.CustomerAccountHandler, doc *openapi.Generator, basePath string) { accounts := router.Group("/customer-accounts") groupPath := basePath + "/customer-accounts" Register(accounts, doc, groupPath, "GET", "", handler.List, RouteSpec{ Summary: "客户账号列表", Tags: []string{"客户账号管理"}, Input: new(model.CustomerAccountListReq), Output: new(model.CustomerAccountPageResult), Auth: true, }) Register(accounts, doc, groupPath, "POST", "", handler.Create, RouteSpec{ Summary: "新增代理商账号", Tags: []string{"客户账号管理"}, Input: new(model.CreateCustomerAccountReq), Output: new(model.CustomerAccountItem), Auth: true, }) Register(accounts, doc, groupPath, "PUT", "/:id", handler.Update, RouteSpec{ Summary: "编辑账号", Tags: []string{"客户账号管理"}, Input: new(model.UpdateCustomerAccountReq), Output: new(model.CustomerAccountItem), Auth: true, }) Register(accounts, doc, groupPath, "PUT", "/:id/password", handler.UpdatePassword, RouteSpec{ Summary: "修改账号密码", Tags: []string{"客户账号管理"}, Input: new(model.UpdateCustomerAccountPasswordReq), Output: nil, Auth: true, }) Register(accounts, doc, groupPath, "PUT", "/:id/status", handler.UpdateStatus, RouteSpec{ Summary: "修改账号状态", Tags: []string{"客户账号管理"}, Input: new(model.UpdateCustomerAccountStatusReq), Output: nil, Auth: true, }) }