Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
44ed8dfd3c | ||
|
|
a7261fde58 | ||
|
|
453a15b9ad | ||
|
|
5a04f831a7 | ||
|
|
86ec43f676 |
@@ -11,9 +11,9 @@ jobs:
|
|||||||
- name: Setup .NET Core
|
- name: Setup .NET Core
|
||||||
uses: actions/setup-dotnet@v1
|
uses: actions/setup-dotnet@v1
|
||||||
with:
|
with:
|
||||||
dotnet-version: '3.1.0'
|
dotnet-version: '3.1.101'
|
||||||
- name: Build
|
- name: Build
|
||||||
run: dotnet build MonkeyDotNet/Monkey
|
run: dotnet build
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
needs: build
|
needs: build
|
||||||
@@ -24,11 +24,11 @@ jobs:
|
|||||||
- name: Setup .NET Core
|
- name: Setup .NET Core
|
||||||
uses: actions/setup-dotnet@v1
|
uses: actions/setup-dotnet@v1
|
||||||
with:
|
with:
|
||||||
dotnet-version: '3.1.0'
|
dotnet-version: '3.1.101'
|
||||||
- name: Publish
|
- name: Publish
|
||||||
run: |
|
run: |
|
||||||
version=`git describe --tags`
|
version=`git describe --tags`
|
||||||
dotnet pack --configuration release -p:PackageVersion=$version
|
dotnet pack --configuration release -p:PackageVersion=$version
|
||||||
dotnet nuget push bin/release/Monkey.$version.nupkg -k ${APIKEY} -s https://www.nuget.org/api/v2/package
|
dotnet nuget push bin/release/YY-Tech.YYApi.$version.nupkg -k ${APIKEY} -s https://www.nuget.org/api/v2/package
|
||||||
env:
|
env:
|
||||||
APIKEY: ${{ secrets.APPKEY }}
|
APIKEY: ${{ secrets.APPKEY }}
|
||||||
|
|||||||
@@ -129,4 +129,24 @@ namespace YYApi.Communications
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public T Data { get; set; }
|
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,
|
public static IServiceCollection AddYYApi(this IServiceCollection builder, string title,
|
||||||
string description = null)
|
string description = null)
|
||||||
{
|
{
|
||||||
return builder.AddAuth().AddApiDoc(title, description);
|
return builder.AddAuth().AddApiDoc(title, description).AddCors();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -138,7 +138,12 @@ namespace YYApi
|
|||||||
public static IApplicationBuilder UseYYApiMiddleware(this IApplicationBuilder builder, string title = "API文档",
|
public static IApplicationBuilder UseYYApiMiddleware(this IApplicationBuilder builder, string title = "API文档",
|
||||||
params SubmitMethod[] submitMethods)
|
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>
|
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<PackOnBuild>true</PackOnBuild>
|
<PackOnBuild>true</PackOnBuild>
|
||||||
<Version>0.2.1</Version>
|
<Version>0.2.3</Version>
|
||||||
<Authors>xRain@YYTech</Authors>
|
<Authors>xRain@YYTech</Authors>
|
||||||
<Description>AspNetCore一个方便的API文档,捕获异常,统一输入输出的API类库</Description>
|
<Description>AspNetCore一个方便的API文档,捕获异常,统一输入输出的API类库</Description>
|
||||||
<PackageId>YY-Tech.YYApi</PackageId>
|
<PackageId>YY-Tech.YYApi</PackageId>
|
||||||
|
|||||||
Reference in New Issue
Block a user