feat: 更新路由绑定,使用模型作为参数以简化控制器逻辑
Some checks failed
build quyun / Build (push) Failing after 10s

This commit is contained in:
2025-12-19 23:53:15 +08:00
parent 7b18a6a0e6
commit df6a8de61d
7 changed files with 96 additions and 113 deletions

View File

@@ -24,7 +24,7 @@ type orders struct {
wepay *wepay.Client
}
// List users
// List
//
// @Summary 订单列表
// @Tags Admin Orders
@@ -60,13 +60,8 @@ func (ctl *orders) List(
// @Param id path int64 true "订单 ID"
// @Success 200 {object} any "成功"
// @Router /admin/orders/:id/refund [post]
// @Bind id path
func (ctl *orders) Refund(ctx fiber.Ctx, id int64) error {
order, err := services.Orders.FindByID(ctx, id)
if err != nil {
return err
}
// @Bind order path key(id) model(id)
func (ctl *orders) Refund(ctx fiber.Ctx, order *models.Order) error {
user, err := services.Users.FindByID(ctx, order.UserID)
if err != nil {
return err