Created
September 26, 2019 02:23
-
-
Save runceel/5b6d3a78ac9e3a2bb7cbfb5467b9dc49 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace TechSummit2018.ServerlessSmartSpeaker | |
{ | |
public class SmartSpeakerEndpoints | |
{ | |
private IAssistant Assistant { get; } | |
private IPlatformService PlatformService { get; } | |
public SmartSpeakerEndpoints(IAssistant assistant, IPlatformService platformService) | |
{ | |
Assistant = assistant; | |
PlatformService = platformService; | |
} | |
[FunctionName("xplatvui")] | |
public async Task<IActionResult> Line( | |
[HttpTrigger(AuthorizationLevel.Function, "post")] HttpRequest req, ILogger log) | |
{ | |
var platform = await PlatformService.DetectPlatformAsync(req); | |
var response = await Assistant.RespondAsync(req, platform); | |
return new OkObjectResult(platform.ToPlatformResponse(response, platform)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment