public IActionResult Post([FromBody] AuditRequest auditRequest) { _log4net.Info(" Http POST request from " + nameof(ProjectExecutionStatusController)); if (auditRequest.AuditDetails.Type == null) { return(BadRequest("Invalid Request Object")); } if (auditRequest.AuditDetails.Type != "Internal" && auditRequest.AuditDetails.Type != "SOX") { return(BadRequest("Invalid Audit Type")); } try { string token = HttpContext.Request.Headers["Authorization"].Single().Split(" ")[1]; AuditResponse auditResponse = _service.GetProjectExecutionStatusData(auditRequest, token); return(Ok(auditResponse)); } catch (Exception e) { _log4net.Error("Exception Occured " + e.Message + " from " + nameof(ProjectExecutionStatusController)); return(StatusCode(500)); } }
public IActionResult GetAuditResponse([FromBody] AuditRequest auditRequest) { _log4net.Info("Entered into the Post Method named as " + nameof(GetAuditResponse) + " of " + nameof(ProjectExecutionStatusController)); if (auditRequest == null || auditRequest.AuditDetails.Type == null || (auditRequest.AuditDetails.Type != "Internal" && auditRequest.AuditDetails.Type != "SOX")) { return(BadRequest("Invalid Audit Request")); } try { //string token = HttpContext.Request.Headers["Authorization"].Single().Split(" ")[1]; AuditResponse auditResponse = _service.GetProjectExecutionStatusData(auditRequest /*, token*/); if (auditResponse == null) { return(StatusCode(500)); } return(Ok(auditResponse)); } catch (Exception e) { _log4net.Error("Exception Occured at " + nameof(ProjectExecutionStatusController) + " - " + nameof(GetAuditResponse) + " : " + e.Message); return(StatusCode(500)); } }