Dream API - mash-up-kr/real-backend GitHub Wiki

name method url
๊ฟˆ ๋ชฉ๋ก ์กฐํšŒ GET /dreams
์ง€๋‚œ ๊ฟˆ ๋ชฉ๋ก ์กฐํšŒ GET /dreams/history
๋‹จ์ผ ๊ฟˆ ์กฐํšŒ GET /dreams/{dreamId}
๊ฟˆ ์ถ”๊ฐ€ POST /dreams
๊ฟˆ ์ˆ˜์ • PUT /dreams/{dreamId}
๊ฟˆ ์‚ญ์ œ DELETE /dreams/{dreamId}
๊ฟˆ ๊ฒฐ๊ณผ ์ถ”๊ฐ€ POST /dreams/{dreamId}/results
๊ฟˆ ๊ฒฐ๊ณผ ์ˆ˜์ • PATCH /dreams/{dreamId}/results

๊ฟˆ ๋ชฉ๋ก ์กฐํšŒ

name method url description
๊ฟˆ ๋ชฉ๋ก ์กฐํšŒ GET /dreams ์š”์ฒญํ•œ ์œ ์ € ์ž์‹ ์˜ ๋ชจ๋“  ๊ฟˆ ๋ชฉ๋ก์„ ์กฐํšŒ(์ง„ํ–‰์ค‘์ธ ๊ฒƒ)

Request

Header

Header Name Required Default Value Description
Authorization true - ๋กœ๊ทธ์ธ/ํšŒ์›๊ฐ€์ž…์„ ํ†ตํ•ด ์–ป์€ ํ† ํฐ๊ฐ’ (token <token>)

Response

Body

Name Data Type Number Description
dreams Dream N ๊ฟˆ์— ๋Œ€ํ•œ ์ •๋ณด
{
    "dreams": [
        {
            "user": {
                "nickname": "test",
                "email": "[email protected]"
            },
            "id": 2,
            "title": "second test",
            "description": "hello, this is test description",
            "start_at": "2019-12-22",
            "complete_by": "2020-12-22",
            "tag": 1,
            "created_at": "2019-12-29T01:39:50.308594+09:00",
            "updated_at": "2019-12-29T01:40:16.151289+09:00",
            "is_completed": false
        },
        {
            "user": {
                "nickname": "test",
                "email": "[email protected]"
            },
            "id": 1,
            "title": "first test",
            "description": "hello, this is test description",
            "start_at": "2019-12-22",
            "complete_by": "2020-12-22",
            "tag": 0,
            "created_at": "2019-12-29T01:38:43.972922+09:00",
            "updated_at": "2019-12-29T01:38:43.973211+09:00",
            "is_completed": false
        }
    ]
}

์ง€๋‚œ ๊ฟˆ ๋ชฉ๋ก ์กฐํšŒ

name method url description
์ง€๋‚œ ๊ฟˆ ๋ชฉ๋ก ์กฐํšŒ GET /dreams/history ์š”์ฒญํ•œ ์œ ์ € ์ž์‹ ์˜ ์ง€๋‚œ ๋ชจ๋“  ๊ฟˆ ๋ชฉ๋ก์„ ์กฐํšŒ

Request

Header

Header Name Required Default Value Description
Authorization true - ๋กœ๊ทธ์ธ/ํšŒ์›๊ฐ€์ž…์„ ํ†ตํ•ด ์–ป์€ ํ† ํฐ๊ฐ’ (token <token>)

Response

Body

Name Data Type Number Description
dreams Dream N ๊ฟˆ์— ๋Œ€ํ•œ ์ •๋ณด
{
    "dreams": [
        {
            "user": {
                "nickname": "test",
                "email": "[email protected]"
            },
            "id": 2,
            "title": "DREAM2 TITLE CHANG?E",
            "description": "hello, this is test description",
            "start_at": "2019-12-22",
            "complete_by": "2020-12-22",
            "tag": 1,
            "created_at": "2019-12-29T01:39:50.308594+09:00",
            "updated_at": "2019-12-29T01:40:16.151289+09:00",
            "is_completed": true
        }
    ]
}

๋‹จ์ผ ๊ฟˆ ์กฐํšŒ

name method url description
๋‹จ์ผ ๊ฟˆ ์กฐํšŒ GET /dreams/{dreamId} ๋‹จ์ผ ๊ฟˆ์— ๋Œ€ํ•œ ์ƒ์„ธ์ •๋ณด ์กฐํšŒ

Request

Header

Header Name Required Default Value Description
Authorization true - ๋กœ๊ทธ์ธ/ํšŒ์›๊ฐ€์ž…์„ ํ†ตํ•ด ์–ป์€ ํ† ํฐ๊ฐ’ (token <token>)

Response

Body

Name Data Type Number Description
user User 1 ๊ฟˆ ์ž‘์„ฑ์ž ์ •๋ณด
id Integer 1 ๊ฟˆ ID
description String 1 ๊ฟˆ ์ƒ์„ธ ์„ค๋ช…
start_at String 1 ์‹œ์ž‘์ผ
complete_by String 1 ๋ชฉํ‘œ ์ข…๋ฃŒ์ผ
tag Integer 1 ํƒœ๊ทธ ๋ฒˆํ˜ธ
created_at String 1 ๊ฟˆ ์ƒ์„ฑ์ผ
updated_at String 1 ๊ฟˆ ์ตœ์ข… ์ˆ˜์ •์ผ
is_completed Boolean 1 ๊ฟˆ ๋‹ฌ์„ฑ ์—ฌ๋ถ€
complete_at String 0...1 (์™„๋ฃŒ๋œ ๊ฟˆ์ผ ๊ฒฝ์šฐ) ๋‹ฌ์„ฑ ์ผ์ž
review String 0...1 (์™„๋ฃŒ๋œ ๊ฟˆ์ผ ๊ฒฝ์šฐ) ํ›„๊ธฐ
photo String 0...1 (์™„๋ฃŒ๋œ ๊ฟˆ์ผ ๊ฒฝ์šฐ) ์‚ฌ์ง„ url
{
    "user": {
        "nickname": "test",
        "email": "[email protected]"
    },
    "id": 2,
    "title": "DREAM2 TITLE CHANG?E",
    "description": "hello, this is test description",
    "start_at": "2019-12-22",
    "complete_by": "2020-12-22",
    "tag": 1,
    "created_at": "2019-12-29T02:18:14.266897+09:00",
    "updated_at": "2019-12-29T02:18:14.267308+09:00",
    "is_completed": true,
    "complete_at": "2019-12-22",
    "review": "Second dream is completed",
    "photo": ""
}

๊ฟˆ ์ถ”๊ฐ€

name method url description
๊ฟˆ ์ถ”๊ฐ€ POST /dreams ์ƒˆ๋กœ์šด ๊ฟˆ์„ ์ถ”๊ฐ€

Request

Header

Header Name Required Default Value Description
Authorization true - ๋กœ๊ทธ์ธ/ํšŒ์›๊ฐ€์ž…์„ ํ†ตํ•ด ์–ป์€ ํ† ํฐ๊ฐ’ (token <token>)

Body

Name Data Type Required Default Value Description
title String true - ๊ฟˆ์˜ ์ œ๋ชฉ
description String false - ๊ฟˆ์— ๋Œ€ํ•œ ์ƒ์„ธํ•œ ์„ค๋ช…, ๋ชฉํ‘œ ๋“ฑ
start_at Date false ์˜ค๋Š˜ ๋‚ ์งœ ๊ฟˆ ๋‹ฌ์„ฑ์„ ์‹œ์ž‘ํ•  ๋‚ ์ž
complete_by Date false - ๊ฟˆ์„ ์™„๋ฃŒํ•  ๊ธฐํ•œ
tag Integer true - ๊ฟˆ์ด ์†ํ•œ ํƒœ๊ทธ ๋ฒˆํ˜ธ
{
    "title": "second test",
    "description": "hello, this is test description",
    "start_at": "2019-12-22",
    "complete_by": "2020-12-22",
    "tag": 1
}

Response

Body

Name Data Type Number Description
user User 1 ๊ฟˆ ์ž‘์„ฑ์ž ์ •๋ณด
id Integer 1 ๊ฟˆ ID
description String 1 ๊ฟˆ ์ƒ์„ธ ์„ค๋ช…
start_at String 1 ์‹œ์ž‘์ผ
complete_by String 1 ๋ชฉํ‘œ ์ข…๋ฃŒ์ผ
tag Integer 1 ํƒœ๊ทธ ๋ฒˆํ˜ธ
created_at String 1 ๊ฟˆ ์ƒ์„ฑ์ผ
updated_at String 1 ๊ฟˆ ์ตœ์ข… ์ˆ˜์ •์ผ
is_completed Boolean 1 ๊ฟˆ ๋‹ฌ์„ฑ ์—ฌ๋ถ€
{
    "user": {
        "nickname": "test",
        "email": "[email protected]"
    },
    "id": 2,
    "title": "second test",
    "description": "hello, this is test description",
    "start_at": "2019-12-22",
    "complete_by": "2020-12-22",
    "tag": 1,
    "created_at": "2019-12-29T01:39:50.308594+09:00",
    "updated_at": "2019-12-29T01:39:50.308929+09:00",
    "is_completed": false
}

๊ฟˆ ์ˆ˜์ •

name method url description
๊ฟˆ ์ˆ˜์ • PATCH /dreams/{dreamId} ๊ธฐ์กด์˜ ๊ฟˆ ์ˆ˜์ •

Request

Header

Header Name Required Default Value Description
Authorization true - ๋กœ๊ทธ์ธ/ํšŒ์›๊ฐ€์ž…์„ ํ†ตํ•ด ์–ป์€ ํ† ํฐ๊ฐ’ (token <token>)

Body

Name Data Type Required Default Value Description
title String false - ๊ฟˆ์˜ ์ œ๋ชฉ
description String false - ๊ฟˆ์— ๋Œ€ํ•œ ์ƒ์„ธํ•œ ์„ค๋ช…, ๋ชฉํ‘œ ๋“ฑ
start_at Date false - ๊ฟˆ ๋‹ฌ์„ฑ์„ ์‹œ์ž‘ํ•  ๋‚ ์ž
complete_by Date false - ๊ฟˆ์„ ์™„๋ฃŒํ•  ๊ธฐํ•œ
tag String false - ๊ฟˆ์ด ์†ํ•œ ํƒœ๊ทธ
{
	"title": "DREAM2 TITLE CHANG?E"
}

Response

Body

Name Data Type Number Description
user User 1 ๊ฟˆ ์ž‘์„ฑ์ž ์ •๋ณด
id Integer 1 ๊ฟˆ ID
description String 1 ๊ฟˆ ์ƒ์„ธ ์„ค๋ช…
start_at String 1 ์‹œ์ž‘์ผ
complete_by String 1 ๋ชฉํ‘œ ์ข…๋ฃŒ์ผ
tag Integer 1 ํƒœ๊ทธ ๋ฒˆํ˜ธ
created_at String 1 ๊ฟˆ ์ƒ์„ฑ์ผ
updated_at String 1 ๊ฟˆ ์ตœ์ข… ์ˆ˜์ •์ผ
is_completed Boolean 1 ๊ฟˆ ๋‹ฌ์„ฑ ์—ฌ๋ถ€
{
    "user": {
        "nickname": "test",
        "email": "[email protected]"
    },
    "id": 2,
    "title": "DREAM2 TITLE CHANG?E",
    "description": "hello, this is test description",
    "start_at": "2019-12-22",
    "complete_by": "2020-12-22",
    "tag": 1,
    "created_at": "2019-12-29T01:39:50.308594+09:00",
    "updated_at": "2019-12-29T01:40:16.151289+09:00",
    "is_completed": false
}

๊ฟˆ ์‚ญ์ œ

name method url description
๊ฟˆ ์‚ญ์ œ DELETE /dreams/{dreamId} ๋‹จ์ผ ๊ฟˆ ์‚ญ์ œ

Request

Header

Header Name Required Default Value Description
Authorization true - ๋กœ๊ทธ์ธ/ํšŒ์›๊ฐ€์ž…์„ ํ†ตํ•ด ์–ป์€ ํ† ํฐ๊ฐ’ (token <token>)

Response

Body ์—†์Œ(์„ฑ๊ณต์‹œ 204 No Content)


๊ฟˆ ๊ฒฐ๊ณผ ์ถ”๊ฐ€

name method url description
๊ฟˆ ๊ฒฐ๊ณผ ์ถ”๊ฐ€ POST /dreams/{dreamId}/result ๊ฟˆ ๋‹ฌ์„ฑ์‹œ ์ƒ์„ธ ์ •๋ณด ๊ธฐ๋ก

Request

Header

Header Name Required Default Value Description
Authorization true - ๋กœ๊ทธ์ธ/ํšŒ์›๊ฐ€์ž…์„ ํ†ตํ•ด ์–ป์€ ํ† ํฐ๊ฐ’ (token <token>)

Body

Name Data Type Required Default Value Description
complete_at Date true - ๊ฟˆ์˜ ๋‹ฌ์„ฑ ์ผ์ž
review String true - ๊ฟˆ ๋‹ฌ์„ฑ์— ๋Œ€ํ•œ ์ƒ์„ธ ํ›„๊ธฐ, ๋‹ฌ์„ฑ ๋‚ด์šฉ, ๋ฐฉ์‹ ๋“ฑ
photo Date false - ๊ด€๋ จ ์‚ฌ์ง„ (ํ˜„์žฌ ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š” ๊ธฐ๋Šฅ...ใ… ใ…  ์ถ”ํ›„ ์‚ฌ์ง„ ์—…๋กœ๋“œ ๊ตฌํ˜„ ์˜ˆ์ •)
{
    "complete_at": "2019-12-29",
    "review": "First dream is completed"
}

Response

Body

Name Data Type Number Description
user User 1 ๊ฟˆ ์ž‘์„ฑ์ž ์ •๋ณด
id Integer 1 ๊ฟˆ ID
description String 1 ๊ฟˆ ์ƒ์„ธ ์„ค๋ช…
start_at String 1 ์‹œ์ž‘์ผ
complete_by String 1 ๋ชฉํ‘œ ์ข…๋ฃŒ์ผ
tag Integer 1 ํƒœ๊ทธ ๋ฒˆํ˜ธ
created_at String 1 ๊ฟˆ ์ƒ์„ฑ์ผ
updated_at String 1 ๊ฟˆ ์ตœ์ข… ์ˆ˜์ •์ผ
is_completed Boolean 1 ๊ฟˆ ๋‹ฌ์„ฑ ์—ฌ๋ถ€
complete_at String 1 ๋‹ฌ์„ฑ ์ผ์ž
review String 1 ํ›„๊ธฐ
photo String 1 ์‚ฌ์ง„ url
{
    "user": {
        "nickname": "test",
        "email": "[email protected]"
    },
    "id": 1,
    "title": "first test",
    "description": "hello, this is test description",
    "start_at": "2019-12-22",
    "complete_by": "2020-12-22",
    "tag": 0,
    "created_at": "2019-12-29T02:35:48.445150+09:00",
    "updated_at": "2019-12-29T02:35:48.445391+09:00",
    "is_completed": true,
    "complete_at": "2019-12-29",
    "review": "First dream is completed",
    "photo": ""
}

๊ฟˆ ๊ฒฐ๊ณผ ์ˆ˜์ •

name method url description
๊ฟˆ ๊ฒฐ๊ณผ ์ถ”๊ฐ€ PATCH /dreams/{dreamId}/result ๊ฟˆ ๋‹ฌ์„ฑ ๊ฒฐ๊ณผ ์ˆ˜์ •

Request

Header

Header Name Required Default Value Description
Authorization true - ๋กœ๊ทธ์ธ/ํšŒ์›๊ฐ€์ž…์„ ํ†ตํ•ด ์–ป์€ ํ† ํฐ๊ฐ’ (token <token>)

Body

Name Data Type Required Default Value Description
complete_at Date false - ๊ฟˆ์˜ ๋‹ฌ์„ฑ ์ผ์ž
review String false - ๊ฟˆ ๋‹ฌ์„ฑ์— ๋Œ€ํ•œ ์ƒ์„ธ ํ›„๊ธฐ, ๋‹ฌ์„ฑ ๋‚ด์šฉ, ๋ฐฉ์‹ ๋“ฑ
photo Date false - ๊ด€๋ จ ์‚ฌ์ง„ (ํ˜„์žฌ ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š” ๊ธฐ๋Šฅ...ใ… ใ…  ์ถ”ํ›„ ์‚ฌ์ง„ ์—…๋กœ๋“œ ๊ตฌํ˜„ ์˜ˆ์ •)
{
    "review": "First dream is completed!!!! contents changed."
}

Response

Body

Name Data Type Number Description
user User 1 ๊ฟˆ ์ž‘์„ฑ์ž ์ •๋ณด
id Integer 1 ๊ฟˆ ID
description String 1 ๊ฟˆ ์ƒ์„ธ ์„ค๋ช…
start_at String 1 ์‹œ์ž‘์ผ
complete_by String 1 ๋ชฉํ‘œ ์ข…๋ฃŒ์ผ
tag Integer 1 ํƒœ๊ทธ ๋ฒˆํ˜ธ
created_at String 1 ๊ฟˆ ์ƒ์„ฑ์ผ
updated_at String 1 ๊ฟˆ ์ตœ์ข… ์ˆ˜์ •์ผ
is_completed Boolean 1 ๊ฟˆ ๋‹ฌ์„ฑ ์—ฌ๋ถ€
complete_at String 1 ๋‹ฌ์„ฑ ์ผ์ž
review String 1 ํ›„๊ธฐ
photo String 1 ์‚ฌ์ง„ url
{
    "user": {
        "nickname": "test",
        "email": "[email protected]"
    },
    "id": 1,
    "title": "first test",
    "description": "hello, this is test description",
    "start_at": "2019-12-22",
    "complete_by": "2020-12-22",
    "tag": 0,
    "created_at": "2019-12-29T02:35:48.445150+09:00",
    "updated_at": "2019-12-29T02:35:48.445391+09:00",
    "is_completed": true,
    "complete_at": "2019-12-29",
    "review": "First dream is completed!!!! contents changed.",
    "photo": ""
}
โš ๏ธ **GitHub.com Fallback** โš ๏ธ