| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- using System.Linq;
- using System.Threading.Tasks;
- using Abp.Application.Services.Dto;
- using Abp.Auditing;
- using Abp.Authorization;
- using Abp.Domain.Repositories;
- using WeApp.Authorization;
- using WeApp.BaseInfo;
- using WeApp.BaseSystem.Help.Dto;
- using IwbZero.AppServiceBase;
- using IwbZero.Auditing;
- using WeApp.Configuration;
- namespace WeApp.BaseSystem.Help
- {
- [AbpAuthorize, AuditLog("系统帮助", "帮助")]
- public class HelpsAppService : IwbAsyncCrudAppService<SysHelp, SysHelpDto, int, IwbPagedRequestDto, SysHelpCreateDto, SysHelpUpdateDto>, IHelpsAppService
- {
- public HelpsAppService(IRepository<SysHelp, int> repository) : base(repository, "")
- {
- }
- protected override string GetPermissionName { get; set; } = PermissionNames.PagesSystemMgHelpMg;
- protected override string GetAllPermissionName { get; set; } = PermissionNames.PagesSystemMgHelpMg;
- protected override string CreatePermissionName { get; set; } = PermissionNames.PagesSystemMgHelpMgCreate;
- protected override string UpdatePermissionName { get; set; } = PermissionNames.PagesSystemMgHelpMgUpdate;
- protected override string DeletePermissionName { get; set; } = PermissionNames.PagesSystemMgHelpMgDelete;
- [DisableAuditing]
- public override async Task<PagedResultDto<SysHelpDto>> GetAll(IwbPagedRequestDto input)
- {
- CheckGetAllPermission();
- var query = CreateFilteredQuery(input);
- query = ApplyFilter(query, input);
- var totalCount = await AsyncQueryableExecuter.CountAsync(query);
- query = ApplySorting(query, input);
- query = ApplyPaging(query, input);
- var entities = await AsyncQueryableExecuter.ToListAsync(query);
- var dtos = new PagedResultDto<SysHelpDto>(
- totalCount,
- entities.Select(MapToEntityDto).ToList()
- );
- return dtos;
- }
- protected override IQueryable<SysHelp> ApplySorting(IQueryable<SysHelp> query, IwbPagedRequestDto input)
- {
- return query.OrderBy(a => a.Sequence);
- }
- }
- }
|