mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-22 07:03:53 +08:00
fix:修复设备型号不显示的问题
This commit is contained in:
+2
-1
@@ -303,8 +303,8 @@ public class DeviceServiceImpl extends BaseServiceImpl<DeviceDao, DeviceEntity>
|
|||||||
List<DeviceEntity> devices = getUserDevices(userId, agentId);
|
List<DeviceEntity> devices = getUserDevices(userId, agentId);
|
||||||
return devices.stream().map(device -> {
|
return devices.stream().map(device -> {
|
||||||
UserShowDeviceListVO vo = ConvertUtils.sourceToTarget(device, UserShowDeviceListVO.class);
|
UserShowDeviceListVO vo = ConvertUtils.sourceToTarget(device, UserShowDeviceListVO.class);
|
||||||
// 手动设置deviceType(ConvertUtils按字段名匹配,board无法直接映射到deviceType)
|
|
||||||
vo.setDeviceType(device.getBoard());
|
vo.setDeviceType(device.getBoard());
|
||||||
|
vo.setBoard(device.getBoard());
|
||||||
// 设置UTC时间戳供前端使用时区转换
|
// 设置UTC时间戳供前端使用时区转换
|
||||||
if (device.getLastConnectedAt() != null) {
|
if (device.getLastConnectedAt() != null) {
|
||||||
vo.setLastConnectedAtTimestamp(device.getLastConnectedAt().getTime());
|
vo.setLastConnectedAtTimestamp(device.getLastConnectedAt().getTime());
|
||||||
@@ -371,6 +371,7 @@ public class DeviceServiceImpl extends BaseServiceImpl<DeviceDao, DeviceEntity>
|
|||||||
sysUserUtilService.assignUsername(device.getUserId(),
|
sysUserUtilService.assignUsername(device.getUserId(),
|
||||||
vo::setBindUserName);
|
vo::setBindUserName);
|
||||||
vo.setDeviceType(device.getBoard());
|
vo.setDeviceType(device.getBoard());
|
||||||
|
vo.setBoard(device.getBoard());
|
||||||
// 设置UTC时间戳供前端使用时区转换
|
// 设置UTC时间戳供前端使用时区转换
|
||||||
if (device.getLastConnectedAt() != null) {
|
if (device.getLastConnectedAt() != null) {
|
||||||
vo.setLastConnectedAtTimestamp(device.getLastConnectedAt().getTime());
|
vo.setLastConnectedAtTimestamp(device.getLastConnectedAt().getTime());
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ public class UserShowDeviceListVO {
|
|||||||
@Schema(description = "设备型号")
|
@Schema(description = "设备型号")
|
||||||
private String deviceType;
|
private String deviceType;
|
||||||
|
|
||||||
|
@Schema(description = "设备型号(board)")
|
||||||
|
private String board;
|
||||||
|
|
||||||
@Schema(description = "设备唯一标识符")
|
@Schema(description = "设备唯一标识符")
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
|
|||||||
@@ -369,7 +369,7 @@ export default {
|
|||||||
this.deviceList = data.data.map(device => {
|
this.deviceList = data.data.map(device => {
|
||||||
return {
|
return {
|
||||||
device_id: device.id,
|
device_id: device.id,
|
||||||
model: device.deviceType,
|
model: device.board,
|
||||||
firmwareVersion: device.appVersion,
|
firmwareVersion: device.appVersion,
|
||||||
macAddress: device.macAddress,
|
macAddress: device.macAddress,
|
||||||
bindTime: device.createDate,
|
bindTime: device.createDate,
|
||||||
|
|||||||
Reference in New Issue
Block a user