mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-27 04:49:47 +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();
|
DeviceReportRespDTO.Firmware firmware = new DeviceReportRespDTO.Firmware();
|
||||||
firmware.setVersion(ota.getVersion());
|
firmware.setVersion(ota == null ? null : ota.getVersion());
|
||||||
firmware.setUrl(downloadUrl);
|
firmware.setUrl(downloadUrl);
|
||||||
response.setFirmware(firmware);
|
response.setFirmware(firmware);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -74,6 +74,10 @@ public class OtaServiceImpl extends BaseServiceImpl<OtaDao, OtaEntity> implement
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public OtaEntity getLatestOta(String type) {
|
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