|
@@ -10,7 +10,6 @@ using System.Linq;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Runtime.CompilerServices;
|
|
|
|
|
|
using Vit.Core.Module.Log;
|
|
using Vit.Core.Module.Log;
|
|
-using Vit.Core.Util.ConfigurationManager;
|
|
|
|
|
|
|
|
namespace Sers.Core.Module.Api.LocalApi.Event
|
|
namespace Sers.Core.Module.Api.LocalApi.Event
|
|
{
|
|
{
|
|
@@ -20,27 +19,26 @@ namespace Sers.Core.Module.Api.LocalApi.Event
|
|
public class LocalApiEventMng
|
|
public class LocalApiEventMng
|
|
{
|
|
{
|
|
|
|
|
|
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
|
|
- public LocalApiEventMng()
|
|
|
|
|
|
+ public void Init(JToken config)
|
|
{
|
|
{
|
|
|
|
+ if (config == null) return;
|
|
|
|
+
|
|
#region (x.1)构建 Api Event OnCreateScope
|
|
#region (x.1)构建 Api Event OnCreateScope
|
|
{
|
|
{
|
|
- var apiScopeEvents = Sers.Core.Module.Api.ApiEvent.EventBuilder.LoadEvent_OnCreateScope(ConfigurationManager.Instance.GetByPath<JArray>("Sers.LocalApiService.OnCreateScope"));
|
|
|
|
-
|
|
|
|
|
|
+ var apiScopeEvents = Sers.Core.Module.Api.ApiEvent.EventBuilder.LoadEvent_OnCreateScope(config["OnCreateScope"] as JArray);
|
|
AddEvent_ApiScope(apiScopeEvents.ToArray());
|
|
AddEvent_ApiScope(apiScopeEvents.ToArray());
|
|
}
|
|
}
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
#region (x.2)构建 Api Event BeforeCallApi
|
|
#region (x.2)构建 Api Event BeforeCallApi
|
|
{
|
|
{
|
|
- var beforeCallApi = Sers.Core.Module.Api.ApiEvent.EventBuilder.LoadEvent_BeforeCallApi(ConfigurationManager.Instance.GetByPath<JArray>("Sers.LocalApiService.BeforeCallApi"));
|
|
|
|
|
|
+ var beforeCallApi = Sers.Core.Module.Api.ApiEvent.EventBuilder.LoadEvent_BeforeCallApi(config["BeforeCallApi"] as JArray);
|
|
if (beforeCallApi != null) BeforeCallApi += beforeCallApi;
|
|
if (beforeCallApi != null) BeforeCallApi += beforeCallApi;
|
|
}
|
|
}
|
|
#endregion
|
|
#endregion
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
#region OnCreateScope
|
|
#region OnCreateScope
|
|
internal List<IApiScopeEvent> apiScopeEventList = null;
|
|
internal List<IApiScopeEvent> apiScopeEventList = null;
|
|
|
|
|