Browse Source

update stauts and QueueService

pull/1/MERGE
ligang 6 years ago
parent
commit
68d0c974a7
  1. 4
      escheduler-api/src/main/java/cn/escheduler/api/enums/Status.java
  2. 32
      escheduler-api/src/main/java/cn/escheduler/api/service/QueueService.java

4
escheduler-api/src/main/java/cn/escheduler/api/enums/Status.java

@ -151,10 +151,10 @@ public enum Status {
SCHEDULE_CRON_REALEASE_NEED_NOT_CHANGE(10126, "schedule release is already {0}"), SCHEDULE_CRON_REALEASE_NEED_NOT_CHANGE(10126, "schedule release is already {0}"),
CREATE_QUEUE_ERROR(10127, "create queue error"), CREATE_QUEUE_ERROR(10127, "create queue error"),
QUEUE_NOT_EXIST(10128, "queue {0} not exists"), QUEUE_NOT_EXIST(10128, "queue {0} not exists"),
QUEUE_EXIST(10129, "queue {0} already exists"), QUEUE_VALUE_EXIST(10129, "queue value {0} already exists"),
QUEUE_NAME_EXIST(10130, "queue name {0} already exists"), QUEUE_NAME_EXIST(10130, "queue name {0} already exists"),
UPDATE_QUEUE_ERROR(10131, "update queue error"), UPDATE_QUEUE_ERROR(10131, "update queue error"),
NEED_NOT_UPDATE_QUEUE(10132, "need not update queue"), NEED_NOT_UPDATE_QUEUE(10132, "no content changes, no updates are required"),
VERIFY_QUEUE_ERROR(10133,"verify queue error"), VERIFY_QUEUE_ERROR(10133,"verify queue error"),

32
escheduler-api/src/main/java/cn/escheduler/api/service/QueueService.java

@ -117,13 +117,13 @@ public class QueueService extends BaseService {
return result; return result;
} }
if (checkQueueExist(queue)) { if (checkQueueNameExist(queueName)) {
putMsg(result, Status.QUEUE_EXIST, queue); putMsg(result, Status.QUEUE_NAME_EXIST, queueName);
return result; return result;
} }
if (checkQueueNameExist(queueName)) { if (checkQueueExist(queue)) {
putMsg(result, Status.QUEUE_NAME_EXIST, queueName); putMsg(result, Status.QUEUE_VALUE_EXIST, queue);
return result; return result;
} }
@ -162,24 +162,24 @@ public class QueueService extends BaseService {
return result; return result;
} }
// whether queue and queueName is changed // whether queue value or queueName is changed
if (queue.equals(queueObj.getQueue()) && queueName.equals(queueObj.getQueueName())) { if (queue.equals(queueObj.getQueue()) && queueName.equals(queueObj.getQueueName())) {
putMsg(result, Status.NEED_NOT_UPDATE_QUEUE); putMsg(result, Status.NEED_NOT_UPDATE_QUEUE);
return result; return result;
} }
// check queue is exist // check queue name is exist
if (!queue.equals(queueObj.getQueue())) { if (!queueName.equals(queueObj.getQueueName())) {
if(checkQueueExist(queue)){ if(checkQueueNameExist(queueName)){
putMsg(result, Status.QUEUE_EXIST, queue); putMsg(result, Status.QUEUE_NAME_EXIST, queueName);
return result; return result;
} }
} }
// check queueName is exist // check queue value is exist
if (!queueName.equals(queueObj.getQueueName())) { if (!queue.equals(queueObj.getQueue())) {
if(checkQueueNameExist(queueName)){ if(checkQueueExist(queue)){
putMsg(result, Status.QUEUE_NAME_EXIST, queueName); putMsg(result, Status.QUEUE_VALUE_EXIST, queue);
return result; return result;
} }
} }
@ -216,13 +216,13 @@ public class QueueService extends BaseService {
return result; return result;
} }
if(checkQueueExist(queue)){ if(checkQueueExist(queue)){
logger.error("queue {} has exist, can't create again.", queue); logger.error("queue value {} has exist, can't create again.", queue);
putMsg(result, Status.QUEUE_EXIST, queue); putMsg(result, Status.QUEUE_VALUE_EXIST, queue);
return result; return result;
} }
if(checkQueueNameExist(queueName)){ if(checkQueueNameExist(queueName)){
logger.error("queueName {} has exist, can't create again.", queueName); logger.error("queue name {} has exist, can't create again.", queueName);
putMsg(result, Status.QUEUE_NAME_EXIST, queueName); putMsg(result, Status.QUEUE_NAME_EXIST, queueName);
return result; return result;
} }

Loading…
Cancel
Save