From e6c577bf44ec837516f2d4351ba3b4fcebb48f28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=87=A4=E5=90=89?= Date: Wed, 30 Jul 2025 10:26:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=AE=8C=E5=96=84=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/iflytop/handacid/app/controller/DeviceController.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/iflytop/handacid/app/controller/DeviceController.java b/src/main/java/com/iflytop/handacid/app/controller/DeviceController.java index 9b5e1cd..44d6e91 100644 --- a/src/main/java/com/iflytop/handacid/app/controller/DeviceController.java +++ b/src/main/java/com/iflytop/handacid/app/controller/DeviceController.java @@ -1,6 +1,8 @@ package com.iflytop.handacid.app.controller; +import com.iflytop.handacid.app.core.state.ChannelState; import com.iflytop.handacid.app.core.state.DeviceState; +import com.iflytop.handacid.app.model.bo.SyncOperationsChannel; import com.iflytop.handacid.app.model.dto.SyncOperationsDTO; import com.iflytop.handacid.common.result.Result; import io.swagger.v3.oas.annotations.Operation; @@ -26,6 +28,12 @@ public class DeviceController { @Operation(summary = "同步用户操作") @PostMapping("/sync") public Result syncOperations(@RequestBody SyncOperationsDTO syncOperationsDTO) { - return Result.success(deviceState.toJSON()); + deviceState.setMode(syncOperationsDTO.getMode()); + for (SyncOperationsChannel syncOperationsChannel : syncOperationsDTO.getChannels()) { + ChannelState channelState = deviceState.getChannelStateMap().get(syncOperationsChannel.getChannelCode()); + channelState.setSelected(syncOperationsChannel.isSelected()); + channelState.setTargetVolume(syncOperationsChannel.getTargetVolume()); + } + return Result.success(); } }