diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductTags/ProductTagAppService.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductTags/ProductTagAppService.cs new file mode 100644 index 000000000..75f344eb2 --- /dev/null +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductTags/ProductTagAppService.cs @@ -0,0 +1,62 @@ +using EasyAbp.EShop.Products.ProductTags.Dtos; +using System; +using System.Linq; +using System.Threading.Tasks; +using EasyAbp.EShop.Products.Authorization; +using Volo.Abp; +using Volo.Abp.Application.Services; +using Volo.Abp.Domain.Repositories; + +namespace EasyAbp.EShop.Products.ProductTags +{ + class ProductTagAppService : CrudAppService, + IProductTagAppService + { + public ProductTagAppService(IRepository repository) : base(repository) + { + } + + protected override string GetListPolicyName { get; set; } = ProductsPermissions.Products.Default; + + protected override IQueryable CreateFilteredQuery(GetProductTagListDto input) + { + var queryable = Repository.AsQueryable(); + + if (input.TagId.HasValue) + { + queryable = queryable.Where(x => x.TagId == input.TagId); + } + + if (input.ProductId.HasValue) + { + queryable = queryable.Where(x => x.ProductId == input.ProductId); + } + + return queryable; + } + + [RemoteService(false)] + public override Task GetAsync(Guid id) + { + throw new NotSupportedException(); + } + + [RemoteService(false)] + public override Task CreateAsync(object input) + { + throw new NotSupportedException(); + } + + [RemoteService(false)] + public override Task UpdateAsync(Guid id, object input) + { + throw new NotSupportedException(); + } + + [RemoteService(false)] + public override Task DeleteAsync(Guid id) + { + throw new NotSupportedException(); + } + } +} diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductsApplicationAutoMapperProfile.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductsApplicationAutoMapperProfile.cs index 136fc6192..ec3ac8052 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductsApplicationAutoMapperProfile.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductsApplicationAutoMapperProfile.cs @@ -14,6 +14,10 @@ using EasyAbp.EShop.Products.ProductDetailHistories.Dtos; using EasyAbp.EShop.Products.ProductHistories; using EasyAbp.EShop.Products.ProductHistories.Dtos; +using EasyAbp.EShop.Products.ProductTags; +using EasyAbp.EShop.Products.ProductTags.Dtos; +using EasyAbp.EShop.Products.Tags; +using EasyAbp.EShop.Products.Tags.Dtos; using Volo.Abp.AutoMapper; using Volo.Abp.DependencyInjection; @@ -63,6 +67,10 @@ public ProductsApplicationAutoMapperProfile(IAttributeOptionIdsSerializer attrib CreateMap(); CreateMap(); CreateMap(); + CreateMap(MemberList.Source); + CreateMap(MemberList.Source); + CreateMap(); + CreateMap(); } } }