TigerWebApi 是什么?
TigerWebApi 是一个热插拔的API,实现了项目不停止的情况下对项目API进行更新。
https://github.com/DeyiXu/TigerWebApigithub.com
环境
.NET Standard 2.0
ASP.NET Core 2.0
介绍
Tiger.WebApi.Core 是API处理的核心文件
Tiger.WebApi 是基于ASP.NET Core 2.0 引用和配置了Tiger.WebApi.Core
Tiger.WebApi.Client 是使用TigerWebApi的请求封装
Tiger.Test 测试Api和Client使用到的,有使用TigerWebApiClient方法
Tiger.Account 处理和用户相关的业务,引用 Tiger.WebApi.Core 在类当中添加MethodAttribute。继承BaseMetchod类或者实现ITigerMethod方法
使用方法 http://ASP.NET Core
- 引用
�Tiger.WebApi.Core - Startup > ConfigureServices 方法中添加
services.SettingsTigerWebApi();
- Startup > Configure
app.Map("/info", ApiHandler.Info);
app.Map("/rest", ApiHandler.Map);
- 启动项目
- 如?(例子)
Tiger.Account,发布后\bin\Debug\netstandard2.0对文件进行重命名Tiger.Account.dll|.pdb>Item.dll|.pdb(*.deps.json可以删除)。
在WebApi下的Packages中新建任意文件夹可以以Tiger.Account命名,复制刚刚修改好的Item等其他文件到Tiger.Account文件夹中。
WebApi会自动加载,打开浏览器输入http://localhost:5000/info就能看到API信息。
Tiger.Test 项目中有封装好的调用方式
IDictionary<string, string> dic = new Dictionary<string, string>
{
{ "v", "v1" },
{ "k2", "k2" },
{ "k3", "k3" },
{ "k4", "k4" }
};
using (ITigerWebApiClient client = new DefaultTigerWebApiClient("http://localhost:5000/rest", "10000", "qwerasdfzxcv"))
{
var content = client.Execute("tiger.service.account.getname", dic);
Console.WriteLine(content);
}
请求协议


开源协议
TigerWebApi是一种热插拔API技术,可在项目运行中更新API,无需重启。它基于.NETStandard2.0和ASP.NETCore2.0,包括核心处理文件、客户端请求封装和测试方法。通过简单的配置,可实现在不停止项目的情况下更新API。
4727

被折叠的 条评论
为什么被折叠?



