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