更新 HeartBeatService.java
This commit is contained in:
@@ -52,7 +52,7 @@ public class HeartBeatService {
|
|||||||
|
|
||||||
UpdateWrapper<DeviceInfoDAO> updateWrapper = new UpdateWrapper<>();
|
UpdateWrapper<DeviceInfoDAO> updateWrapper = new UpdateWrapper<>();
|
||||||
updateWrapper.eq("sn", deviceInfo.getSN());
|
updateWrapper.eq("sn", deviceInfo.getSN());
|
||||||
updateWrapper.set("last_online_time", currentTimeMillis); // 设置新的 accessToken
|
updateWrapper.set("last_online_time", currentTimeMillis);
|
||||||
|
|
||||||
int result = deviceInfoDAOMapper.update(null, updateWrapper);
|
int result = deviceInfoDAOMapper.update(null, updateWrapper);
|
||||||
if (result > 0) {
|
if (result > 0) {
|
||||||
@@ -86,11 +86,11 @@ public class HeartBeatService {
|
|||||||
try {
|
try {
|
||||||
DeviceInfoDAO deviceInfoDAO = deviceInfoDAOMapper.selectOne(queryWrapper);
|
DeviceInfoDAO deviceInfoDAO = deviceInfoDAOMapper.selectOne(queryWrapper);
|
||||||
if (deviceInfoDAO != null) {
|
if (deviceInfoDAO != null) {
|
||||||
logger.info("Data is queried in the database based on the device id");
|
logger.info("Data is queried in the database based on the SN");
|
||||||
return deviceInfoDAO;
|
return deviceInfoDAO;
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("Error querying device info by android ID", e);
|
logger.error("Error querying device info by SN", e);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user