diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/controller/VectorParamController.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/controller/VectorParamController.java index fc42a5e..e1fc722 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/controller/VectorParamController.java +++ b/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 public class VectorParamController { private final VectorParamService vectorParamService; - private final VectorParamLogService vectorParamLogService; @GetMapping("/listPage") @ApiOperation(value = "分页查询") @@ -57,13 +56,7 @@ public class VectorParamController { @ApiOperation(value = "保存向量参数配置") @ApiOperationSupport(order = 3) public R save(@RequestBody VectorParamEntity req) { - Boolean result = vectorParamService.save(req); - if (result) { - vectorParamLogService.create(VectorParamLogEntity.builder() - .vectorParamId(req.getId()) - .type(DataOperateType.CREATE.getCode()).build()); - } - return R.status(result); + return R.status(vectorParamService.saveWithLog(req)); } @DeleteMapping("/remove") @@ -77,13 +70,7 @@ public class VectorParamController { @ApiOperation(value = "编辑向量参数配置") @ApiOperationSupport(order = 5) public R update(@RequestBody VectorParamEntity req) { - Boolean result = vectorParamService.updateById(req); - if (result) { - vectorParamLogService.edit(VectorParamLogEntity.builder() - .vectorParamId(req.getId()) - .type(DataOperateType.UPDATE.getCode()).build()); - } - return R.status(result); + return R.status(vectorParamService.updateWithLog(req)); } @GetMapping("/getAuthorization") diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/VectorParamService.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/VectorParamService.java index 2b65868..57f3b74 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/VectorParamService.java +++ b/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 { Boolean synchronization(Long id, String bladeToken, String hzinfoToken); Boolean removeByIdsWithLog(List isList); + + Boolean saveWithLog(VectorParamEntity req); + + Boolean updateWithLog(VectorParamEntity req); } diff --git a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/VectorParamServiceImpl.java b/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/VectorParamServiceImpl.java index d64ddf6..df4f20f 100644 --- a/hzims-service/gglm-big-model/src/main/java/com/hnac/gglm/bigmodel/maintenance/service/impl/VectorParamServiceImpl.java +++ b/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 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; + } }