Skip to content

files API

jisoo edited this page Dec 4, 2019 · 5 revisions

- URI

Method URI Feat
POST /api/projects/:project_id/files ํŒŒ์ผ ์ƒ์„ฑ
PATCH /api/projects/:project_id/files/:file_id ํŒŒ์ผ ์ˆ˜์ •
DELETE /api/projects/:project_id/files/:file_id ํŒŒ์ผ ์‚ญ์ œ

- ํŒŒ์ผ ์ƒ์„ฑ

์‹œ๋‚˜๋ฆฌ์˜ค

  1. projet_id ๊ฐ’์œผ๋กœ ์‹๋ณ„ํ•˜์—ฌ ํ•ด๋‹น ํ”„๋กœ์ ํŠธ์— ํŒŒ์ผ์„ ์ถ”๊ฐ€ํ•œ๋‹ค.

URI

POST /api/projects/:project_id/files 

Request

{
	"parentId": ๋ถ€๋ชจ ๋””๋ ‰ํ† ๋ฆฌ์˜ id,
	"name": ํŒŒ์ผ ์ด๋ฆ„,
	"type": ํŒŒ์ผ ํƒ€์ž…,
	"contents": ํŒŒ์ผ ๋‚ด์šฉ(๋””๋ ‰ํ† ๋ฆฌ ํƒ€์ž…์ธ ๊ฒฝ์šฐ ํ•„์š”์—†์Œ)
}

Response

201 : Ok
{}
400 : Bad Request
{}

- ํŒŒ์ผ ์ˆ˜์ •

์‹œ๋‚˜๋ฆฌ์˜ค

  1. file_id ๊ฐ’์œผ๋กœ ํ•ด๋‹น ํŒŒ์ผ์„ ์‹๋ณ„ํ•˜์—ฌ ์ˆ˜์ •ํ•œ๋‹ค.

URI

PATCH /api/projects/:project_id/files/:file_id

Request

{
	"contents": ๋‚ด์šฉ ๋ณ€๊ฒฝ์‹œ
	"name": ์ด๋ฆ„ ๋ณ€๊ฒฝ์‹œ
	"newParentId": ํŒŒ์ผ ์œ„์น˜ ๋ณ€๊ฒฝ์‹œ
	"oldParentId": ํŒŒ์ผ ์œ„์น˜ ๋ณ€๊ฒฝ์‹œ
}

Response

200 : Ok
{}
400 : Bad Request
{}

- ํŒŒ์ผ ์‚ญ์ œ

์‹œ๋‚˜๋ฆฌ์˜ค

  1. file_id ๊ฐ’์œผ๋กœ ํ•ด๋‹น ํŒŒ์ผ์„ ์‹๋ณ„ํ•˜์—ฌ ์‚ญ์ œํ•œ๋‹ค.

URI

DELETE /api/projects/:project_id/files/:file_id

Request

{
    "parentId": ์‚ญ์ œํ•  ํŒŒ์ผ์˜ ๋ถ€๋ชจ ๋””๋ ‰ํ† ๋ฆฌ id
}

Response

204 : Ok
{}
400 : Bad Request
{}

๊ธฐํš ๐Ÿ’ก
๊ทœ์น™ ๐Ÿ›
API ๋ฌธ์„œ ๐Ÿง‘๐Ÿปโ€๐Ÿ’ป
Style Guides ๐Ÿ“‹
์Šคํ”„๋ฆฐํŠธ ๐Ÿ”–
๋ฐ์ผ๋ฆฌ ์Šคํฌ๋Ÿผ ๐Ÿ“
์˜ค๋Š˜์˜ ํšŒ๊ณ  โšพ๏ธ
ํšŒ์˜๋ก ๐Ÿ“„

ํšŒ์˜๋ก

๊ธฐ์ˆ ๊ณต์œ  ๐Ÿ”ฅ
Clone this wiki locally