更新 HeartBeatService.java

pull/1/head
wangsiyuan 2023-12-09 14:12:01 +08:00
parent ceaf3ac24d
commit ae889a2447
1 changed files with 3 additions and 3 deletions

View File

@ -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;
} }