Major refactor of AdminController and related services to support full CRUD for candidate resume, projects, hobbies, skills, academics, experiences, certifications, and contact info, all using access token claims for candidate identity. Introduced AdminService and expanded IResumeRepository for granular entity management. Updated DTOs for upsert operations and date support. Improved API versioning (Asp.Versioning.Mvc), Swagger integration, and middleware setup. Added unit test project. Enhanced error handling, documentation, and mapping.
29 lines
802 B
C#
29 lines
802 B
C#
using Asp.Versioning.ApiExplorer;
|
|
using Microsoft.Extensions.Options;
|
|
using Microsoft.OpenApi.Models;
|
|
using Swashbuckle.AspNetCore.SwaggerGen;
|
|
|
|
public class ConfigureSwaggerOptions : IConfigureOptions<SwaggerGenOptions>
|
|
{
|
|
private readonly IApiVersionDescriptionProvider _provider;
|
|
|
|
public ConfigureSwaggerOptions(IApiVersionDescriptionProvider provider)
|
|
{
|
|
_provider = provider;
|
|
}
|
|
|
|
public void Configure(SwaggerGenOptions options)
|
|
{
|
|
foreach (var description in _provider.ApiVersionDescriptions)
|
|
{
|
|
options.SwaggerDoc(
|
|
description.GroupName,
|
|
new OpenApiInfo
|
|
{
|
|
Title = "PortBlog API",
|
|
Version = description.GroupName
|
|
});
|
|
}
|
|
}
|
|
}
|