feat: 添加订单详情和退款功能,更新用户角色管理,增强超级管理员鉴权
This commit is contained in:
@@ -61,6 +61,17 @@ func (r *Routes) Register(router fiber.Router) {
|
||||
r.order.list,
|
||||
Query[dto.OrderPageFilter]("filter"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Get /super/v1/orders/:orderID -> order.detail")
|
||||
router.Get("/super/v1/orders/:orderID"[len(r.Path()):], DataFunc1(
|
||||
r.order.detail,
|
||||
PathParam[int64]("orderID"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Post /super/v1/orders/:orderID/refund -> order.refund")
|
||||
router.Post("/super/v1/orders/:orderID/refund"[len(r.Path()):], DataFunc2(
|
||||
r.order.refund,
|
||||
PathParam[int64]("orderID"),
|
||||
Body[dto.SuperOrderRefundForm]("form"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Get /super/v1/orders/statistics -> order.statistics")
|
||||
router.Get("/super/v1/orders/statistics"[len(r.Path()):], DataFunc0(
|
||||
r.order.statistics,
|
||||
@@ -124,6 +135,12 @@ func (r *Routes) Register(router fiber.Router) {
|
||||
PathParam[int64]("userID"),
|
||||
Body[dto.UserStatusUpdateForm]("form"),
|
||||
))
|
||||
r.log.Debugf("Registering route: Patch /super/v1/users/:userID/roles -> user.updateRoles")
|
||||
router.Patch("/super/v1/users/:userID/roles"[len(r.Path()):], Func2(
|
||||
r.user.updateRoles,
|
||||
PathParam[int64]("userID"),
|
||||
Body[dto.UserRolesUpdateForm]("form"),
|
||||
))
|
||||
|
||||
r.log.Info("Successfully registered all routes")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user