public static async Task <IActionResult> Run( [HttpTrigger(AuthorizationLevel.Function, "get", Route = null)] HttpRequest req, ILogger logger, [Inject] ILifeLogService lifeLogCrawler, [Inject] IConfigProvider configProvider ) { configProvider.GetConfig(); var lifeLog = await lifeLogCrawler.CrawlAsync(); logger.LogInformation($"Title={lifeLog.Title}, Body={lifeLog.Body}"); return(new OkObjectResult(lifeLog.Body)); }
public async Task PostDiary() { var lifeLog = await lifeLogCrawler.CrawlAsync(); mailSender.Send(sendTo, lifeLog.Title, lifeLog.Body); }