api
This commit is contained in:
1 parent
3a1a0ca7ef
commit
6bce1d9330
9 files changed
+167
-13
No files matched your search
@@ -1,5 +1,6 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Security.Claims;
|
||||
using uWine.Core.Domain.Entities;
|
||||
using uWine.Core.Infrastructure.Services;
|
||||
|
||||
namespace uWine.Api.Controllers
|
||||
@@ -13,8 +14,8 @@ namespace uWine.Api.Controllers
|
||||
private readonly AuthenticationService _authenticationService;
|
||||
private readonly UserService _userService;
|
||||
|
||||
public TestController(IConfiguration configuration,
|
||||
OwnerService ownerService,
|
||||
public TestController(IConfiguration configuration,
|
||||
OwnerService ownerService,
|
||||
AuthenticationService authenticationService,
|
||||
UserService userService)
|
||||
{
|
||||
@@ -25,6 +26,9 @@ namespace uWine.Api.Controllers
|
||||
}
|
||||
|
||||
[HttpGet("cklogin")]
|
||||
[ProducesResponseType(typeof(( int userId, string TUserId, string role, User user)), StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public IActionResult test()
|
||||
{
|
||||
try
|
||||
@@ -37,9 +41,9 @@ namespace uWine.Api.Controllers
|
||||
|
||||
return Ok(new { userId, TUserId, role, user });
|
||||
}
|
||||
catch
|
||||
catch(Exception ex)
|
||||
{
|
||||
return Unauthorized(new { status = 401 });
|
||||
return Unauthorized(new { status = 401, exeptiom = ex });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user