view List of the posts

retrieve list of the posts of selected board

GET /boards/{boardId}/posts

<Description of the endpoint>

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Response

{
    "totalCount": 1,
    "posts": [
        {
            "postId": 1,
            "writerId": 1,
            "anonymity": true,
            "content": "글글글",
            "createdAt": "2023-07-26T01:06:55.323",
            "updatedAt": "2023-07-26T01:06:55.323"
        },
        {
            "postId": 2,
            "writerId": 1,
            "anonymity": true,
            "content": "글글글2",
            "createdAt": "2023-07-26T01:06:55.323",
            "updatedAt": "2023-07-26T01:06:55.323"
        }
    ]
}

피드백 받은 내용

  • writer - nickname 대신 id로 변경

// feedback code
{
  "postId": 1,
  "count": 2,
  "comments": [
    {
      "commentId": 1,
      "text": "우왕 내용이당",
      "commentor": "익명1",
      "createdAt": "2023-07-26T01:06:55.323",
      "updatedAt": "2023-07-26T01:06:55.323"
    },
    {
      "commentId": 2,
      "text": "우하하하하",
      "commentor": "익명2",
      "createdAt": "2023-07-26T01:06:55.323",
      "updatedAt": "2023-07-26T01:06:55.323"
    }
  ]
}
// 내 원래 코드 - 수정한 ver은 위에 
[
  {
    "id": 1,
    "userId": "1",
    "anonimity": true,
    "content": "글입니다.",
    "createdAt": 2023-07-26 01:06:55.323,
    "updatedAt": 2023-07-26 01:06:55.323
  },
  {
    "id": 2,
    "userId": "1",
    "anonimity": false,
    "content": "배고파요",
    "createdAt": 2023-10-26 01:06:55.323,
    "updatedAt": 2023-11-26 01:06:55.323
  }
]

Last updated