|
|
@ -1,38 +0,0 @@ |
|
|
|
package com.iflytop.gd.app.cmd.debug; |
|
|
|
|
|
|
|
import com.iflytop.gd.app.core.BaseCommandHandler; |
|
|
|
import com.iflytop.gd.app.model.dto.CmdDTO; |
|
|
|
import com.iflytop.gd.app.model.entity.DevicePosition; |
|
|
|
import com.iflytop.gd.app.service.DeviceCommandService; |
|
|
|
import com.iflytop.gd.app.service.DevicePositionService; |
|
|
|
import com.iflytop.gd.common.annotation.CommandMapping; |
|
|
|
import com.iflytop.gd.common.cmd.CommandFuture; |
|
|
|
import com.iflytop.gd.common.cmd.DeviceCommandBundle; |
|
|
|
import com.iflytop.gd.common.cmd.DeviceCommandGenerator; |
|
|
|
import com.iflytop.gd.common.enums.data.DevicePositionCode; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
import java.util.concurrent.CompletableFuture; |
|
|
|
|
|
|
|
/** |
|
|
|
* 处理关门指令 |
|
|
|
*/ |
|
|
|
@Slf4j |
|
|
|
@Component |
|
|
|
@RequiredArgsConstructor |
|
|
|
@CommandMapping("debug_door_close") |
|
|
|
public class DoorCloseCommandHandler extends BaseCommandHandler { |
|
|
|
private final DeviceCommandService deviceCommandService; |
|
|
|
|
|
|
|
@Override |
|
|
|
public CompletableFuture<Void> handle(CmdDTO cmdDTO) { |
|
|
|
return runAsync(() -> { |
|
|
|
DeviceCommandBundle deviceCommand = DeviceCommandGenerator.doorOrigin(); |
|
|
|
CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); |
|
|
|
commandWait(deviceCommandFuture); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|