- Add User registration mechanism when adding auth provider id to claims, if no User Id corresponds to the auth provider Id - Swallow unique constraint violation for unique auth provider id on user table, in case of duplicate requests - Add Serilog logging - Add no bookmarks and no tags message when none is found on Bookmark List page
43 lines
1.3 KiB
C#
43 lines
1.3 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
|
using System.Net;
|
|
using YABA.API.Settings;
|
|
|
|
namespace YABA.API.Controllers
|
|
{
|
|
[ApiController]
|
|
[ApiVersion("1")]
|
|
[DevOnly]
|
|
[Route("api/v{version:apiVersion}/[controller]")]
|
|
public class TestController : ControllerBase
|
|
{
|
|
private readonly ILogger<TestController> _logger;
|
|
|
|
public TestController(ILogger<TestController> logger)
|
|
{
|
|
_logger = logger;
|
|
}
|
|
|
|
[HttpGet("TestLog")]
|
|
[ProducesResponseType(typeof(string), (int)HttpStatusCode.OK)]
|
|
[ProducesResponseType((int)HttpStatusCode.NotFound)]
|
|
[ProducesResponseType((int)HttpStatusCode.BadRequest)]
|
|
public IActionResult TestLog()
|
|
{
|
|
var testObject = new { id = 1, name = "Test Message" };
|
|
_logger.LogDebug("Testing debug: {@TestObject}", testObject);
|
|
return Ok(testObject);
|
|
}
|
|
|
|
[HttpGet("TestLogError")]
|
|
[ProducesResponseType(typeof(string), (int)HttpStatusCode.OK)]
|
|
[ProducesResponseType((int)HttpStatusCode.NotFound)]
|
|
[ProducesResponseType((int)HttpStatusCode.BadRequest)]
|
|
public IActionResult TestLogError()
|
|
{
|
|
var testObject = new { id = 1, name = "Test Message" };
|
|
throw new Exception();
|
|
return Ok(testObject);
|
|
}
|
|
}
|
|
}
|