-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add product tag app services.
- Loading branch information
Showing
2 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
62 changes: 62 additions & 0 deletions
62
...Abp.EShop.Products.Application/EasyAbp/EShop/Products/ProductTags/ProductTagAppService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<ProductTag, ProductTagDto, Guid, GetProductTagListDto, object, object>, | ||
IProductTagAppService | ||
{ | ||
public ProductTagAppService(IRepository<ProductTag, Guid> repository) : base(repository) | ||
{ | ||
} | ||
|
||
protected override string GetListPolicyName { get; set; } = ProductsPermissions.Products.Default; | ||
|
||
protected override IQueryable<ProductTag> 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<ProductTagDto> GetAsync(Guid id) | ||
{ | ||
throw new NotSupportedException(); | ||
} | ||
|
||
[RemoteService(false)] | ||
public override Task<ProductTagDto> CreateAsync(object input) | ||
{ | ||
throw new NotSupportedException(); | ||
} | ||
|
||
[RemoteService(false)] | ||
public override Task<ProductTagDto> UpdateAsync(Guid id, object input) | ||
{ | ||
throw new NotSupportedException(); | ||
} | ||
|
||
[RemoteService(false)] | ||
public override Task DeleteAsync(Guid id) | ||
{ | ||
throw new NotSupportedException(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters