赖素文
authored
|
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
|
using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using UEditorNetCore.Handlers;
using Microsoft.AspNetCore.Hosting;
namespace UEditorNetCore
{
public class UEditorService
{
private UEditorActionCollection actionList;
public UEditorService(IHostingEnvironment env, UEditorActionCollection actions)
{
Config.WebRootPath = env.WebRootPath;
actionList = actions;
}
public void DoAction(HttpContext context)
{
var action = context.Request.Query["action"];
if (actionList.ContainsKey(action))
actionList[action].Invoke(context);
else
new NotSupportedHandler(context).Process();
}
}
}
|