|
|
@ -8,7 +8,6 @@ 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.BigModelInvokeApi; |
|
|
|
|
|
|
|
import com.hnac.gglm.bigmodel.maintenance.constants.StoreStatus; |
|
|
|
import com.hnac.gglm.bigmodel.maintenance.constants.StoreStatus; |
|
|
|
import com.hnac.gglm.bigmodel.maintenance.entity.KnowledgeFileFragment; |
|
|
|
import com.hnac.gglm.bigmodel.maintenance.entity.KnowledgeFileFragment; |
|
|
|
import com.hnac.gglm.bigmodel.maintenance.entity.KnowledgeFileInfo; |
|
|
|
import com.hnac.gglm.bigmodel.maintenance.entity.KnowledgeFileInfo; |
|
|
@ -17,7 +16,6 @@ import com.hnac.gglm.bigmodel.maintenance.service.KnowledgeFileFragmentService; |
|
|
|
import com.hnac.gglm.bigmodel.maintenance.service.KnowledgeFileInfoService; |
|
|
|
import com.hnac.gglm.bigmodel.maintenance.service.KnowledgeFileInfoService; |
|
|
|
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 com.hnac.gglm.bigmodel.utils.RequestClientUtil; |
|
|
|
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
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; |
|
|
@ -68,16 +66,17 @@ 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) { |
|
|
|
|
|
|
|
LambdaUpdateWrapper<KnowledgeFileInfo> wrapper = Wrappers.<KnowledgeFileInfo>lambdaUpdate() |
|
|
|
|
|
|
|
.set(KnowledgeFileInfo::getFileStatus, StoreStatus.STORING.getCode()) |
|
|
|
|
|
|
|
.eq(KnowledgeFileInfo::getId, knowledgeFileInfo.getId()); |
|
|
|
|
|
|
|
this.update(wrapper); |
|
|
|
HttpResponse response = HttpRequest.post(interactionUrl + 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()) { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
LambdaUpdateWrapper<KnowledgeFileInfo> wrapper = Wrappers.<KnowledgeFileInfo>lambdaUpdate() |
|
|
|
return Boolean.TRUE; |
|
|
|
.set(KnowledgeFileInfo::getFileStatus, StoreStatus.STORING.getCode()) |
|
|
|
|
|
|
|
.eq(KnowledgeFileInfo::getId, knowledgeFileInfo.getId()); |
|
|
|
|
|
|
|
return this.update(wrapper); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|