public async Task <ActionResult <DosCheckCapacitySummaryResponse> > CheckCapacitySummary([FromBody] DosCheckCapacitySummaryRequest dosRequest, [FromQuery] string endpoint = "") { var client = _pathWayServiceFactory.Create(endpoint); var checkCapacitysummaryRequest = _mapper.Map <CheckCapacitySummaryRequest>(dosRequest); var checkCapacitySummaryResponse = await client.CheckCapacitySummaryAsync(checkCapacitysummaryRequest); return(_mapper.Map <DosCheckCapacitySummaryResponse>(checkCapacitySummaryResponse)); }
public async Task <CheckCapacitySummaryResponse> CheckCapacitySummary(HttpRequestMessage request) { var jsonString = await request.Content.ReadAsStringAsync(); var checkCapacitySummaryRequest = JsonConvert.DeserializeObject <CheckCapacitySummaryRequest>(jsonString); var client = _pathWayServiceFactory.Create(request); return(await client.CheckCapacitySummaryAsync(checkCapacitySummaryRequest)); }
public async Task <bool> Health() { try { var jsonString = new StringBuilder("{\"serviceVersion\":\"1.4\",\"userInfo\":{\"username\":\"" + DosUser + "\",\"password\":\"" + DosPassword + "\"},") .Append("\"c\":{\"caseRef\":\"123\",\"caseId\":\"123\",\"postcode\":\"EC1A 4JQ\",\"surgery\":\"") .Append("A83046\",\"age\":35,") .Append("\"ageFormat\":0,\"disposition\":1002") .Append(",\"symptomGroup\":1110,\"symptomDiscriminatorList\":[4052],") .Append("\"searchDistanceSpecified\":false,\"gender\":\"M\"}}").ToString(); var checkCapacitySummaryRequest = JsonConvert.DeserializeObject <CheckCapacitySummaryRequest>(jsonString); var client = _pathWayServiceFactory.Create(_configuration.GetSection("dos_endpoint").Value); var result = await client.CheckCapacitySummaryAsync(checkCapacitySummaryRequest); return(result != null && result.CheckCapacitySummaryResult.Any()); } catch (Exception ex) { return(false); } }