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, IHelpsAppService { public HelpsAppService(IRepository 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> 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( totalCount, entities.Select(MapToEntityDto).ToList() ); return dtos; } protected override IQueryable ApplySorting(IQueryable query, IwbPagedRequestDto input) { return query.OrderBy(a => a.Sequence); } } }