This commit is contained in:
@@ -101,10 +101,11 @@ namespace AyaNova.Api.ControllerHelpers
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (_currentState == ServerState.Closed)
|
return _reason;
|
||||||
return $"{ AyaNova.Biz.TranslationBiz.GetDefaultTranslationAsync("ErrorAPI2000").Result}\r\n{_reason}";
|
// if (_currentState == ServerState.Closed)
|
||||||
else //opsonly
|
// return $"{ AyaNova.Biz.TranslationBiz.GetDefaultTranslationAsync("ErrorAPI2000").Result}\r\n{_reason}";
|
||||||
return $"{ AyaNova.Biz.TranslationBiz.GetDefaultTranslationAsync("ErrorAPI2001").Result}\r\n{_reason}";
|
// else //opsonly
|
||||||
|
// return $"{ AyaNova.Biz.TranslationBiz.GetDefaultTranslationAsync("ErrorAPI2001").Result}\r\n{_reason}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ namespace AyaNova.Api.Controllers
|
|||||||
[HttpGet("list")]
|
[HttpGet("list")]
|
||||||
public async Task<IActionResult> GetQueue()
|
public async Task<IActionResult> GetQueue()
|
||||||
{
|
{
|
||||||
if (serverState.IsClosed)
|
if (!serverState.IsOpen)
|
||||||
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
||||||
|
|
||||||
//NOTE: in future if getting list for another user should just duplicate this method but add the parameter for user id
|
//NOTE: in future if getting list for another user should just duplicate this method but add the parameter for user id
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ namespace AyaNova.Api.Controllers
|
|||||||
[HttpGet("info/{ayaType}/{id}")]
|
[HttpGet("info/{ayaType}/{id}")]
|
||||||
public async Task<IActionResult> GetInfo([FromRoute] AyaType ayaType, [FromRoute] long id, [FromQuery] string phrase, [FromQuery] int max = 80)
|
public async Task<IActionResult> GetInfo([FromRoute] AyaType ayaType, [FromRoute] long id, [FromQuery] string phrase, [FromQuery] int max = 80)
|
||||||
{
|
{
|
||||||
if (serverState.IsClosed)
|
if (!serverState.IsOpen)
|
||||||
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
||||||
|
|
||||||
if (!Authorized.HasReadFullRole(HttpContext.Items, ayaType))
|
if (!Authorized.HasReadFullRole(HttpContext.Items, ayaType))
|
||||||
|
|||||||
@@ -270,7 +270,7 @@ namespace AyaNova.Api.Controllers
|
|||||||
[HttpGet("list")]
|
[HttpGet("list")]
|
||||||
public async Task<IActionResult> GetInsideUserList()
|
public async Task<IActionResult> GetInsideUserList()
|
||||||
{
|
{
|
||||||
if (serverState.IsClosed)
|
if (!serverState.IsOpen)
|
||||||
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
||||||
|
|
||||||
if (!Authorized.HasReadFullRole(HttpContext.Items, AyaType.User))
|
if (!Authorized.HasReadFullRole(HttpContext.Items, AyaType.User))
|
||||||
@@ -301,7 +301,7 @@ namespace AyaNova.Api.Controllers
|
|||||||
[HttpGet("outlist")]
|
[HttpGet("outlist")]
|
||||||
public async Task<IActionResult> GetOutsideUserList()
|
public async Task<IActionResult> GetOutsideUserList()
|
||||||
{
|
{
|
||||||
if (serverState.IsClosed)
|
if (!serverState.IsOpen)
|
||||||
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
||||||
|
|
||||||
if (!Authorized.HasReadFullRole(HttpContext.Items, AyaType.Customer))
|
if (!Authorized.HasReadFullRole(HttpContext.Items, AyaType.Customer))
|
||||||
|
|||||||
Reference in New Issue
Block a user