|
@@ -35,15 +35,15 @@ public class DevApiController {
|
|
private PassportService passportService;
|
|
private PassportService passportService;
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 查询空闲设备列表
|
|
|
|
|
|
+ * 我的设备列表
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- @GetMapping("/my/queryFreeDeviceList")
|
|
|
|
- @ApiOperation(tags = {"我的设备"},value = "选择要添加设备列表(查询空闲设备列表)--二期新增")
|
|
|
|
- public Result<List<DeviceVO>> queryFreeDeviceList(@RequestHeader(value = "token") String token){
|
|
|
|
|
|
+ @GetMapping("/my/myDeviceList")
|
|
|
|
+ @ApiOperation(tags = {"我的设备"},value = "我的设备列表 -- 二期新增")
|
|
|
|
+ public Result<List<DeviceVO>> myDeviceList(@RequestHeader(value = "token") String token){
|
|
try {
|
|
try {
|
|
MemberInfoVO current = passportService.checkToken(token);
|
|
MemberInfoVO current = passportService.checkToken(token);
|
|
- List<DeviceVO> datas = pinanbaoDeviceService.queryFreeDeviceList(current.getId());
|
|
|
|
|
|
+ List<DeviceVO> datas = pinanbaoDeviceService.queryDeviceByMemberId(current.getId());
|
|
return Result.success(datas);
|
|
return Result.success(datas);
|
|
}catch (BDException e) {
|
|
}catch (BDException e) {
|
|
return Result.error(e.getMessage());
|
|
return Result.error(e.getMessage());
|
|
@@ -53,29 +53,15 @@ public class DevApiController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 选择空闲设备保存绑定
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- @PostMapping("/my/bindDevice")
|
|
|
|
- @ApiOperation(tags = {"我的设备"},value = "选择空闲设备保存绑定 --二期新增")
|
|
|
|
- public Result<Object> bindDevice(HttpServletRequest request, @RequestHeader("token") String token,
|
|
|
|
- @RequestParam("id") Long id) {
|
|
|
|
- MemberInfoVO current = passportService.checkToken(token);
|
|
|
|
- if (this.pinanbaoDeviceService.bindDevice(current.getId(),id)) {
|
|
|
|
- return Result.success("绑定成功");
|
|
|
|
- } else{
|
|
|
|
- return Result.error("绑定失败");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
|
|
@PostMapping("/my/unBindMyDevice")
|
|
@PostMapping("/my/unBindMyDevice")
|
|
- @ApiOperation(tags = {"我的设备"},value = "移除设备(解除绑定) -- 二期新增")
|
|
|
|
|
|
+ @ApiOperation(tags = {"我的设备"},value = "在设备列表中移除设备(解除绑定) -- 二期新增")
|
|
public Result<Object> unBindMyDevice(HttpServletRequest request,@RequestHeader("token") String token,
|
|
public Result<Object> unBindMyDevice(HttpServletRequest request,@RequestHeader("token") String token,
|
|
- @RequestParam("id") Long id) {
|
|
|
|
|
|
+ @RequestParam("devId") Long devId) {
|
|
try {
|
|
try {
|
|
MemberInfoVO current = passportService.checkToken(token);
|
|
MemberInfoVO current = passportService.checkToken(token);
|
|
- this.pinanbaoDeviceService.unBindMyDevice(current.getId(),id);
|
|
|
|
|
|
+ this.pinanbaoDeviceService.unBindMyDevice(current.getId(),devId);
|
|
return Result.success("移除成功!");
|
|
return Result.success("移除成功!");
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
log.error("设备: 移除设备出现异常", e);
|
|
log.error("设备: 移除设备出现异常", e);
|
|
@@ -83,24 +69,7 @@ public class DevApiController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * 我的设备列表
|
|
|
|
- * @return
|
|
|
|
- */
|
|
|
|
- @GetMapping("/my/myDeviceList")
|
|
|
|
- @ApiOperation(tags = {"我的设备"},value = "我的设备列表 -- 二期新增")
|
|
|
|
- public Result<List<DeviceVO>> myDeviceList(@RequestHeader(value = "token") String token){
|
|
|
|
- try {
|
|
|
|
- MemberInfoVO current = passportService.checkToken(token);
|
|
|
|
- List<DeviceVO> datas = pinanbaoDeviceService.queryDeviceByMemberId(current.getId());
|
|
|
|
- return Result.success(datas);
|
|
|
|
- }catch (BDException e) {
|
|
|
|
- return Result.error(e.getMessage());
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- log.error("设备: 列表查询出现异常",e);
|
|
|
|
- return Result.error( "获取失败");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
|
|
/**
|
|
/**
|
|
* 我的设备详情
|
|
* 我的设备详情
|
|
@@ -109,9 +78,9 @@ public class DevApiController {
|
|
@GetMapping("/my/getMyDeviceInfo")
|
|
@GetMapping("/my/getMyDeviceInfo")
|
|
@ApiOperation(tags = {"我的设备"},value = "设备详情 (包括设备名、场景、响应时间、服务信息等) -- 二期新增")
|
|
@ApiOperation(tags = {"我的设备"},value = "设备详情 (包括设备名、场景、响应时间、服务信息等) -- 二期新增")
|
|
public Result<DeviceVO> getMyDeviceInfo(@RequestHeader(value = "token") String token,
|
|
public Result<DeviceVO> getMyDeviceInfo(@RequestHeader(value = "token") String token,
|
|
- @RequestParam("id") Long id){
|
|
|
|
|
|
+ @RequestParam("devId") Long devId){
|
|
try {
|
|
try {
|
|
- return Result.success(this.pinanbaoDeviceService.getDeviceInfo(id));
|
|
|
|
|
|
+ return Result.success(this.pinanbaoDeviceService.getDeviceInfo(devId));
|
|
}catch (BDException e) {
|
|
}catch (BDException e) {
|
|
return Result.error(e.getMessage());
|
|
return Result.error(e.getMessage());
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
@@ -166,9 +135,9 @@ public class DevApiController {
|
|
@GetMapping("/my/queryMyOlderListByDeviceId")
|
|
@GetMapping("/my/queryMyOlderListByDeviceId")
|
|
@ApiOperation(tags = {"我的设备"},value = "查询我的设备拥有的被监护人列表 -- 二期新增")
|
|
@ApiOperation(tags = {"我的设备"},value = "查询我的设备拥有的被监护人列表 -- 二期新增")
|
|
public Result<List<OlderVO>> queryMyOlderListByDeviceId(@RequestHeader(value = "token") String token,
|
|
public Result<List<OlderVO>> queryMyOlderListByDeviceId(@RequestHeader(value = "token") String token,
|
|
- @RequestParam("id") Long id){
|
|
|
|
|
|
+ @RequestParam("devId") Long devId){
|
|
try {
|
|
try {
|
|
- List<OlderVO> datas = pinanbaoDeviceService.queryMyOlderListByDeviceId(id);
|
|
|
|
|
|
+ List<OlderVO> datas = pinanbaoDeviceService.queryMyOlderListByDeviceId(devId);
|
|
return Result.success(datas);
|
|
return Result.success(datas);
|
|
}catch (BDException e) {
|
|
}catch (BDException e) {
|
|
return Result.error(e.getMessage());
|
|
return Result.error(e.getMessage());
|
|
@@ -186,9 +155,9 @@ public class DevApiController {
|
|
@GetMapping("/my/queryMyContactListByDeviceId")
|
|
@GetMapping("/my/queryMyContactListByDeviceId")
|
|
@ApiOperation(tags = {"我的设备"},value = "查询我的设备拥有的紧急联系人列表 -- 二期新增")
|
|
@ApiOperation(tags = {"我的设备"},value = "查询我的设备拥有的紧急联系人列表 -- 二期新增")
|
|
public Result<List<HouseContactVO>> queryMyContactListByDeviceId(@RequestHeader(value = "token") String token,
|
|
public Result<List<HouseContactVO>> queryMyContactListByDeviceId(@RequestHeader(value = "token") String token,
|
|
- @RequestParam("id") Long id){
|
|
|
|
|
|
+ @RequestParam("devId") Long devId){
|
|
try {
|
|
try {
|
|
- List<HouseContactVO> datas = pinanbaoDeviceService.queryMyContactListByDeviceId(id);
|
|
|
|
|
|
+ List<HouseContactVO> datas = pinanbaoDeviceService.queryMyContactListByDeviceId(devId);
|
|
return Result.success(datas);
|
|
return Result.success(datas);
|
|
}catch (BDException e) {
|
|
}catch (BDException e) {
|
|
return Result.error(e.getMessage());
|
|
return Result.error(e.getMessage());
|
|
@@ -205,9 +174,9 @@ public class DevApiController {
|
|
@PostMapping("/my/bindOlder")
|
|
@PostMapping("/my/bindOlder")
|
|
@ApiOperation(tags = {"我的设备"},value = "选择我的被监护人列表中某个老人保存绑定 --二期新增")
|
|
@ApiOperation(tags = {"我的设备"},value = "选择我的被监护人列表中某个老人保存绑定 --二期新增")
|
|
public Result<Object> bindOlder(HttpServletRequest request, @RequestHeader("token") String token,
|
|
public Result<Object> bindOlder(HttpServletRequest request, @RequestHeader("token") String token,
|
|
- @RequestParam("id") Long id,
|
|
|
|
|
|
+ @RequestParam("devId") Long devId,
|
|
@RequestParam("olderId") Long olderId) {
|
|
@RequestParam("olderId") Long olderId) {
|
|
- if (this.pinanbaoDeviceService.bindOlder(id,olderId)) {
|
|
|
|
|
|
+ if (this.pinanbaoDeviceService.bindOlder(devId,olderId)) {
|
|
return Result.success("绑定成功");
|
|
return Result.success("绑定成功");
|
|
} else{
|
|
} else{
|
|
return Result.error("绑定失败");
|
|
return Result.error("绑定失败");
|
|
@@ -217,10 +186,10 @@ public class DevApiController {
|
|
@PostMapping("/my/unBindOlder")
|
|
@PostMapping("/my/unBindOlder")
|
|
@ApiOperation(tags = {"我的设备"},value = "移除被监护人(解除绑定) -- 二期新增")
|
|
@ApiOperation(tags = {"我的设备"},value = "移除被监护人(解除绑定) -- 二期新增")
|
|
public Result<Object> unBindOlder(HttpServletRequest request,@RequestHeader("token") String token,
|
|
public Result<Object> unBindOlder(HttpServletRequest request,@RequestHeader("token") String token,
|
|
- @RequestParam("id") Long id,
|
|
|
|
|
|
+ @RequestParam("devId") Long devId,
|
|
@RequestParam("olderId") Long olderId) {
|
|
@RequestParam("olderId") Long olderId) {
|
|
try {
|
|
try {
|
|
- this.pinanbaoDeviceService.unBindOlder(id,olderId);
|
|
|
|
|
|
+ this.pinanbaoDeviceService.unBindOlder(devId,olderId);
|
|
return Result.success("移除成功!");
|
|
return Result.success("移除成功!");
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
log.error("设备: 移除设备出现异常", e);
|
|
log.error("设备: 移除设备出现异常", e);
|
|
@@ -234,9 +203,9 @@ public class DevApiController {
|
|
@PostMapping("/my/bindHouseContact")
|
|
@PostMapping("/my/bindHouseContact")
|
|
@ApiOperation(tags = {"我的设备"},value = "选择我的紧急人列表中某个保存绑定 --二期新增")
|
|
@ApiOperation(tags = {"我的设备"},value = "选择我的紧急人列表中某个保存绑定 --二期新增")
|
|
public Result<Object> bindHouseContact(HttpServletRequest request, @RequestHeader("token") String token,
|
|
public Result<Object> bindHouseContact(HttpServletRequest request, @RequestHeader("token") String token,
|
|
- @RequestParam("id") Long id,
|
|
|
|
|
|
+ @RequestParam("devId") Long devId,
|
|
@RequestParam("contactId") Long contactId) {
|
|
@RequestParam("contactId") Long contactId) {
|
|
- if (this.pinanbaoDeviceService.bindHouseContact(id,contactId)) {
|
|
|
|
|
|
+ if (this.pinanbaoDeviceService.bindHouseContact(devId,contactId)) {
|
|
return Result.success("绑定成功");
|
|
return Result.success("绑定成功");
|
|
} else{
|
|
} else{
|
|
return Result.error("绑定失败");
|
|
return Result.error("绑定失败");
|
|
@@ -250,9 +219,9 @@ public class DevApiController {
|
|
@PostMapping("/my/unHouseContact")
|
|
@PostMapping("/my/unHouseContact")
|
|
@ApiOperation(tags = {"我的设备"},value = "移除被紧急联系人(解除绑定) --二期新增")
|
|
@ApiOperation(tags = {"我的设备"},value = "移除被紧急联系人(解除绑定) --二期新增")
|
|
public Result<Object> unHouseContact(HttpServletRequest request, @RequestHeader("token") String token,
|
|
public Result<Object> unHouseContact(HttpServletRequest request, @RequestHeader("token") String token,
|
|
- @RequestParam("id") Long id,
|
|
|
|
|
|
+ @RequestParam("devId") Long devId,
|
|
@RequestParam("contactId") Long contactId) {
|
|
@RequestParam("contactId") Long contactId) {
|
|
- if (this.pinanbaoDeviceService.unHouseContact(id,contactId)) {
|
|
|
|
|
|
+ if (this.pinanbaoDeviceService.unHouseContact(devId,contactId)) {
|
|
return Result.success("绑定成功");
|
|
return Result.success("绑定成功");
|
|
} else{
|
|
} else{
|
|
return Result.error("绑定失败");
|
|
return Result.error("绑定失败");
|