파일 업로드 수정자 추가
This commit is contained in:
@@ -4,6 +4,7 @@ import app.module.core.config.adapters.persistence.entity.UploadFile;
|
|||||||
import app.module.core.config.application.annotation.DeleteCommand;
|
import app.module.core.config.application.annotation.DeleteCommand;
|
||||||
import app.module.core.config.application.annotation.UpdateCommand;
|
import app.module.core.config.application.annotation.UpdateCommand;
|
||||||
import app.module.core.config.application.enums.FileUploadType;
|
import app.module.core.config.application.enums.FileUploadType;
|
||||||
|
import app.module.core.config.application.util.AuditUtil;
|
||||||
import app.module.core.config.application.util.CommonUtil;
|
import app.module.core.config.application.util.CommonUtil;
|
||||||
import app.module.core.config.application.util.SftpFileDeleteUtil;
|
import app.module.core.config.application.util.SftpFileDeleteUtil;
|
||||||
import app.module.core.usecase.file.createFile.ports.CreateFilePortOut;
|
import app.module.core.usecase.file.createFile.ports.CreateFilePortOut;
|
||||||
@@ -34,11 +35,11 @@ class UpdateFileDao implements UpdateFilePortOut {
|
|||||||
@DeleteCommand
|
@DeleteCommand
|
||||||
public void operate(UpdateFileCmd command) {
|
public void operate(UpdateFileCmd command) {
|
||||||
|
|
||||||
List<UploadFileDto> deletedFileList = mapper.findDeleteFileList(new UpdateUploadFileParam(
|
List<UploadFileDto> deletedFileList = mapper.findDeleteFileList(AuditUtil.update(new UpdateUploadFileParam(
|
||||||
command.getId(),
|
command.getId(),
|
||||||
command.getFileMappingIds(),
|
command.getFileMappingIds(),
|
||||||
command.getType().getName()
|
command.getType().getName()
|
||||||
));
|
)));
|
||||||
|
|
||||||
for (UploadFileDto file : deletedFileList) {
|
for (UploadFileDto file : deletedFileList) {
|
||||||
try {
|
try {
|
||||||
@@ -54,13 +55,13 @@ class UpdateFileDao implements UpdateFilePortOut {
|
|||||||
|
|
||||||
if (!deletedFileList.isEmpty()) {
|
if (!deletedFileList.isEmpty()) {
|
||||||
mapper.deleteFile(
|
mapper.deleteFile(
|
||||||
new UpdateUploadFileParam(
|
AuditUtil.delete(new UpdateUploadFileParam(
|
||||||
command.getId(),
|
command.getId(),
|
||||||
deletedFileList.stream().map(UploadFileDto::getId).toList(),
|
deletedFileList.stream().map(UploadFileDto::getId).toList(),
|
||||||
command.getType().getName()));
|
command.getType().getName())));
|
||||||
}
|
}
|
||||||
|
|
||||||
command.getFileMappingIds().forEach(fileId -> mapper.updateFile(new UploadFileDto(fileId, command.getId(),command.getType().getName())));
|
command.getFileMappingIds().forEach(fileId -> mapper.updateFile(AuditUtil.update(new UploadFileDto(fileId, command.getId(),command.getType().getName()))));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user