重写了Web Api的逻辑,用Emit构造委托加速API处理

This commit is contained in:
fengjiayi
2024-10-10 16:49:37 +08:00
parent d1b9a3f28f
commit 99f82d5772
25 changed files with 792 additions and 628 deletions

View File

@@ -51,7 +51,7 @@ namespace Serein.Library.Web
[AttributeUsage(AttributeTargets.Method)]
public class WebApiAttribute : Attribute
{
public API Http; // HTTP 请求类型
public ApiType ApiType; // HTTP 请求类型
public string Url; // URL 路径
/// <summary>
/// 方法名称不作为url的部分
@@ -68,15 +68,15 @@ namespace Serein.Library.Web
/// </summary>
/// <param name="http"></param>
/// <param name="url"></param>
public WebApiAttribute(API http = API.POST, bool isUrl = true, string url = "")
public WebApiAttribute(ApiType http = ApiType.POST, bool isUrl = true, string url = "")
{
Http = http;
ApiType = http;
Url = url;
IsUrl = isUrl;
}
}
public enum API
public enum ApiType
{
POST,
GET,