using FastEndpoints; using FrameworkBLL.WebServiceParameter; using GB5Shared.DTO.Framework.Login; using GB5Shared.DTO.Framework.ResponseStandard; using GB5Shared.FastEndPoint; using static FrameworkDAL.Constant.Constant; namespace FrameworkSL.Endpoints.WebServiceParameter { public class DeleteWebServiceParameter : BaseEndpoint> { public readonly IWebServiceParameterBLL _WebServiceParameterBLL; public DeleteWebServiceParameter(IWebServiceParameterBLL IWebServiceParameterBLL) { _WebServiceParameterBLL = IWebServiceParameterBLL; } public override void Configure() { Delete("/WebServiceParameter/DeleteWebServiceParameter"); AllowAnonymous(); } public record DeleteWebServiceParameterParameters( [property: FromHeader] string Login, [property: QueryParam] int WebServiceParameterId ); protected override async Task> ExecuteAsync(DeleteWebServiceParameterParameters req, LoginDTO LoginDTO, CancellationToken ct) { try { var Result = await _WebServiceParameterBLL.DeleteWebServiceParameter(req.WebServiceParameterId, LoginDTO!); return await GB5Shared.ResponseStandard.Response.CreateSuccessResponse(Result, CacheKeyLevel.UserLevel, LoginDTO); } catch (Exception ex) { return await GB5Shared.ResponseStandard.Response.CreateExceptionError(ex, CacheKeyLevel.UserLevel, LoginDTO, ex.Message, 500); } } } }