This commit is contained in:
2020-05-16 21:41:27 +00:00
parent 26fc7ed0e6
commit 933b5ce459
4 changed files with 55 additions and 51 deletions

View File

@@ -98,18 +98,18 @@ namespace AyaNova.Api.Controllers
if (string.IsNullOrWhiteSpace(tag))
return BadRequest(new ApiErrorResponse(ApiErrorCode.VALIDATION_REQUIRED, "tag"));
var JobName = $"BulkAdd tag \"{tag}\" on {ayaType} ({idList.Count} specified)";
var JobName = $"Bulk operation: Add tag \"{tag}\" on {ayaType} ({idList.Count} specified)";
JObject o = JObject.FromObject(new
{
ayaType = ayaType,
idList = idList,
op = "bulk-add",
op = "add-tag",
tag = tag
});
OpsJob j = new OpsJob();
j.Name = JobName;
j.JobType = JobType.BulkTag;
j.ObjectType = ayaType;
j.JobType = JobType.BulkCoreBizObjectOperation;
j.Exclusive = false;
j.JobInfo = o.ToString();
await JobsBiz.AddJobAsync(j, ct);
@@ -139,17 +139,17 @@ namespace AyaNova.Api.Controllers
if (string.IsNullOrWhiteSpace(tag))
return BadRequest(new ApiErrorResponse(ApiErrorCode.VALIDATION_REQUIRED, "tag"));
var JobName = $"BulkAdd tag \"{tag}\" on any {ayaType}";
var JobName = $"Bulk operation: Add tag \"{tag}\" on any {ayaType}";
JObject o = JObject.FromObject(new
{
ayaType = ayaType,
op = "bulk-add-any",
op = "add-any-tag",
tag = tag
});
OpsJob j = new OpsJob();
j.Name = JobName;
j.JobType = JobType.BulkTag;
j.ObjectType = ayaType;
j.JobType = JobType.BulkCoreBizObjectOperation;
j.Exclusive = false;
j.JobInfo = o.ToString();
await JobsBiz.AddJobAsync(j, ct);
@@ -181,18 +181,18 @@ namespace AyaNova.Api.Controllers
if (string.IsNullOrWhiteSpace(tag))
return BadRequest(new ApiErrorResponse(ApiErrorCode.VALIDATION_REQUIRED, "tag"));
var JobName = $"BulkRemove tag \"{tag}\" from {ayaType} ({idList.Count} specified)";
var JobName = $"Bulk operation: Remove tag \"{tag}\" from {ayaType} ({idList.Count} specified)";
JObject o = JObject.FromObject(new
{
ayaType = ayaType,
idList = idList,
op = "bulk-remove",
op = "remove-tag",
tag = tag
});
OpsJob j = new OpsJob();
j.Name = JobName;
j.JobType = JobType.BulkTag;
j.ObjectType = ayaType;
j.JobType = JobType.BulkCoreBizObjectOperation;
j.Exclusive = false;
j.JobInfo = o.ToString();
await JobsBiz.AddJobAsync(j, ct);
@@ -223,17 +223,17 @@ namespace AyaNova.Api.Controllers
if (string.IsNullOrWhiteSpace(tag))
return BadRequest(new ApiErrorResponse(ApiErrorCode.VALIDATION_REQUIRED, "tag"));
var JobName = $"BulkRemove tag \"{tag}\" from any {ayaType}";
var JobName = $"Bulk operation: Remove tag \"{tag}\" from any {ayaType}";
JObject o = JObject.FromObject(new
{
ayaType = ayaType,
op = "bulk-remove-any",
op = "remove-any-tag",
tag = tag
});
OpsJob j = new OpsJob();
j.Name = JobName;
j.JobType = JobType.BulkTag;
j.ObjectType = ayaType;
j.JobType = JobType.BulkCoreBizObjectOperation;
j.Exclusive = false;
j.JobInfo = o.ToString();
await JobsBiz.AddJobAsync(j, ct);
@@ -269,19 +269,19 @@ namespace AyaNova.Api.Controllers
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)";
var JobName = $"Bulk operation: Replace tag \"{fromTag}\" with tag \"{toTag}\" on {ayaType} ({idList.Count} specified)";
JObject o = JObject.FromObject(new
{
ayaType = ayaType,
idList = idList,
op = "bulk-replace",
op = "replace-tag",
fromTag = fromTag,
toTag = toTag
});
OpsJob j = new OpsJob();
j.ObjectType = ayaType;
j.Name = JobName;
j.JobType = JobType.BulkTag;
j.JobType = JobType.BulkCoreBizObjectOperation;
j.Exclusive = false;
j.JobInfo = o.ToString();
await JobsBiz.AddJobAsync(j, ct);
@@ -316,18 +316,18 @@ namespace AyaNova.Api.Controllers
if (string.IsNullOrWhiteSpace(toTag))
return BadRequest(new ApiErrorResponse(ApiErrorCode.VALIDATION_REQUIRED, "toTag"));
var JobName = $"BulkReplace tag \"{fromTag}\" with tag \"{toTag}\" on any {ayaType}";
var JobName = $"Bulk operation: Replace tag \"{fromTag}\" with tag \"{toTag}\" on any {ayaType}";
JObject o = JObject.FromObject(new
{
ayaType = ayaType,
op = "bulk-replace-any",
op = "replace-any-tag",
fromTag = fromTag,
toTag = toTag
});
OpsJob j = new OpsJob();
j.Name = JobName;
j.JobType = JobType.BulkTag;
j.ObjectType = ayaType;
j.JobType = JobType.BulkCoreBizObjectOperation;
j.Exclusive = false;
j.JobInfo = o.ToString();
await JobsBiz.AddJobAsync(j, ct);