mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-29 01:03:51 +08:00
update:优化获取新固件方法
This commit is contained in:
+1
-1
@@ -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);
|
||||||
|
|
||||||
|
|||||||
+5
-1
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user