fix: stats
This commit is contained in:
@@ -3,6 +3,7 @@ package admin
|
||||
import (
|
||||
"quyun/app/models"
|
||||
"quyun/app/requests"
|
||||
"quyun/providers/wepay"
|
||||
|
||||
"github.com/gofiber/fiber/v3"
|
||||
)
|
||||
@@ -13,7 +14,9 @@ type OrderListQuery struct {
|
||||
}
|
||||
|
||||
// @provider
|
||||
type orders struct{}
|
||||
type orders struct {
|
||||
wepay *wepay.Client
|
||||
}
|
||||
|
||||
// List users
|
||||
//
|
||||
@@ -24,3 +27,15 @@ func (ctl *orders) List(ctx fiber.Ctx, pagination *requests.Pagination, query *O
|
||||
cond := models.Orders.BuildConditionWithKey(query.OrderNumber, query.UserID)
|
||||
return models.Orders.List(ctx.Context(), pagination, cond)
|
||||
}
|
||||
|
||||
// Refund
|
||||
// @Router /admin/orders/{id}/refund [post]
|
||||
// @Bind id path
|
||||
func (ctl *orders) Refund(ctx fiber.Ctx, id int64) error {
|
||||
order, err := models.Orders.GetByID(ctx.Context(), id)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return ctx.JSON(order)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user