Hello,
I am trying to add pagination to below API. But there is no pagination parameters defined in this api. Can I modify this api to add pagination. "/api/audit-logging/audit-logs/entity-changes-with-username"
There is another API of audit-logging which contains the sorting and pagination.But I also require the username of the person who modified the entity which is not available in this API. "/api/audit-logging/audit-logs/entity-changes" We wanted to show history changes of entity by any user.
We want to group that result from the API according to month and Show this listing in Angular.
3 Answer(s)
-
0
Hi,
Yes you can override or extend this app service, please read more about this here https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Overriding-Services#customizing-the-application-modules-overriding-services
-
0
Hi, Can you help me to override the service to add username to it. otherwise help me to add pagination to the first api.(1st point).
Thank you.
-
0
Hi,
At present, you can't add parameters to existing endpoints. You can create your own application service to do it.
Or you can get the parameters from the HTTP context.
[Dependency(ReplaceServices = true)] [ExposeServices(typeof(IAuditLogsAppService))] public class MyAuditLogsAppService : AuditLogsAppService { private readonly IHttpContextAccessor _httpContextAccessor; public MyAuditLogsAppService(IAuditLogRepository auditLogRepository, IJsonSerializer jsonSerializer, IPermissionChecker permissionChecker, IPermissionDefinitionManager permissionDefinitionManager, IHttpContextAccessor httpContextAccessor) : base( auditLogRepository, jsonSerializer, permissionChecker, permissionDefinitionManager) { _httpContextAccessor = httpContextAccessor; } public override Task<List<EntityChangeWithUsernameDto>> GetEntityChangesWithUsernameAsync(EntityChangeFilter input) { var maxResultCount = _httpContextAccessor.HttpContext.Request.Query["MaxResultCount"]; var skipCount = _httpContextAccessor.HttpContext.Request.Query["skipCount"]; ... query here } }