Enhance API endpoints with response type annotations
- Updated various API endpoints to include response type annotations using .Produces<T>() for better documentation and type safety. - Enhanced activation, admin, user, config, and other endpoints to specify response types, improving clarity for frontend integration. - Added new DTOs for structured responses in authentication and Telegram-related endpoints. - Improved overall API schema generation to reflect these changes, ensuring consistency between backend and frontend types.
This commit is contained in:
@@ -2,6 +2,7 @@ using PnvPanel.Api.Common;
|
||||
using PnvPanel.Application.Admin.Audit;
|
||||
using PnvPanel.Application.Admin.Stats;
|
||||
using PnvPanel.Application.Common.Messaging;
|
||||
using PnvPanel.Application.Common.Models;
|
||||
using PnvPanel.Infrastructure.Identity;
|
||||
|
||||
namespace PnvPanel.Api.Endpoints;
|
||||
@@ -14,8 +15,8 @@ public static class AdminStatsEndpoints
|
||||
.WithTags("Admin.Stats")
|
||||
.RequireAuthorization(policy => policy.RequireRole(RoleNames.Admin));
|
||||
|
||||
admin.MapGet("/stats", GetStats);
|
||||
admin.MapGet("/audit", GetAudit);
|
||||
admin.MapGet("/stats", GetStats).Produces<StatsDto>();
|
||||
admin.MapGet("/audit", GetAudit).Produces<PagedList<AuditLogDto>>();
|
||||
|
||||
return app;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user