refactor: 移除不必要的上下文调用,简化服务方法参数
This commit is contained in:
@@ -24,7 +24,7 @@ type orders struct{}
|
||||
// @Success 200 {object} requests.Pager{items=[]dto.SuperOrderItem}
|
||||
// @Bind filter query
|
||||
func (c *orders) List(ctx fiber.Ctx, filter *dto.SuperOrderListFilter) (*requests.Pager, error) {
|
||||
return services.Super.ListOrders(ctx.Context(), filter)
|
||||
return services.Super.ListOrders(ctx, filter)
|
||||
}
|
||||
|
||||
// Get order
|
||||
@@ -39,7 +39,7 @@ func (c *orders) List(ctx fiber.Ctx, filter *dto.SuperOrderListFilter) (*request
|
||||
// @Success 200 {object} dto.SuperOrderDetail
|
||||
// @Bind id path
|
||||
func (c *orders) Get(ctx fiber.Ctx, id int64) (*dto.SuperOrderDetail, error) {
|
||||
return services.Super.GetOrder(ctx.Context(), id)
|
||||
return services.Super.GetOrder(ctx, id)
|
||||
}
|
||||
|
||||
// Refund order
|
||||
@@ -56,7 +56,7 @@ func (c *orders) Get(ctx fiber.Ctx, id int64) (*dto.SuperOrderDetail, error) {
|
||||
// @Bind id path
|
||||
// @Bind form body
|
||||
func (c *orders) Refund(ctx fiber.Ctx, id int64, form *dto.SuperOrderRefundForm) error {
|
||||
return services.Super.RefundOrder(ctx.Context(), id, form)
|
||||
return services.Super.RefundOrder(ctx, id, form)
|
||||
}
|
||||
|
||||
// Order statistics
|
||||
@@ -69,5 +69,5 @@ func (c *orders) Refund(ctx fiber.Ctx, id int64, form *dto.SuperOrderRefundForm)
|
||||
// @Produce json
|
||||
// @Success 200 {object} dto.OrderStatisticsResponse
|
||||
func (c *orders) Statistics(ctx fiber.Ctx) (*dto.OrderStatisticsResponse, error) {
|
||||
return services.Super.OrderStatistics(ctx.Context())
|
||||
return services.Super.OrderStatistics(ctx)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user