|
@@ -5,12 +5,9 @@ import cn.efunbox.audio.clients.AudioHttp;
|
|
|
import cn.efunbox.audio.clients.UserHttp;
|
|
|
import cn.efunbox.audio.entity.Channel;
|
|
|
import cn.efunbox.audio.entity.Device;
|
|
|
-import cn.efunbox.audio.entity.Grouping;
|
|
|
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.Common;
|
|
|
import cn.efunbox.audio.utils.HttpUtil;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
@@ -18,13 +15,18 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
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;
|
|
|
-import java.lang.reflect.Array;
|
|
|
import java.sql.Timestamp;
|
|
|
-import java.util.*;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.UUID;
|
|
|
|
|
|
|
|
|
* Created by yao on 17-9-26.
|
|
@@ -136,7 +138,7 @@ public class DeviceController {
|
|
|
HttpUtil.responseApiCode(request, response, ApiCode.PARAMETER_ERROR);
|
|
|
return;
|
|
|
}
|
|
|
- if(deviceService.CheckRegister(Long.valueOf(idChannel), Long.valueOf(idDevice))) {
|
|
|
+ if(deviceService.CheckRegister(Long.valueOf(idChannel), idDevice)) {
|
|
|
HttpUtil.responseApiCode(request, response, ApiCode.RECORD_EXIST);
|
|
|
return;
|
|
|
}
|
|
@@ -159,7 +161,7 @@ public class DeviceController {
|
|
|
}
|
|
|
mapRes = JSONObject.parseObject(mapRes.get("data").toString());
|
|
|
|
|
|
- Device device = deviceService.Register(Long.valueOf(idChannel), Long.valueOf(idDevice));
|
|
|
+ Device device = deviceService.Register(Long.valueOf(idChannel), idDevice);
|
|
|
if(device!=null){
|
|
|
|
|
|
device.setIaas_eid(mapRes.get("eid").toString());
|
|
@@ -253,9 +255,9 @@ public class DeviceController {
|
|
|
idChannel = "0";
|
|
|
Page<Device> pageRes = null;
|
|
|
if((start==null || start.length()==0) || (end==null || end.length()==0))
|
|
|
- pageRes = deviceService.Search(Long.valueOf(idChannel), Long.valueOf(idDevice), Integer.valueOf(page), Integer.valueOf(size));
|
|
|
+ pageRes = deviceService.Search(Long.valueOf(idChannel), idDevice, Integer.valueOf(page), Integer.valueOf(size));
|
|
|
else
|
|
|
- pageRes = deviceService.Search(Long.valueOf(idChannel), Long.valueOf(idDevice), Integer.valueOf(page), Integer.valueOf(size), Timestamp.valueOf(start), Timestamp.valueOf(end));
|
|
|
+ pageRes = deviceService.Search(Long.valueOf(idChannel), idDevice, Integer.valueOf(page), Integer.valueOf(size), Timestamp.valueOf(start), Timestamp.valueOf(end));
|
|
|
for(int i=0; i<pageRes.getNumberOfElements(); i++){
|
|
|
System.out.println("i:"+i);
|
|
|
pageRes.getContent().get(i).setTokenNew("");
|