feat: 动态API支持直接执行已有的应用逻辑

This commit is contained in:
wintel
2025-03-30 18:01:22 +08:00
parent d42be4d7c9
commit dfbb150f9b
4 changed files with 106 additions and 25 deletions

View File

@@ -73,5 +73,15 @@ namespace OpenAuth.App.Test
var obj = await app.Delete(new DelDynamicReq() { TableName = "noentity", Ids = new string[] { "10" } });
Console.WriteLine(JsonHelper.Instance.Serialize(obj));
}
[Test]
public void TestInvoke()
{
var app = _autofacServiceProvider.GetService<DynamicApiApp>();
var obj = app.Invoke(new InvokeDynamicReq { ServiceName = "UserManagerApp", MethodName = "GetParent",
Parameters = new { userid = "0ceff0f8-f848-440c-bc26-d8605ac858cd" } });
Console.WriteLine(JsonHelper.Instance.Serialize(obj));
}
}
}