diff --git a/services/ordering/src/EShopOnAbp.OrderingService.Application/Orders/OrderAppService.cs b/services/ordering/src/EShopOnAbp.OrderingService.Application/Orders/OrderAppService.cs index 0ac0dfd8..df2ed232 100644 --- a/services/ordering/src/EShopOnAbp.OrderingService.Application/Orders/OrderAppService.cs +++ b/services/ordering/src/EShopOnAbp.OrderingService.Application/Orders/OrderAppService.cs @@ -37,14 +37,8 @@ public class OrderAppService : ApplicationService, IOrderAppService return CreateOrderDtoMapping(order); } - [AllowAnonymous] public async Task> GetMyOrdersAsync(GetMyOrdersInput input) { - if (CurrentUser.Id == null) - { - return new List(); - } - ISpecification specification = SpecificationFactory.Create(input.Filter); var orders = await _orderRepository.GetOrdersByUserId(CurrentUser.GetId(), specification, true); return CreateOrderDtoMapping(orders); @@ -78,6 +72,7 @@ public class OrderAppService : ApplicationService, IOrderAppService Payments = await GetPercentOfTotalPaymentAsync(input.Filter) }; } + private async Task> GetTopSellingAsync(string filter) { ISpecification specification = SpecificationFactory.Create(filter); @@ -99,7 +94,6 @@ public class OrderAppService : ApplicationService, IOrderAppService return CreateOrderStatusDtoMapping(orders); } - [AllowAnonymous] public async Task GetByOrderNoAsync(int orderNo) { var order = await _orderRepository.GetByOrderNoAsync(orderNo); @@ -122,7 +116,6 @@ public class OrderAppService : ApplicationService, IOrderAppService await _orderRepository.UpdateAsync(order); } - [AllowAnonymous] public async Task CreateAsync(OrderCreateDto input) { var orderItems = GetProductListTuple(input.Products); @@ -211,7 +204,7 @@ public class OrderAppService : ApplicationService, IOrderAppService var topSetlling = orderItems .GroupBy(p => p.ProductId) - .Select(p => new TopSellingDto { Units = p.Count(), ProductName = p.First().ProductName , PictureUrl = p.First().PictureUrl }) + .Select(p => new TopSellingDto { Units = p.Count(), ProductName = p.First().ProductName, PictureUrl = p.First().PictureUrl }) .OrderByDescending(p => p.Units) .Take(OrderConstants.Top10).ToList();