mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-24 04:19:48 +01:00
update:优化获取新固件方法
This commit is contained in:
parent
04154162c6
commit
d39c595828
2 changed files with 6 additions and 2 deletions
|
|
@ -138,7 +138,7 @@ public class DeviceServiceImpl extends BaseServiceImpl<DeviceDao, DeviceEntity>
|
|||
}
|
||||
|
||||
DeviceReportRespDTO.Firmware firmware = new DeviceReportRespDTO.Firmware();
|
||||
firmware.setVersion(ota.getVersion());
|
||||
firmware.setVersion(ota == null ? null : ota.getVersion());
|
||||
firmware.setUrl(downloadUrl);
|
||||
response.setFirmware(firmware);
|
||||
|
||||
|
|
|
|||
|
|
@ -74,6 +74,10 @@ public class OtaServiceImpl extends BaseServiceImpl<OtaDao, OtaEntity> implement
|
|||
|
||||
@Override
|
||||
public OtaEntity getLatestOta(String type) {
|
||||
return baseDao.selectOne(new QueryWrapper<OtaEntity>().eq("type", type).orderByDesc("update_date"));
|
||||
QueryWrapper<OtaEntity> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("type", type)
|
||||
.orderByDesc("update_date")
|
||||
.last("LIMIT 1");
|
||||
return baseDao.selectOne(wrapper);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue