Skip to content

[GET] ์งˆ๋ฌธ

NewWisdom edited this page Nov 21, 2020 · 4 revisions

๊ฒŒ์‹œ๊ธ€์— ๋Œ€ํ•œ ์งˆ๋ฌธ ์š”์ฒญ

METHOD PATH EXPLANATION
GET /posts/:classId ๊ฒŒ์‹œ๊ธ€์— ๋Œ€ํ•œ ์งˆ๋ฌธ ์š”์ฒญ

req Header

accessToken : "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZHgiOjgsIm5hbWUiOiLsp4DtmJwiLCJpYXQiOjE1OTcxMTEzNDMsImV4cCI6MTU5NzExNDk0MywiaXNzIjoiZHVrc3VuZyJ9.VE1M6XqCZyrXZry9GWrvmuiMHfSK6BM9iizEkJ3nzoc"

req Query

KEY EXPLANATION TYPE
classId ์–ผ๊ตด ๋ถ€์œ„์˜ ๊ณ ์œ  ๋ฒˆํ˜ธ INTEGER

res Body

๊ฒŒ์‹œ๊ธ€์— ๋Œ€ํ•œ ์งˆ๋ฌธ ๊ฐ€์ ธ์˜ค๊ธฐ ์„ฑ๊ณต

  • questionId๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ๋‹ค๊ฐ€ [POST] /posts ์š”์ฒญ์‹œ ํ•จ๊ป˜ ๋ณด๋‚ด์•ผ ํ•จ.
{
    "status": 200,
    "success": true,
    "message": "๊ฒŒ์‹œ๊ธ€์— ๋Œ€ํ•œ ์งˆ๋ฌธ ๊ฐ€์ ธ์˜ค๊ธฐ ์„ฑ๊ณต",
    "data": [
        {
            "questionId": 10,
            "questionText": "๋ƒ„์ƒˆ๋ฅผ ๋ชป ๋งก๋Š”๋‹ค๋ฉด ์–ด๋–จ ๊ฒƒ ๊ฐ™๋‚˜์š”? "
        }
    ]
}

๊ฒŒ์‹œ๊ธ€์— ๋Œ€ํ•œ ์งˆ๋ฌธ ๊ฐ€์ ธ์˜ค๊ธฐ ์‹คํŒจ

{
    "status": 400,
    "success": false,
    "message": "๊ฒŒ์‹œ๊ธ€์— ๋Œ€ํ•œ ์งˆ๋ฌธ์ด ์—†์Šต๋‹ˆ๋‹ค."
}

INTERNAL SERVER ERROR

{
    "status": 500,
    "message": "์„œ๋ฒ„ ๋‚ด๋ถ€ ์—๋Ÿฌ"
}