Commit 830dd6bc authored by pengxin's avatar pengxin

发布后才写入到json文件中。

parent a6c3090d
...@@ -122,7 +122,7 @@ public class DatasetVersionController { ...@@ -122,7 +122,7 @@ public class DatasetVersionController {
*/ */
@OperationLog(type = SysOperationLogType.UPDATE) @OperationLog(type = SysOperationLogType.UPDATE)
@GetMapping("/publish") @GetMapping("/publish")
public ResponseResult<Void> publish(@RequestParam("versionId") Long versionId) { public ResponseResult<Void> publish(@RequestParam("versionId") Long versionId) throws IOException{
String errorMessage; String errorMessage;
if (null == versionId) { if (null == versionId) {
errorMessage = "数据验证失败,参数不能为空!"; errorMessage = "数据验证失败,参数不能为空!";
...@@ -142,7 +142,7 @@ public class DatasetVersionController { ...@@ -142,7 +142,7 @@ public class DatasetVersionController {
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage); return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
} }
datasetVersion.setReleaseStatus(DatasetConstant.STATUS_PUBLISHED); datasetVersion.setReleaseStatus(DatasetConstant.STATUS_PUBLISHED);
if (!datasetVersionService.update(datasetVersion)) { if (!datasetVersionService.saveDatasetJsonPath(datasetVersion)) {
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST); return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
} }
return ResponseResult.success(); return ResponseResult.success();
......
...@@ -30,6 +30,13 @@ public interface DatasetVersionService extends IBaseService<DatasetVersion, Long ...@@ -30,6 +30,13 @@ public interface DatasetVersionService extends IBaseService<DatasetVersion, Long
*/ */
void saveNewBatch(List<DatasetVersion> datasetVersionList); void saveNewBatch(List<DatasetVersion> datasetVersionList);
/**
* 写入json格式路径
* @param datasetVersion
* @throws IOException 异常
*/
boolean saveDatasetJsonPath(DatasetVersion datasetVersion) throws IOException;
/** /**
* 存储到python数据集中并进行更新操作 * 存储到python数据集中并进行更新操作
* @param versionName * @param versionName
......
...@@ -315,7 +315,8 @@ public class DatasetVersionServiceImpl extends BaseService<DatasetVersion, Long> ...@@ -315,7 +315,8 @@ public class DatasetVersionServiceImpl extends BaseService<DatasetVersion, Long>
* @param datasetVersion * @param datasetVersion
* @throws IOException 异常 * @throws IOException 异常
*/ */
public boolean saveDatasetJsonPath(DatasetVersion datasetVersion) throws IOException{ @Override
public boolean saveDatasetJsonPath(DatasetVersion datasetVersion) throws IOException {
//导入时不需要写入到json文件中 //导入时不需要写入到json文件中
String versionName = datasetVersion.getVersionName(); String versionName = datasetVersion.getVersionName();
//先存储文件 //先存储文件
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment