Commit 830dd6bc authored by pengxin's avatar pengxin

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

parent a6c3090d
......@@ -122,7 +122,7 @@ public class DatasetVersionController {
*/
@OperationLog(type = SysOperationLogType.UPDATE)
@GetMapping("/publish")
public ResponseResult<Void> publish(@RequestParam("versionId") Long versionId) {
public ResponseResult<Void> publish(@RequestParam("versionId") Long versionId) throws IOException{
String errorMessage;
if (null == versionId) {
errorMessage = "数据验证失败,参数不能为空!";
......@@ -142,7 +142,7 @@ public class DatasetVersionController {
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST, errorMessage);
}
datasetVersion.setReleaseStatus(DatasetConstant.STATUS_PUBLISHED);
if (!datasetVersionService.update(datasetVersion)) {
if (!datasetVersionService.saveDatasetJsonPath(datasetVersion)) {
return ResponseResult.error(ErrorCodeEnum.DATA_NOT_EXIST);
}
return ResponseResult.success();
......
......@@ -30,6 +30,13 @@ public interface DatasetVersionService extends IBaseService<DatasetVersion, Long
*/
void saveNewBatch(List<DatasetVersion> datasetVersionList);
/**
* 写入json格式路径
* @param datasetVersion
* @throws IOException 异常
*/
boolean saveDatasetJsonPath(DatasetVersion datasetVersion) throws IOException;
/**
* 存储到python数据集中并进行更新操作
* @param versionName
......
......@@ -315,7 +315,8 @@ public class DatasetVersionServiceImpl extends BaseService<DatasetVersion, Long>
* @param datasetVersion
* @throws IOException 异常
*/
public boolean saveDatasetJsonPath(DatasetVersion datasetVersion) throws IOException{
@Override
public boolean saveDatasetJsonPath(DatasetVersion datasetVersion) throws IOException {
//导入时不需要写入到json文件中
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