forked from sngular/scs-multiapi-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUploadApi.java
More file actions
50 lines (44 loc) · 1.76 KB
/
Copy pathUploadApi.java
File metadata and controls
50 lines (44 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package com.sngular.multifileplugin.testreactivebinarybodyresource;
import java.util.List;
import java.util.Map;
import java.nio.charset.StandardCharsets;
import javax.validation.Valid;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import org.springframework.http.MediaType;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.core.io.buffer.DefaultDataBufferFactory;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;
import reactor.core.publisher.Flux;
import springfox.documentation.annotations.ApiIgnore;
import org.springframework.core.io.Resource;
public interface UploadApi {
/**
* POST /upload
* @param resource (required)
* @return OK; (status code 200)
* @throws WebClientResponseException if an error occurs while attempting to invoke the API
*/
@Operation(
operationId = "uploadBinary",
tags = {"test"},
responses = {
@ApiResponse(responseCode = "200", description = "OK")
}
)
@RequestMapping(
method = RequestMethod.POST,
value = "/upload",
produces = {"application/json"}
)
default ResponseEntity<Void> uploadBinary(@Parameter(name = "resource", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestBody Mono<Resource> resource, @ApiIgnore final ServerWebExchange exchange) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}
}