Browse Source

#下发遥控指令

zhongwei
yang_shj 6 months ago
parent
commit
eede11fea9
  1. 11
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/controller/InteractiveController.java
  2. 3
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/IInteractiveService.java
  3. 14
      hzims-service/hzims-big-model/src/main/java/com/hnac/hzims/bigmodel/interactive/service/impl/InteractiveServiceImpl.java

11
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<Object> sendRemoteControl(@RequestBody ControlDTO operate) {
return R.data(interactiveService.sendRemoteControl(operate));
}
}

3
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);
}

14
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);
}
}

Loading…
Cancel
Save