add idonly request
This commit is contained in:
@@ -129,4 +129,24 @@ namespace YYApi.Communications
|
||||
/// </summary>
|
||||
public T Data { get; set; }
|
||||
}
|
||||
|
||||
|
||||
//===========》请求《===============
|
||||
|
||||
/// <summary>
|
||||
/// 只有ID的请求
|
||||
/// </summary>
|
||||
public class IdOnlyRequest
|
||||
{
|
||||
public int Id { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 基础分页请求
|
||||
/// </summary>
|
||||
public class BasePageRequest
|
||||
{
|
||||
public int Page { get; set; }
|
||||
public int Count { get; set; }
|
||||
}
|
||||
}
|
||||
+7
-2
@@ -32,7 +32,7 @@ namespace YYApi
|
||||
public static IServiceCollection AddYYApi(this IServiceCollection builder, string title,
|
||||
string description = null)
|
||||
{
|
||||
return builder.AddAuth().AddApiDoc(title, description);
|
||||
return builder.AddAuth().AddApiDoc(title, description).AddCors();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -138,7 +138,12 @@ namespace YYApi
|
||||
public static IApplicationBuilder UseYYApiMiddleware(this IApplicationBuilder builder, string title = "API文档",
|
||||
params SubmitMethod[] submitMethods)
|
||||
{
|
||||
return builder.UseExceptionMiddleware().UseApiDoc(title, submitMethods).UseMiddleware<AuthMiddleware>();
|
||||
return builder.UseExceptionMiddleware().UseApiDoc(title, submitMethods).UseMiddleware<AuthMiddleware>().UseCors(x =>
|
||||
{
|
||||
x.AllowAnyHeader();
|
||||
x.AllowAnyMethod();
|
||||
x.AllowAnyOrigin();
|
||||
}); ;
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<OutputType>Library</OutputType>
|
||||
<PackOnBuild>true</PackOnBuild>
|
||||
<Version>0.2.1</Version>
|
||||
<Version>0.2.3</Version>
|
||||
<Authors>xRain@YYTech</Authors>
|
||||
<Description>AspNetCore一个方便的API文档,捕获异常,统一输入输出的API类库</Description>
|
||||
<PackageId>YY-Tech.YYApi</PackageId>
|
||||
|
||||
Reference in New Issue
Block a user