Skip to content
This repository was archived by the owner on Jun 30, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public async Task<DialogTurnResult> RouteToFindPointOfInterestBeforeRouteDialog(

if (cards.Count() == 0)
{
var replyMessage = ResponseManager.GetResponse(POISharedResponses.NoLocationsFound);
var replyMessage = ResponseManager.GetResponse(POISharedResponses.NoRouteFound);
await sc.Context.SendActivityAsync(replyMessage);
}
else if (cards.Count() == 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class POISharedResponses : IResponseIdCollection
public const string NoLocationsFound = "NoLocationsFound";
public const string MultipleRoutesFound = "MultipleRoutesFound";
public const string SingleRouteFound = "SingleRouteFound";
public const string NoRouteFound = "NoRouteFound";
public const string PointOfInterestSelection = "PointOfInterestSelection";
public const string CurrentLocationMultipleSelection = "CurrentLocationMultipleSelection";
public const string CurrentLocationSingleSelection = "CurrentLocationSingleSelection";
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,15 @@
],
"inputHint": "expectingInput"
},
"NoRouteFound": {
"replies": [
{
"text": "Sorry, I didn't find any route.",
"speak": "Sorry, I didn't find any route."
}
],
"inputHint": "acceptingInput"
},
"PointOfInterestSelection": {
"replies": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,15 @@
],
"inputHint": "expectingInput"
},
"NoRouteFound": {
"inputHint": "acceptingInput",
"replies": [
{
"text": "对不起,我找不到任何路线。",
"speak": "对不起,我找不到任何路线。"
}
]
},
"CurrentLocationSingleSelection": {
"replies": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,16 @@ void AddPoint(double longitude, double latitude)
/// <returns>RouteDirections.</returns>
private async Task<RouteDirections> GetRouteDirectionsAsync(string url)
{
var response = await httpClient.GetStringAsync(url);
var response = await httpClient.GetAsync(url);

var apiResponse = new RouteDirections();

var apiResponse = JsonConvert.DeserializeObject<RouteDirections>(response);
// TODO when it returns 400 for uncovered areas, we return no route instead. For other unsuccessful codes, exception is thrown as usual
if (response.StatusCode != System.Net.HttpStatusCode.BadRequest)
{
response = response.EnsureSuccessStatusCode();
apiResponse = JsonConvert.DeserializeObject<RouteDirections>(await response.Content.ReadAsStringAsync());
}

apiResponse.Provider = PointOfInterestModel.AzureMaps;

Expand Down