| File was renamed from pipIrr-platform/pipIrr-web/pipIrr-web-remote/src/main/java/com/dy/pipIrrRemote/rtu/CommandResultCtrl.java |
| | |
| | | package com.dy.pipIrrRemote.rtu; |
| | | package com.dy.pipIrrRemote.common; |
| | | |
| | | import com.dy.common.mw.protocol.Data; |
| | | import com.dy.common.webUtil.BaseResponse; |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.concurrent.CompletableFuture; |
| | | |
| | | /** |
| | | * @author ZhuBaoMin |
| | | * @date 2024-05-23 8:19 |
| | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping(path="comRes") |
| | | public class CommandResultCtrl { |
| | | public class CommandResultCtrl extends ComSupport { |
| | | @PostMapping(path = "receive", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | public BaseResponse<String> receive(@RequestBody Data data) { |
| | | log.info(data.toString()) ; |
| | | String comId = "0"; |
| | | if(data.getCommandId() != null) { |
| | | comId = data.getCommandId(); |
| | | } |
| | | CompletableFuture<Data> feature = (CompletableFuture<Data>) features.get(comId); |
| | | if(feature != null) { |
| | | feature.complete(data); |
| | | } |
| | | return BaseResponseUtils.buildSuccess("ok"); |
| | | } |
| | | } |