|
|
|
@ -2,9 +2,12 @@ package com.hnac.gglm.bigmodel.maintenance.service.impl;
|
|
|
|
|
|
|
|
|
|
import com.baomidou.dynamic.datasource.annotation.DS; |
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
|
import com.hnac.gglm.bigmodel.database.service.WeaviateService; |
|
|
|
|
import com.hnac.gglm.bigmodel.maintenance.constants.DataOperateType; |
|
|
|
|
import com.hnac.gglm.bigmodel.maintenance.entity.VectorParamEntity; |
|
|
|
|
import com.hnac.gglm.bigmodel.maintenance.entity.VectorParamLogEntity; |
|
|
|
|
import com.hnac.gglm.bigmodel.maintenance.mapper.VectorParamLogMapper; |
|
|
|
|
import com.hnac.gglm.bigmodel.maintenance.mapper.VectorParamMapper; |
|
|
|
|
import com.hnac.gglm.bigmodel.maintenance.service.VectorParamLogService; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
@ -21,8 +24,10 @@ import java.util.List;
|
|
|
|
|
@Service |
|
|
|
|
@Slf4j |
|
|
|
|
@AllArgsConstructor |
|
|
|
|
@DS("hznlm") |
|
|
|
|
public class VectorParamLogServiceImpl extends ServiceImpl<VectorParamLogMapper, VectorParamLogEntity> implements VectorParamLogService { |
|
|
|
|
private final WeaviateService weaviateService; |
|
|
|
|
private final VectorParamMapper vectorParamMapper; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Boolean create(VectorParamLogEntity req) { |
|
|
|
|
if (ObjectUtil.isEmpty(req.getVectorParamId())) { |
|
|
|
@ -50,7 +55,15 @@ public class VectorParamLogServiceImpl extends ServiceImpl<VectorParamLogMapper,
|
|
|
|
|
} |
|
|
|
|
req.setType(DataOperateType.RESET.getCode()); |
|
|
|
|
req.setCreateUser(AuthUtil.getUserId()); |
|
|
|
|
return save(req); |
|
|
|
|
VectorParamEntity vectorParam = vectorParamMapper.selectById(req.getVectorParamId()); |
|
|
|
|
if (null == vectorParam) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
baseMapper.insert(req); |
|
|
|
|
if (null != vectorParam.getTableName()) { |
|
|
|
|
weaviateService.delete(null, vectorParam.getTableName()); |
|
|
|
|
} |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|