45 lines
1.0 KiB
C#
45 lines
1.0 KiB
C#
using Infrastructure;
|
|
using Infrastructure.Cache;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using OpenAuth.App.ServiceApp;
|
|
|
|
namespace OpenAuth.WebApi.Controllers.ServiceControllers
|
|
{
|
|
/// <summary>
|
|
/// 对接
|
|
/// </summary>
|
|
[Route("api/[controller]/[action]")]
|
|
[ApiController]
|
|
public class TestController: ControllerBase
|
|
{
|
|
private readonly TestApp _app;
|
|
public TestController(TestApp app)
|
|
{
|
|
_app = app;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 测试接口
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[AllowAnonymous]
|
|
public async Task<Response<string>> RegistService()
|
|
{
|
|
var result = new Response<string>();
|
|
try
|
|
{
|
|
result = await _app.RegistService();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
result.Code = 500;
|
|
result.Message = ex.Message;
|
|
}
|
|
|
|
return result;
|
|
}
|
|
}
|
|
}
|