reorg tag stuff

This commit is contained in:
2020-05-16 19:55:43 +00:00
parent 69be6961ec
commit ba07b03893
23 changed files with 562 additions and 398 deletions

View File

@@ -53,7 +53,7 @@ namespace AyaNova.Api.Controllers
{
if (serverState.IsClosed)
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
return Ok(ApiOkResponse.Response(await TagUtil.TagListFilteredAsync(ct, query), true));
return Ok(ApiOkResponse.Response(await TagBiz.TagListFilteredAsync(ct, query), true));
}
/// <summary>
@@ -66,7 +66,7 @@ namespace AyaNova.Api.Controllers
{
if (serverState.IsClosed)
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
return Ok(ApiOkResponse.Response(await TagUtil.CloudListFilteredAsync(ct, query), true));
return Ok(ApiOkResponse.Response(await TagBiz.CloudListFilteredAsync(ct, query), true));
}
@@ -94,7 +94,7 @@ namespace AyaNova.Api.Controllers
return StatusCode(403, new ApiNotAuthorizedResponse());
if (idList.Count == 0)
return BadRequest(new ApiErrorResponse(ApiErrorCode.VALIDATION_REQUIRED, "List of ids"));
tag = TagUtil.NormalizeTag(tag);
tag = TagBiz.NormalizeTag(tag);
if (string.IsNullOrWhiteSpace(tag))
return BadRequest(new ApiErrorResponse(ApiErrorCode.VALIDATION_REQUIRED, "tag"));
@@ -135,7 +135,7 @@ namespace AyaNova.Api.Controllers
if (!Authorized.HasModifyRole(HttpContext.Items, ayaType))
return StatusCode(403, new ApiNotAuthorizedResponse());
tag = TagUtil.NormalizeTag(tag);
tag = TagBiz.NormalizeTag(tag);
if (string.IsNullOrWhiteSpace(tag))
return BadRequest(new ApiErrorResponse(ApiErrorCode.VALIDATION_REQUIRED, "tag"));
@@ -177,7 +177,7 @@ namespace AyaNova.Api.Controllers
return StatusCode(403, new ApiNotAuthorizedResponse());
if (idList.Count == 0)
return BadRequest(new ApiErrorResponse(ApiErrorCode.VALIDATION_REQUIRED, "List of ids"));
tag = TagUtil.NormalizeTag(tag);
tag = TagBiz.NormalizeTag(tag);
if (string.IsNullOrWhiteSpace(tag))
return BadRequest(new ApiErrorResponse(ApiErrorCode.VALIDATION_REQUIRED, "tag"));
@@ -219,7 +219,7 @@ namespace AyaNova.Api.Controllers
if (!Authorized.HasModifyRole(HttpContext.Items, ayaType))
return StatusCode(403, new ApiNotAuthorizedResponse());
tag = TagUtil.NormalizeTag(tag);
tag = TagBiz.NormalizeTag(tag);
if (string.IsNullOrWhiteSpace(tag))
return BadRequest(new ApiErrorResponse(ApiErrorCode.VALIDATION_REQUIRED, "tag"));
@@ -263,10 +263,10 @@ namespace AyaNova.Api.Controllers
return StatusCode(403, new ApiNotAuthorizedResponse());
if (idList.Count == 0)
return BadRequest(new ApiErrorResponse(ApiErrorCode.VALIDATION_REQUIRED, "List of ids"));
fromTag = TagUtil.NormalizeTag(fromTag);
fromTag = TagBiz.NormalizeTag(fromTag);
if (string.IsNullOrWhiteSpace(fromTag))
return BadRequest(new ApiErrorResponse(ApiErrorCode.VALIDATION_REQUIRED, "fromTag"));
toTag = TagUtil.NormalizeTag(toTag);
toTag = TagBiz.NormalizeTag(toTag);
if (string.IsNullOrWhiteSpace(toTag))
return BadRequest(new ApiErrorResponse(ApiErrorCode.VALIDATION_REQUIRED, "toTag"));
var JobName = $"BulkReplace tag \"{fromTag}\" with tag \"{toTag}\" on {ayaType} ({idList.Count} specified)";
@@ -308,11 +308,11 @@ namespace AyaNova.Api.Controllers
if (!Authorized.HasModifyRole(HttpContext.Items, ayaType))
return StatusCode(403, new ApiNotAuthorizedResponse());
fromTag = TagUtil.NormalizeTag(fromTag);
fromTag = TagBiz.NormalizeTag(fromTag);
if (string.IsNullOrWhiteSpace(fromTag))
return BadRequest(new ApiErrorResponse(ApiErrorCode.VALIDATION_REQUIRED, "fromTag"));
toTag = TagUtil.NormalizeTag(toTag);
toTag = TagBiz.NormalizeTag(toTag);
if (string.IsNullOrWhiteSpace(toTag))
return BadRequest(new ApiErrorResponse(ApiErrorCode.VALIDATION_REQUIRED, "toTag"));