Browse Source

add:向量操作日志,多数据源问题

zhongwei
luyie 4 months ago
parent
commit
4cad961e73
  1. 17
      hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/controller/VectorParamController.java
  2. 4
      hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/VectorParamService.java
  3. 22
      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/controller/VectorParamController.java

@ -37,7 +37,6 @@ import java.util.Map;
@Slf4j @Slf4j
public class VectorParamController { public class VectorParamController {
private final VectorParamService vectorParamService; private final VectorParamService vectorParamService;
private final VectorParamLogService vectorParamLogService;
@GetMapping("/listPage") @GetMapping("/listPage")
@ApiOperation(value = "分页查询") @ApiOperation(value = "分页查询")
@ -57,13 +56,7 @@ public class VectorParamController {
@ApiOperation(value = "保存向量参数配置") @ApiOperation(value = "保存向量参数配置")
@ApiOperationSupport(order = 3) @ApiOperationSupport(order = 3)
public R save(@RequestBody VectorParamEntity req) { public R save(@RequestBody VectorParamEntity req) {
Boolean result = vectorParamService.save(req); return R.status(vectorParamService.saveWithLog(req));
if (result) {
vectorParamLogService.create(VectorParamLogEntity.builder()
.vectorParamId(req.getId())
.type(DataOperateType.CREATE.getCode()).build());
}
return R.status(result);
} }
@DeleteMapping("/remove") @DeleteMapping("/remove")
@ -77,13 +70,7 @@ public class VectorParamController {
@ApiOperation(value = "编辑向量参数配置") @ApiOperation(value = "编辑向量参数配置")
@ApiOperationSupport(order = 5) @ApiOperationSupport(order = 5)
public R update(@RequestBody VectorParamEntity req) { public R update(@RequestBody VectorParamEntity req) {
Boolean result = vectorParamService.updateById(req); return R.status(vectorParamService.updateWithLog(req));
if (result) {
vectorParamLogService.edit(VectorParamLogEntity.builder()
.vectorParamId(req.getId())
.type(DataOperateType.UPDATE.getCode()).build());
}
return R.status(result);
} }
@GetMapping("/getAuthorization") @GetMapping("/getAuthorization")

4
hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/VectorParamService.java

@ -23,4 +23,8 @@ public interface VectorParamService extends IService<VectorParamEntity> {
Boolean synchronization(Long id, String bladeToken, String hzinfoToken); Boolean synchronization(Long id, String bladeToken, String hzinfoToken);
Boolean removeByIdsWithLog(List<Long> isList); Boolean removeByIdsWithLog(List<Long> isList);
Boolean saveWithLog(VectorParamEntity req);
Boolean updateWithLog(VectorParamEntity req);
} }

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

@ -180,4 +180,26 @@ public class VectorParamServiceImpl extends ServiceImpl<VectorParamMapper, Vecto
} }
return result; return result;
} }
@Override
public Boolean saveWithLog(VectorParamEntity req) {
Boolean result = baseMapper.insert(req) > 0;
if (result) {
vectorParamLogService.create(VectorParamLogEntity.builder()
.vectorParamId(req.getId())
.type(DataOperateType.CREATE.getCode()).build());
}
return result;
}
@Override
public Boolean updateWithLog(VectorParamEntity req) {
Boolean result = baseMapper.updateById(req) > 0;
if (result) {
vectorParamLogService.edit(VectorParamLogEntity.builder()
.vectorParamId(req.getId())
.type(DataOperateType.UPDATE.getCode()).build());
}
return result;
}
} }

Loading…
Cancel
Save