swagger跳转

This commit is contained in:
橙子
2022-09-25 20:41:55 +08:00
parent f862e5ea1b
commit 6a31e88855
5 changed files with 89 additions and 14 deletions

View File

@@ -16,6 +16,7 @@ using Yi.Framework.Repository;
using Yi.Framework.WebCore;
using Yi.Framework.WebCore.AttributeExtend;
using Yi.Framework.WebCore.AuthorizationPolicy;
using Yi.Framework.WebCore.DbExtend;
namespace Yi.Framework.ApiMicroservice.Controllers
{
@@ -39,6 +40,17 @@ namespace Yi.Framework.ApiMicroservice.Controllers
_quartzInvoker = quartzInvoker;
}
/// <summary>
/// swagger跳转
/// </summary>
/// <returns></returns>
[HttpGet]
[Route("/")]
public IActionResult Swagger()
{
return Redirect("/Swagger");
}
/// <summary>
/// 仓储上下文对象测试
/// </summary>
@@ -198,6 +210,10 @@ namespace Yi.Framework.ApiMicroservice.Controllers
return Result.Success().SetData(treeData);
}
/// <summary>
/// 授权测试
/// </summary>
/// <returns></returns>
[Authorize]
[HttpGet]
public Result AuthorizeTest()
@@ -205,6 +221,10 @@ namespace Yi.Framework.ApiMicroservice.Controllers
return Result.Success();
}
/// <summary>
/// 清空数据库
/// </summary>
/// <returns></returns>
[HttpGet]
public async Task<Result> ClearDb()
{
@@ -224,5 +244,17 @@ namespace Yi.Framework.ApiMicroservice.Controllers
}));
}
/// <summary>
/// 种子数据
/// </summary>
/// <returns></returns>
[HttpGet]
public Result SeedDb()
{
var rep = _iUserService._repository;
return Result.Success().SetStatus(DbSeedExtend.Invoer(rep._Db));
}
}
}