feat(routes): 注册充值和代购订单路由
- 新增 H5 充值路由(创建订单、预检、列表、详情) - 新增 Admin 代购订单预检路由 - 更新 H5 路由组注册充值处理器 - 更新 Admin 路由组注册代购预检接口
This commit is contained in:
@@ -20,6 +20,9 @@ func RegisterH5Routes(router fiber.Router, handlers *bootstrap.Handlers, middlew
|
|||||||
if handlers.H5Order != nil {
|
if handlers.H5Order != nil {
|
||||||
registerH5OrderRoutes(authGroup, handlers.H5Order, doc, basePath)
|
registerH5OrderRoutes(authGroup, handlers.H5Order, doc, basePath)
|
||||||
}
|
}
|
||||||
|
if handlers.H5Recharge != nil {
|
||||||
|
registerH5RechargeRoutes(authGroup, handlers.H5Recharge, doc, basePath)
|
||||||
|
}
|
||||||
if handlers.EnterpriseDeviceH5 != nil {
|
if handlers.EnterpriseDeviceH5 != nil {
|
||||||
registerH5EnterpriseDeviceRoutes(authGroup, handlers.EnterpriseDeviceH5, doc, basePath)
|
registerH5EnterpriseDeviceRoutes(authGroup, handlers.EnterpriseDeviceH5, doc, basePath)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,6 +43,14 @@ func registerAdminOrderRoutes(router fiber.Router, handler *admin.OrderHandler,
|
|||||||
Output: nil,
|
Output: nil,
|
||||||
Auth: true,
|
Auth: true,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Register(router, doc, basePath, "POST", "/orders/purchase-check", handler.PurchaseCheck, RouteSpec{
|
||||||
|
Summary: "套餐购买预检",
|
||||||
|
Tags: []string{"订单管理"},
|
||||||
|
Input: new(dto.PurchaseCheckRequest),
|
||||||
|
Output: new(dto.PurchaseCheckResponse),
|
||||||
|
Auth: true,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// registerH5OrderRoutes 注册H5订单路由
|
// registerH5OrderRoutes 注册H5订单路由
|
||||||
|
|||||||
44
internal/routes/recharge.go
Normal file
44
internal/routes/recharge.go
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
package routes
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/gofiber/fiber/v2"
|
||||||
|
|
||||||
|
"github.com/break/junhong_cmp_fiber/internal/handler/h5"
|
||||||
|
"github.com/break/junhong_cmp_fiber/internal/model/dto"
|
||||||
|
"github.com/break/junhong_cmp_fiber/pkg/openapi"
|
||||||
|
)
|
||||||
|
|
||||||
|
// registerH5RechargeRoutes 注册H5充值路由
|
||||||
|
func registerH5RechargeRoutes(router fiber.Router, handler *h5.RechargeHandler, doc *openapi.Generator, basePath string) {
|
||||||
|
Register(router, doc, basePath, "POST", "/wallets/recharge", handler.Create, RouteSpec{
|
||||||
|
Summary: "创建充值订单",
|
||||||
|
Tags: []string{"H5 充值"},
|
||||||
|
Input: new(dto.CreateRechargeRequest),
|
||||||
|
Output: new(dto.RechargeResponse),
|
||||||
|
Auth: true,
|
||||||
|
})
|
||||||
|
|
||||||
|
Register(router, doc, basePath, "GET", "/wallets/recharge-check", handler.RechargeCheck, RouteSpec{
|
||||||
|
Summary: "充值预检",
|
||||||
|
Tags: []string{"H5 充值"},
|
||||||
|
Input: new(dto.RechargeCheckRequest),
|
||||||
|
Output: new(dto.RechargeCheckResponse),
|
||||||
|
Auth: true,
|
||||||
|
})
|
||||||
|
|
||||||
|
Register(router, doc, basePath, "GET", "/wallets/recharges", handler.List, RouteSpec{
|
||||||
|
Summary: "获取充值订单列表",
|
||||||
|
Tags: []string{"H5 充值"},
|
||||||
|
Input: new(dto.RechargeListRequest),
|
||||||
|
Output: new(dto.RechargeListResponse),
|
||||||
|
Auth: true,
|
||||||
|
})
|
||||||
|
|
||||||
|
Register(router, doc, basePath, "GET", "/wallets/recharges/:id", handler.Get, RouteSpec{
|
||||||
|
Summary: "获取充值订单详情",
|
||||||
|
Tags: []string{"H5 充值"},
|
||||||
|
Input: new(dto.GetRechargeRequest),
|
||||||
|
Output: new(dto.RechargeResponse),
|
||||||
|
Auth: true,
|
||||||
|
})
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user