✔글감별 전체공개 된 글 가져오기 - SangleProject/Sangle GitHub Wiki

메소드 경로 설명
GET /posts/all?topic="#{topic}" 글감별로 전체공개 된 모든 글(다른사람 포함) 가져오기 -> 최신순
GET /posts/all?topic="#{topic}"&filter="popular" 글감별로 전체공개 된 모든 글(다른사람 포함) 가져오기 -> 인기순

지난 글감

Request Header

{
    "Content-Type": "application/json",
    "token" : "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJTQU5HTEUiLCJ1c2VySWR4IjoyLCJleHAiOjE2MDQxMjgyMzJ9.ZIyE8yKyMZyxdE1QBMPYGlllPvWjVyWNosX-r4H7iDo"
}

Response

< Success >

  • /posts/all?topic="#{topic}" 일 때, 최신순
  • "#{topic}" : "해"
[
        {
            "postIdx": 13,
            "profileImg": "https://outsopt26.s3.ap-northeast-2.amazonaws.com/profile7.png",
            "nickName": "ha",
            "myNickName": "d",
            "topic": "",
            "postWrite": "내용",
            "date": "2020.10.04",
            "time": "PM 08:27",
            "day": "",
            "likes": 5,
            "liked": false,
            "modified": true,
            "isBan": false
        },
        {
            "postIdx": 2,
            "profileImg": "https://outsopt26.s3.ap-northeast-2.amazonaws.com/profile7.png",
            "nickName": "s",
            "myNickName": "d",
            "topic": "",
            "postWrite": "둥근해가 떴습니다~",
            "date": "2020.10.03",
            "time": "PM 02:00",
            "day": "",
            "likes": 10,
            "liked": true,
            "modified": false,
            "isBan": false
        }
]

< Success >

  • /posts/all?topic="#{topic}"&filter="popular" 일 때, 인기순
[
        {
            "postIdx": 2,
            "profileImg": "https://outsopt26.s3.ap-northeast-2.amazonaws.com/profile7.png",
            "nickName": "s",
            "myNickName": "효원",
            "topic": "",
            "postWrite": "둥근해가 떴습니다~",
            "date": "2020.10.03",
            "time": "PM 02:00",
            "day": "",
            "likes": 10,
            "liked": true,
            "modified": false,
            "isBan": false
        },
        {
            "postIdx": 13,
            "profileImg": "https://outsopt26.s3.ap-northeast-2.amazonaws.com/profile7.png",
            "nickName": "ha",
            "myNickName": "효원",
            "topic": "",
            "postWrite": "내용",
            "date": "2020.10.04",
            "time": "PM 08:27",
            "day": "",
            "likes": 5,
            "liked": false,
            "modified": true,
            "isBan": false
        }
]
  • postIdx: 글 인덱스
  • profileImg : 프로필 이미지
  • nickName : 글 작성자
  • myNickName : 계정 사용자
  • topic: 글감
  • postWrite: 글 내용
  • date: 작성 년도월일
  • time: 작성 시간
  • day: 작성 요일
  • likes: 좋아요 개수
  • liked: 이미 좋아요 눌렀으면 true, 안 눌렀으면 false
  • modified: 수정여부 (true/false)

< Fail >

  • 토큰값이 없을 때 (400)
{
    "data": null
}
  • 권한 에러 (401)
{
    "data": null
}
  • 데이터베이스 에러 (600)
{
    "data": null
}
  • 서버 내부 에러 (500)
{
    "data": null
}
  • 메소드 에러 (405)
  • 경로 에러 (404 or 400)

⚠️ **GitHub.com Fallback** ⚠️