From e99abb0393ff233e0cfd9f421526945bac25b4da Mon Sep 17 00:00:00 2001 From: malik masis Date: Tue, 22 Nov 2022 17:31:46 +0300 Subject: [PATCH] Removed unnecessary [AllowAnonymous] --- .../Orders/OrderAppService.cs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) 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();