
Server for Dapli
$ pip3 install django djangorestframework
$ git clone https://github/dapli-2018/dapli-server
$ cd dapli-server
$ python3 manage.py makemigrations
$ python3 manage.py migrate
$ python3 manage.py runserver 0.0.0.0:<port>
- GroupPlaylist 생성
- url: group/host/
- method: POST
- request
| Data |
Description |
Type |
| songs |
required |
Array |
| title |
required |
String |
| Author |
required |
String |
| Content |
required |
String |
| tag |
required |
String |
songs는 [[title, artist, album], ...] 형태의 이중 nested array
| Name |
Type |
| id |
Number(Integer) |
| key |
Number(Integer) |
| Code |
Description |
| 201 |
Success |
| 412 |
Input data is wrong |
| 503 |
Too many users. Wait a minute. |
- GroupPlaylist 제거
- url: group/host
- method: DELETE
- request
| Data |
Description |
Type |
| id |
required |
Number(Integer) |
-
response : status code
-
status code:
| Code |
Description |
| 200 |
Success |
| 412 |
Input data is wrong |
- Indices 리스트 동기화
- url: group/host/
- method: GET
- request
| Data |
Description |
Type |
| id |
required |
Number(Integer) |
songs는 [[title, is_on_playlist, is_played], ...] 형태의 이중 nested array
| Code |
Description |
| 200 |
Success |
| 412 |
Input data is wrong |
- GroupPlaylist 동기화: Host랑 동일
- url: group/guest/
- method: GET
- request
| Data |
Description |
Type |
| key |
required |
Number(Integer) |
| Name |
Type |
| id |
Number(Integer) |
| songs |
Array |
| songs는 [[title, artist, album, is_on_playlist, is_played], ...] 형태의 이중 nested array |
|
| Code |
Description |
| 200 |
Success |
- GroupPlaylist 업데이트
- url: group/guest/
- method: PUT
- request
| Data |
Description |
Type |
| id |
Number(Integer) |
|
| songs |
required |
Array |
| songs는 [[title, artist, album, is_on_playlist, is_played], ...] 형태의 이중 nested array |
|
|
-
response : status code
-
status code:
| Code |
Description |
| 200 |
Success |
| 412 |
Input data is wrong |
- key 가져오기 by id
- url: group/keygen
- method: GET
- request:
| Data |
Description |
Type |
| id |
Required |
Number(Integer) |
| Code |
Description |
| 200 |
Success |
| 404 |
Key does not exist |
| 412 |
Input data is wrong |
- key 발급
- url: group/keygen
- method: POST
- request:
| Data |
Description |
Type |
| id |
Required |
Number(Integer) |
| Code |
Description |
| 201 |
Created |
| 412 |
Input data is wrong |
- 키 만료
- url: group/keygen
- method: DELETE
- request:
| Data |
Description |
Type |
| key |
required |
Number(Integer) |
| Code |
Description |
| 200 |
Success |
- playlist image 가져오기
- url: group/image
- method: GET
- request:
| Data |
Description |
Type |
| id |
required |
Number(Integer) |
- response : status code and JSON
| Name |
Type |
| image |
String(url of image) |
| Code |
Description |
| 200 |
Success |
- playlist image 업로드
- url: group/image
- method: POST
- request: multipart/form-data (JSON 아님 주의)
| Data |
Description |
Type |
| id |
required |
Number(Integer) |
| image |
required |
image(jpg) |
| Code |
Description |
| 200 |
Success |
- newsfeed
- url: group/newsfeed
- method: GET
- request: None
- response: JSON
[
{
"id": 1,
"title": "Hello Dapli",
"author": "",
"date": "2018-06-29T22:58:28.415651+09:00",
"content": "Hello world and my friends.",
"tag": "#echo"
},
... 이하 생략
]
- playlist
- url: group/playlist
- method: GET
- request:
| Data |
Description |
Type |
| id |
required |
Number(Integer) |
[
{
"title": "The Middle",
"artist": "Zedd",
"album": "The Middle",
"is_on_playlist": true,
"is_played": false
},
... 이하 생략
]
- search
- url: group/search
- method: GET
- request:
| Data |
Description |
Type |
| criterion |
required |
String("title" |
| query |
required |
String |
[
{
"id": 1,
"title": "Hello Dapli",
"author": "",
"date": "2018-06-29T22:58:28.415651+09:00",
"content": "Hello world and my friends.",
"tag": "#echo"
},
... 이하 생략
]
- 좋아요 갯수 가져오기
- url: group/like
- method: GET
- request
| Data |
Description |
Type |
| id |
required |
Number(Integer) |
| Name |
Type |
| count |
Number(Integer) |
- 좋아요 누르기
- url: group/like
- method: POST
- request
| Data |
Description |
Type |
| id |
required |
Number(Integer) |
| Name |
Type |
| count |
Number(Integer) |
This project is licensed under the MIT License - see the LICENSE file for details