1234567891011121314151617181920212223242526272829303132 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Threading.Tasks;
- namespace LJProxy.LJLib.Net.SPI.Server
- {
- public sealed class ExcutorManager:LJServerBase
- {
- private Dictionary<string, ExcutorBase> excutors = new Dictionary<string, ExcutorBase>();
- private Dictionary<string, string> dynamicHtmlDic = new Dictionary<string, string>();
- public void AddMap(string apiName, Type requestType, ExcutorBase excutor, string dynamicHtml = null)
- {
- excutors[apiName] = excutor;
- this.AddMap(apiName, requestType, excutor.Excute);
- if (!string.IsNullOrEmpty(dynamicHtml))
- {
- dynamicHtmlDic[dynamicHtml] = apiName;
- }
- }
- public string getDynamicHtmlApi(string url)
- {
- if (dynamicHtmlDic.ContainsKey(url))
- {
- return dynamicHtmlDic[url];
- }
- return null;
- }
- }
- }
|