From eede11fea92d6ac28bcafac85e11401638cd5872 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Wed, 22 May 2024 15:27:37 +0800 Subject: [PATCH] =?UTF-8?q?#=E4=B8=8B=E5=8F=91=E9=81=A5=E6=8E=A7=E6=8C=87?= =?UTF-8?q?=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../interactive/controller/InteractiveController.java | 11 ++++++++++- .../bigmodel/interactive/service/IInteractiveService.java | 3 +++ .../interactive/service/impl/InteractiveServiceImpl.java | 14 ++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/controller/InteractiveController.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/controller/InteractiveController.java index 3c9788c..a80b2aa 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/controller/InteractiveController.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/controller/InteractiveController.java @@ -1,5 +1,6 @@ package com.hnac.hzims.bigmodel.interactive.controller; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.hnac.hzims.bigmodel.BigModelConstants; @@ -12,9 +13,12 @@ import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import lombok.AllArgsConstructor; import org.springblade.core.tool.api.R; +import org.springblade.system.dto.ControlDTO; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; +import java.util.HashMap; +import java.util.Map; /** * @Author: huangxing @@ -67,5 +71,10 @@ public class InteractiveController { return R.data(interactiveService.removeSessionId(sessionId)); } - + @ApiOperation("下发遥控指令") + @ApiOperationSupport(order = 6) + @PostMapping("/sendRemoteControl") + public R sendRemoteControl(@RequestBody ControlDTO operate) { + return R.data(interactiveService.sendRemoteControl(operate)); + } } diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/IInteractiveService.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/IInteractiveService.java index 8ace8cc..34c0a4f 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/IInteractiveService.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/IInteractiveService.java @@ -3,6 +3,7 @@ package com.hnac.hzims.bigmodel.interactive.service; import com.hnac.hzims.bigmodel.interactive.req.ModelFunctionReq; import com.hnac.hzims.bigmodel.interactive.vo.AnswerVO; import org.springblade.core.tool.api.R; +import org.springblade.system.dto.ControlDTO; import java.util.List; import java.util.Map; @@ -40,4 +41,6 @@ public interface IInteractiveService { * @return 发起结果 */ R knowledgeAsk(String question, String sessionId, String userId, String knowledge); + + Object sendRemoteControl(ControlDTO operate); } diff --git a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/InteractiveServiceImpl.java b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/InteractiveServiceImpl.java index a27ef9a..0395fd4 100644 --- a/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/InteractiveServiceImpl.java +++ b/hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/InteractiveServiceImpl.java @@ -24,8 +24,10 @@ import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.core.tool.utils.StringUtil; +import org.springblade.system.dto.ControlDTO; import org.springblade.system.dto.DeptStationDTO; import org.springblade.system.feign.IDeptClient; +import org.springblade.system.feign.IRemoteClient; import org.springblade.system.user.feign.IUserClient; import org.springframework.beans.factory.annotation.Value; import org.springframework.data.redis.core.RedisTemplate; @@ -50,6 +52,8 @@ public class InteractiveServiceImpl implements IInteractiveService { private final BladeLogger logger; + private final IRemoteClient remoteClient; + private final IJumpPageService jumpPageService; private final IParamsService paramsService; @@ -263,4 +267,14 @@ public class InteractiveServiceImpl implements IInteractiveService { this.addQuestionSessionId(sessionId); return R.success("消息发送成功"); } + + /** + * 下发遥控指令 + * @param operate + * @return + */ + @Override + public Object sendRemoteControl(ControlDTO operate) { + return remoteClient.sendCtrl(operate); + } }