Browse Source

add:大模型,交互url

zhongwei
luyie 2 months ago
parent
commit
751529e866
  1. 13
      hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/configuration/BigModelInteraction.java
  2. 11
      hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/KnowledgeFileInfoServiceImpl.java

13
hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/configuration/BigModelInteraction.java

@ -1,13 +0,0 @@
package com.hnac.gglm.bigmodel.configuration;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
@Data
@Component
public class BigModelInteraction {
private String url;
}

11
hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/KnowledgeFileInfoServiceImpl.java

@ -8,14 +8,13 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hnac.gglm.bigmodel.configuration.BigModelInteraction;
import com.hnac.gglm.bigmodel.maintenance.entity.KnowledgeFileInfo; import com.hnac.gglm.bigmodel.maintenance.entity.KnowledgeFileInfo;
import com.hnac.gglm.bigmodel.maintenance.mapper.KnowledgeFileInfoMapper; import com.hnac.gglm.bigmodel.maintenance.mapper.KnowledgeFileInfoMapper;
import com.hnac.gglm.bigmodel.maintenance.service.KnowledgeFileInfoService; import com.hnac.gglm.bigmodel.maintenance.service.KnowledgeFileInfoService;
import com.hnac.gglm.bigmodel.maintenance.constants.StoreStatus; import com.hnac.gglm.bigmodel.maintenance.constants.StoreStatus;
import com.hnac.gglm.bigmodel.maintenance.vo.IdRequest; import com.hnac.gglm.bigmodel.maintenance.vo.IdRequest;
import com.hnac.gglm.bigmodel.maintenance.vo.IdsRequest; import com.hnac.gglm.bigmodel.maintenance.vo.IdsRequest;
import lombok.AllArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.core.oss.model.BladeFile; import org.springblade.core.oss.model.BladeFile;
import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.secure.utils.AuthUtil;
@ -23,6 +22,7 @@ import org.springblade.core.tool.api.R;
import org.springblade.core.tool.jackson.JsonUtil; import org.springblade.core.tool.jackson.JsonUtil;
import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.resource.feign.IOssClient; import org.springblade.resource.feign.IOssClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@ -36,13 +36,14 @@ import java.util.Map;
*/ */
@Service @Service
@Slf4j @Slf4j
@AllArgsConstructor @RequiredArgsConstructor
@DS("hznlm") @DS("hznlm")
public class KnowledgeFileInfoServiceImpl extends ServiceImpl<KnowledgeFileInfoMapper, KnowledgeFileInfo> implements KnowledgeFileInfoService { public class KnowledgeFileInfoServiceImpl extends ServiceImpl<KnowledgeFileInfoMapper, KnowledgeFileInfo> implements KnowledgeFileInfoService {
private final KnowledgeFileInfoMapper knowledgeFileInfoMapper; private final KnowledgeFileInfoMapper knowledgeFileInfoMapper;
private final IOssClient ossClient; private final IOssClient ossClient;
private final BigModelInteraction interactionConfig; @Value("${gglm.url}")
private String interactionUrl;
@Override @Override
public Boolean store(IdRequest req) { public Boolean store(IdRequest req) {
@ -61,7 +62,7 @@ public class KnowledgeFileInfoServiceImpl extends ServiceImpl<KnowledgeFileInfoM
} }
private Boolean store(KnowledgeFileInfo knowledgeFileInfo, String tenantId, Long createUser, String createDept) { private Boolean store(KnowledgeFileInfo knowledgeFileInfo, String tenantId, Long createUser, String createDept) {
HttpResponse response = HttpRequest.post(interactionConfig.getUrl() + SEGMENT_URL) HttpResponse response = HttpRequest.post(interactionUrl + SEGMENT_URL)
.body(getParamsJson(knowledgeFileInfo, tenantId, createUser, createDept), "application/json") .body(getParamsJson(knowledgeFileInfo, tenantId, createUser, createDept), "application/json")
.execute(); .execute();
if (!response.isOk()) { if (!response.isOk()) {

Loading…
Cancel
Save