-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTrelloReportingApi.cs
46 lines (39 loc) · 1.46 KB
/
TrelloReportingApi.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
using esdc_sa_appdev_reporting_api.Services;
namespace esdc_sa_appdev_reporting_api
{
public static class TrelloReportingApi
{
[FunctionName("getGeneralReportResults")]
public static async Task<IActionResult> GetGeneralReportResults
(
[HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req,
ILogger log
)
{
var service = new TrelloService();
var results = await service.GetGeneralReportResults();
return results != null
? (ActionResult) new OkObjectResult(results)
: new BadRequestObjectResult("No results retrieved...");
}
[FunctionName("getSummaryReportResults")]
public static async Task<IActionResult> GetSummaryReportResults
(
[HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req,
ILogger log
)
{
var service = new TrelloService();
var results = await service.GetSummaryReportResults();
return results != null
? (ActionResult) new OkObjectResult(results)
: new BadRequestObjectResult("No results retrieved...");
}
}
}