Merge branch 'feature/admin' into preview
commit
90bed7d0b0
|
@ -3,6 +3,7 @@ package com.mcwl.web.controller.resource;
|
|||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.common.core.domain.R;
|
||||
import com.mcwl.common.utils.obs.ObsUtils;
|
||||
import com.mcwl.resource.domain.request.RequestFile;
|
||||
import com.mcwl.resource.service.impl.FileServiceImpl;
|
||||
import com.mcwl.web.controller.common.OssUtil;
|
||||
import com.obs.services.ObsClient;
|
||||
|
@ -321,4 +322,11 @@ public class FileController {
|
|||
// return R.ok(key);
|
||||
// }
|
||||
|
||||
|
||||
@PostMapping("/updateFileData")
|
||||
public R updateFileData(@RequestBody RequestFile requestFile){
|
||||
|
||||
return fileService.updateFileData(requestFile);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
|||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
|
@ -17,6 +18,8 @@ import lombok.NoArgsConstructor;
|
|||
* @Description TODO
|
||||
* @Date:2025/1/8 19:38
|
||||
*/
|
||||
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
package com.mcwl.resource.domain.request;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 加密后文件修改
|
||||
*
|
||||
* @author DaiZibo
|
||||
* @date 2025/3/14
|
||||
* @apiNote
|
||||
*/
|
||||
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Data
|
||||
public class RequestFile {
|
||||
|
||||
/**
|
||||
* 版本ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private String fileType;
|
||||
|
||||
/**
|
||||
* 秘钥
|
||||
*/
|
||||
private String keyRate;
|
||||
|
||||
/**
|
||||
* 加密后文件地址
|
||||
*/
|
||||
private String encryptionFilePath;
|
||||
|
||||
/**
|
||||
* 加密后文件key
|
||||
*/
|
||||
private String encryptionObjectKey;
|
||||
|
||||
/**
|
||||
* 加密后文件大小
|
||||
*/
|
||||
private String encryptFileSize;
|
||||
|
||||
}
|
|
@ -2,6 +2,7 @@ package com.mcwl.resource.service;
|
|||
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.common.core.domain.R;
|
||||
import com.mcwl.resource.domain.request.RequestFile;
|
||||
|
||||
/**
|
||||
* @author DaiZibo
|
||||
|
@ -15,4 +16,6 @@ public interface FileService {
|
|||
AjaxResult selectFile(String name, String type);
|
||||
|
||||
R selectHash(String hashCode, Integer type);
|
||||
|
||||
R updateFileData(RequestFile requestFile);
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.mcwl.common.core.domain.R;
|
|||
import com.mcwl.common.utils.StringUtils;
|
||||
import com.mcwl.resource.domain.ModelVersion;
|
||||
import com.mcwl.resource.domain.WorkFlowVersion;
|
||||
import com.mcwl.resource.domain.request.RequestFile;
|
||||
import com.mcwl.resource.mapper.ModelVersionMapper;
|
||||
import com.mcwl.resource.mapper.WorkFlowVersionMapper;
|
||||
import com.mcwl.resource.service.FileService;
|
||||
|
@ -109,4 +110,33 @@ public class FileServiceImpl implements FileService {
|
|||
return R.ok(1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public R updateFileData(RequestFile requestFile) {
|
||||
|
||||
//校验是否是模型
|
||||
if (requestFile.getFileType().equals("model")){
|
||||
|
||||
//修改模型
|
||||
ModelVersion modelVersion = ModelVersion.builder().id(requestFile.getId())
|
||||
.keyRate(requestFile.getKeyRate())
|
||||
.encryptionFilePath(requestFile.getEncryptionFilePath())
|
||||
.encryptionObjectKey(requestFile.getEncryptionObjectKey()).build();
|
||||
|
||||
versionMapper.updateById(modelVersion);
|
||||
|
||||
return R.ok();
|
||||
}else {
|
||||
|
||||
//修改工作流
|
||||
// WorkFlowVersion workFlowVersion = WorkFlowVersion.builder().id(requestFile.getId())
|
||||
// .keyRate(requestFile.getKeyRate())
|
||||
// .encryptionFilePath(requestFile.getEncryptionFilePath())
|
||||
// .encryptionObjectKey(requestFile.getEncryptionObjectKey()).build();
|
||||
//
|
||||
// versionMapper.updateById(modelVersion);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue