- 新增 H5 充值路由(创建订单、预检、列表、详情) - 新增 Admin 代购订单预检路由 - 更新 H5 路由组注册充值处理器 - 更新 Admin 路由组注册代购预检接口
45 lines
1.4 KiB
Go
45 lines
1.4 KiB
Go
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,
|
|
})
|
|
}
|