From c976fedb4d58a23aff930188d4031adac54a3037 Mon Sep 17 00:00:00 2001 From: fengxiang <110431245@qq.com> Date: Thu, 10 May 2018 17:18:37 +0800 Subject: [PATCH] 获取报警 阀值 --- src/main/java/com/moral/controller/MobileController.java | 21 ++++++++++++++++----- 1 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/moral/controller/MobileController.java b/src/main/java/com/moral/controller/MobileController.java index 1e290e6..5ce114d 100644 --- a/src/main/java/com/moral/controller/MobileController.java +++ b/src/main/java/com/moral/controller/MobileController.java @@ -74,7 +74,14 @@ OperateUser operateUser = operateUserService.updatePassword(uid,password,newpassword); return new AppData<OperateUser>(operateUser); } - + /** + * ������ ������id ��������������������� + */ + @RequestMapping("deviceInfo") + public AppData<Device> deviceInfo(Integer id){ + Device device = deviceService.queryById(id); + return new AppData<Device>(device); + } /** * * @param equDeviceAdapter @@ -110,10 +117,14 @@ @RequestMapping("getEquInfoByMac") public AppData<Map> getDeviceByMac(@RequestParam(value="mac", required=true)String mac) { Device device = deviceService.getDeviceByMac(mac,false);//��������������� - Map<String,Object> deviceMap = new HashMap<>(BeanMap.create(device)); - deviceMap.put("monitorpointDetail",deviceMap.get("monitorPoint")); - deviceMap.remove("monitorPoint"); - return new AppData<Map>(deviceMap); + if(device!=null){ + Map<String,Object> deviceMap = new HashMap<>(BeanMap.create(device)); + deviceMap.put("monitorpointDetail",deviceMap.get("monitorPoint")); + deviceMap.remove("monitorPoint"); + return new AppData<Map>(deviceMap); + }else{ + return new AppData("mac���������������",AppData.FAIL); + } } /** -- Gitblit v1.8.0