using FastEndpoints; using FrameworkBLL.Version; using FrameworkDAL.DTO.Version; using GB5Shared.DTO.Framework.Login; using GB5Shared.DTO.Framework.ResponseStandard; using GB5Shared.FastEndPoint; using static GB5Shared.GB5Constant.Constant; namespace FrameworkSL.Endpoints.VersionUrlIdentifer { public class GetVersionUrlIdentifier : BaseEndpoint { private readonly IVersionBLL _versionBLL; public GetVersionUrlIdentifier(IVersionBLL versionBLL) { _versionBLL = versionBLL; } public record GetVersionUrlRequest( [property: QueryParam] string ConnectionName ); public override void Configure() { Get("/VersionUrlIdentifer/GetVersionUrlIdentifier"); AllowAnonymous(); } protected override async Task> ExecuteAsync(GetVersionUrlRequest VersionUrlRequest, LoginDTO LoginDTO, CancellationToken ct) { try { var Result = await _versionBLL.VersionUrlIdentifier(VersionUrlRequest.ConnectionName); return await GB5Shared.ResponseStandard.Response.CreateSuccessResponse(Result, CacheKeyLevel.NOT_REQUIRED, LoginDTO); } catch (Exception ex) { return await GB5Shared.ResponseStandard.Response.CreateExceptionError(ex, CacheKeyLevel.NOT_REQUIRED, LoginDTO, ex.Message, 500); } } } }