xushengqiang 5 лет назад
Родитель
Сommit
3efaa10d91

+ 5 - 3
src/main/java/cn/efunbox/audio/controller/DeviceController.java

@@ -8,7 +8,6 @@ import cn.efunbox.audio.entity.Device;
 import cn.efunbox.audio.service.ChannelService;
 import cn.efunbox.audio.service.DeviceService;
 import cn.efunbox.audio.utils.ApiCode;
-import cn.efunbox.audio.utils.ApiResult;
 import cn.efunbox.audio.utils.Encrypt;
 import cn.efunbox.audio.utils.HttpUtil;
 import com.alibaba.fastjson.JSONArray;
@@ -18,7 +17,10 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.data.domain.Page;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -209,7 +211,7 @@ public class DeviceController {
 
         List<Channel> channelList = channelService.SearchById(Long.valueOf(idChannel));
         if(channelList==null || channelList.size()<1){
-            HttpUtil.responseApiCode(request, response, ApiCode.PARAMETER_ERROR);
+            HttpUtil.responseApiCode(request, response, ApiCode.CHANNEL_NOT_FOUND_ERROR);
             return;
         }
 

+ 3 - 0
src/main/java/cn/efunbox/audio/utils/ApiCode.java

@@ -44,6 +44,9 @@ public class ApiCode extends AbstractApiCode {
     public final static int     _C_FILE_UPLOAD_ERROR= 407;
     public final static ApiCode FILE_UPLOAD_ERROR    = new ApiCode("上传文件失败", _C_FILE_UPLOAD_ERROR);
 
+    public final static int     _C_CHANNEL_NOT_FOUND_ERROR= 407;
+    public final static ApiCode CHANNEL_NOT_FOUND_ERROR    = new ApiCode("渠道编号不存在", _C_CHANNEL_NOT_FOUND_ERROR);
+
     protected ApiCode(String message, int code) {
         super(code, message);
     }