|
@@ -23,7 +23,7 @@ public class UserDeviceController
|
|
|
|
|
|
|
|
|
@RequestMapping(value = "/setUserDevice/{uid}", method = RequestMethod.GET)
|
|
|
- public UserDevice bindingDevice(@PathVariable("uid") String uid,
|
|
|
+ public boolean bindingDevice(@PathVariable("uid") String uid,
|
|
|
@RequestParam("deviceCode") String deviceCode,
|
|
|
@RequestParam("deviceMode") String deviceMode,
|
|
|
@RequestParam("deviceMfrs") String deviceMfrs,
|
|
@@ -31,33 +31,39 @@ public class UserDeviceController
|
|
|
|
|
|
if(RaStringHelper.isNull(uid))
|
|
|
{
|
|
|
- return null;
|
|
|
+ return false;
|
|
|
}
|
|
|
if(RaStringHelper.isNull(deviceCode))
|
|
|
{
|
|
|
- return null;
|
|
|
+ return false;
|
|
|
}
|
|
|
if(RaStringHelper.isNull(deviceMode))
|
|
|
{
|
|
|
- return null;
|
|
|
+ return false;
|
|
|
}
|
|
|
if(RaStringHelper.isNull(deviceMfrs))
|
|
|
{
|
|
|
- return null;
|
|
|
+ return false;
|
|
|
}
|
|
|
if(RaStringHelper.isNull(deviceBrand))
|
|
|
{
|
|
|
- return null;
|
|
|
+ return false;
|
|
|
}
|
|
|
|
|
|
UserDevice userDevice = userDeviceService.findDevice(uid,deviceCode,deviceMode,deviceMfrs,deviceBrand);
|
|
|
if(userDevice!=null)
|
|
|
{
|
|
|
int num = userDevice.getNum()+1;
|
|
|
- userDeviceService.updateDevice(uid,deviceCode,deviceMode,deviceMfrs,deviceBrand,num);
|
|
|
+ int updateRet = userDeviceService.updateDevice(uid,deviceCode,deviceMode,deviceMfrs,deviceBrand,num);
|
|
|
+
|
|
|
+ if(updateRet>0)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
}
|
|
|
|
|
|
- return userDevice;
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
}
|