using AMPBLL.API; using FastEndpoints; using GB5Shared.DTO.Framework.Login; using GB5Shared.DTO.Framework.ResponseStandard; using GB5Shared.FastEndPoint; using static GB5Shared.GB5Constant.Constant; namespace AMPSL.Endpoints.API { public class DeleteAPI : BaseEndpoint> { public readonly IAPIBLL _APIBLL; public DeleteAPI(IAPIBLL IAPIBLL) { _APIBLL = IAPIBLL; } public override void Configure() { Delete("/API/DeleteAPI"); AllowAnonymous(); } public record DeleteAPIParameters( [property: FromHeader] string Login, [property: QueryParam] int APIId ); protected override async Task> ExecuteAsync(DeleteAPIParameters req, LoginDTO LoginDTO, CancellationToken ct) { var Result = await _APIBLL.DeleteById(req.APIId, LoginDTO!, ct); return await GB5Shared.ResponseStandard.Response.CreateSuccessResponse(Result, CacheKeyLevel.NOT_REQUIRED, LoginDTO); } } }