Open Closed

Customizing the Entity Changes #5256


User avatar
0
ed_developer2 created

Hello,

  1. 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"

  2. 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.

  3. We want to group that result from the API according to month and Show this listing in Angular.

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

3 Answer(s)
  • User Avatar
    0
    Anjali_Musmade created
    Support Team Member

    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

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    ed_developer2 created

    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.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    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
        }
    }
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 28, 2026, 11:44
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.