-
Notifications
You must be signed in to change notification settings - Fork 0
/
LoadLocationsFromJSON.cs
36 lines (32 loc) · 1.55 KB
/
LoadLocationsFromJSON.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
using System;
using System.IO;
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 Newtonsoft.Json;
using AmblOn.State.API.Users.Models;
using Fathym;using Microsoft.Azure.WebJobs.Extensions.SignalRService;using AmblOn.State.API.Users.State;using Microsoft.WindowsAzure.Storage.Blob;using LCU.StateAPI.Utilities;
namespace AmblOn.State.API.Users
{
public class LoadLocationsFromJSON
{
[Disable]
[FunctionName("LoadLocationsFromJSON")]
public virtual async Task<Status> Run([HttpTrigger(AuthorizationLevel.Admin)] HttpRequest req, ILogger log,
[SignalR(HubName = UsersState.HUB_NAME)]IAsyncCollector<SignalRMessage> signalRMessages,
[Blob("state-api/{headers.lcu-ent-api-key}/{headers.lcu-hub-name}/{headers.x-ms-client-principal-id}/{headers.lcu-state-key}", FileAccess.ReadWrite)] CloudBlockBlob stateBlob)
{
return await stateBlob.WithStateHarness<UsersState, RemoveSelectedLayerRequest, UsersStateHarness>(req, signalRMessages, log,
async (harness, reqData, actReq) =>
{
log.LogInformation($"LoadLocationsFromJSON");
var stateDetails = StateUtils.LoadStateDetails(req);
//await harness.LoadCuratedLocationsIntoDB("[email protected]", json, new Guid("4704a25b-049b-49a9-90b0-2551b40045c3"));
return Status.Success;
});
}
}
}