UploadResource » 이력 » 버전 1
이름없음, 2024/01/17 12:18
1 | 1 | 이름없음 | h1. UploadResource |
---|---|---|---|
2 | |||
3 | 리소스에 해당하는 파일들을 업로드합니다. |
||
4 | |||
5 | *Martipart-Form 요청 형식* |
||
6 | |||
7 | | key | type | description | |
||
8 | | file | File | 업로드 할 파일 %{color: #ff0000;}(확장자 무관)% | |
||
9 | | operations | Text(one-line) | 표준 GraphQL Post 요청 형식에 따른 쿼리를 작성합니다. | |
||
10 | |||
11 | --- |
||
12 | |||
13 | <pre><code class="java"> |
||
14 | uploadResource( |
||
15 | uploadResourceRequest: UploadResourceRequest |
||
16 | ): UploadLocationResponse |
||
17 | </code></pre> |
||
18 | |||
19 | *UploadResourceRequest* |
||
20 | |||
21 | | field | type | description | |
||
22 | | did | String | snplab의 did | |
||
23 | | path | String | 업로드 한 파일 경로 | |
||
24 | |||
25 | *UploadLocationResponse* |
||
26 | |||
27 | | field | type | description | |
||
28 | | command | String | 요청한 Command 유형 | |
||
29 | | result | [UploadLocationResult] | | |
||
30 | |||
31 | *UploadLocationResult* |
||
32 | |||
33 | | field | type | description | |
||
34 | | fullUrlPath | String | 저장된 파일 경로 | |
||
35 | | originalFilename | String | 저장된 파일의 이름 | |
||
36 | |||
37 | --- |
||
38 | |||
39 | *Request Example* |
||
40 | |||
41 | <pre> |
||
42 | { |
||
43 | "query": "mutation($param:UploadResourceRequest ){ uploadResource(uploadResourceRequest: $param){ command result{ originalFilename fullUrlPath }}}", |
||
44 | "variables": { |
||
45 | "param": { |
||
46 | "did": "NfoPEFaG1adkCpijR85L66", |
||
47 | "path": "data" |
||
48 | } |
||
49 | } |
||
50 | }</pre> |
||
51 | |||
52 | *Response Example* |
||
53 | |||
54 | <pre> |
||
55 | { |
||
56 | "data": { |
||
57 | "uploadResource": { |
||
58 | "command": "uploadResource", |
||
59 | "result": [ |
||
60 | { |
||
61 | "originalFilename": "test.txt", |
||
62 | "fullUrlPath": "https://cdn.myd.world/data/test.txt" |
||
63 | } |
||
64 | ] |
||
65 | } |
||
66 | } |
||
67 | } |
||
68 | </pre> |