server state cleanup

This commit is contained in:
2020-04-05 21:35:42 +00:00
parent e367b4b132
commit 8443c7c5bf
15 changed files with 116 additions and 101 deletions

View File

@@ -50,10 +50,8 @@ namespace AyaNova.Api.Controllers
[HttpGet("List/{enumkey}")]
public ActionResult GetList([FromRoute]string enumkey)
{
if (!serverState.IsOpen)
{
return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
}
if (serverState.IsClosed)
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
long TranslationId = UserTranslationIdFromContext.Id(HttpContext.Items);
List<string> TranslationKeysToFetch = new List<string>();
@@ -173,9 +171,7 @@ namespace AyaNova.Api.Controllers
public ActionResult GetTypesList()
{
if (!serverState.IsOpen)
{
return StatusCode(503, new ApiErrorResponse(ApiErrorCode.API_CLOSED, null, serverState.Reason));
}
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
List<KeyValuePair<string, string>> ret = new List<KeyValuePair<string, string>>();
ret.Add(new KeyValuePair<string, string>(StringUtil.TrimTypeName(typeof(UserType).ToString()), "AyaNova user account types"));