Browse Source

add:向量库操作日志

zhongwei
luyie 2 months ago
parent
commit
e8ce5ecec6
  1. 17
      hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/VectorParamLogServiceImpl.java
  2. 1
      hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/VectorParamServiceImpl.java

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

@ -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

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

@ -37,7 +37,6 @@ import java.util.concurrent.TimeUnit;
@Service
@Slf4j
@AllArgsConstructor
@DS("hznlm")
public class VectorParamServiceImpl extends ServiceImpl<VectorParamMapper, VectorParamEntity> implements VectorParamService {
private static final String CLIENT_SIGN = "vector_param";

Loading…
Cancel
Save