浏览代码

错误格式返回优化

wangyu 6 年之前
父节点
当前提交
a377486db5
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      diagbotman-service/src/main/java/com/diagbot/facade/LantoneProductFacade.java

+ 3 - 3
diagbotman-service/src/main/java/com/diagbot/facade/LantoneProductFacade.java

@@ -109,7 +109,7 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
         }
         LantoneProduct lantoneProduct = this.getById(updateProductVO.getId());
         if(lantoneProduct.getIsDeleted().equals(IsDeleteEnum.Y.getKey())){
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+            throw new CommonException(CommonErrorCode.NOT_EXISTS,
                     "该产品已删除");
         }
         BeanUtil.copyProperties(updateProductVO, lantoneProduct);
@@ -141,7 +141,7 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
     public Boolean stopProduct(UpdateProductVO updateProductVO) {
         LantoneProduct lantoneProduct = this.getById(updateProductVO.getId());
         if(lantoneProduct.getIsDeleted().equals(IsDeleteEnum.Y.getKey())){
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+            throw new CommonException(CommonErrorCode.NOT_EXISTS,
                     "该产品已删除");
         }
         if(updateProductVO.getServiceStatus() == lantoneProduct.getServiceStatus() && updateProductVO.getServiceStatus() == StatusEnum.Enable.getKey()){
@@ -199,7 +199,7 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
     public Boolean deleteProduct(UpdateProductVO updateProductVO) {
         LantoneProduct lantoneProduct = this.getById(updateProductVO.getId());
         if(lantoneProduct.getIsDeleted().equals(IsDeleteEnum.Y.getKey())){
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+            throw new CommonException(CommonErrorCode.NOT_EXISTS,
                     "该产品已删除");
         }
         if(lantoneProduct.getServiceStatus()==StatusEnum.Enable.getKey()){