diff --git a/flyfish-common/src/main/java/com/flyfish/framework/bean/Result.java b/flyfish-common/src/main/java/com/flyfish/framework/bean/Result.java index 3920508..5808862 100644 --- a/flyfish-common/src/main/java/com/flyfish/framework/bean/Result.java +++ b/flyfish-common/src/main/java/com/flyfish/framework/bean/Result.java @@ -149,6 +149,10 @@ public class Result { return SUCCESS.equals(this.code); } + public T data() { + return this.data; + } + public T getData() { return Frameworks.config.isResultStyle() ? null : data; } diff --git a/flyfish-file/src/main/java/com/flyfish/framework/file/controller/AttachmentUploadController.java b/flyfish-file/src/main/java/com/flyfish/framework/file/controller/AttachmentUploadController.java index 32dd46f..7ef3de2 100644 --- a/flyfish-file/src/main/java/com/flyfish/framework/file/controller/AttachmentUploadController.java +++ b/flyfish-file/src/main/java/com/flyfish/framework/file/controller/AttachmentUploadController.java @@ -6,7 +6,6 @@ import com.flyfish.framework.file.config.UploadConfiguration; import com.flyfish.framework.file.domain.Attachment; import com.flyfish.framework.file.service.AttachmentService; import com.flyfish.framework.file.utils.DownloadUtils; -import com.flyfish.framework.service.BaseService; import org.apache.commons.lang3.StringUtils; import org.springframework.http.codec.multipart.FilePart; import org.springframework.http.server.reactive.ServerHttpRequest; @@ -24,6 +23,7 @@ import java.util.List; /** * 附件上传相关 + * * @author wangyu */ @RestMapping("/attachment") @@ -44,7 +44,7 @@ public class AttachmentUploadController { public Mono>> uploadAttachment(@RequestPart("file") Flux files) { return files.flatMap(attachmentService::upload) .reduce(Result.accept(new ArrayList<>()), ((listResult, attachment) -> { - listResult.getData().add(attachment); + listResult.data().add(attachment); return listResult; })); }