💰
피드
Postman Mock Server API 주소
- 필수값(required), 데이터 타입 상기 API 문서에 기입완료
- 개발시 호출은 하기와 같은 예시로 하시면 됩니다. (~pstmn.io/(URL API))
- API 문서나 호출시 이상있으면 말씀해주세요 !
게시글 전체 조회 👍
GET /api/v1/posts
Request (param)
Response
나의 게시글 조회 — 마이 페이지에서 쓰이는 API
GET /api/v1/posts/myposts
Request (param)
Response
게시글 작성
POST /api/v1/posts
Request (body)
Response - 200 OK
게시글 수정
PATCH /api/v1/posts/{postId}
Request (body)
Response
게시글 삭제
DELETE /api/v1/posts/{postId}
Request
Response
게시글 좋아요 등록
POST /api/v1/posts/{postId}/likes
Request
Response
게시글 좋아요 삭제
DELETE /api/v1/posts/{postId}/likes
Request
Response
댓글 조회 - offset
GET /api/v1/posts/{postId}/comments
Request (param)
Response
댓글 내용 조회 (텍스트값이 정상으로 들어갔는지 확인용)
GET /api/v1/posts/{postId}/comments/{commentId}
Request
Response
댓글 작성
POST /api/v1/posts/{postId}/comments
Request (body)
Response
댓글 수정
PATCH /api/v1/posts/{postId}/comments/{commentId}
Request (body)
Response
댓글 삭제
DELETE /api/v1/posts/{postId}/comments/{commentId}
Request
Response
얘기 해 볼것
- 댓글도 페이징 할건지?
- 한다. 댓글은 최초 피드 조회시에는 보여주지 않다가, 댓글 조회 request 받으면 size 만큼 할거임
- 댓글 삭제 기록 남길건지(화면에 ”삭제된 댓글 입니다.”)?
- data type, null 허용여부 표기하기
spring multipart
{
"lastPostId": 4,
"size": 10
}
{
"posts": [ //array
{
"postId": 1, //number
"memberId": 1, //number
"nickname": "김팽박이", //string
"mbti": "ENTP", //string
"updatedAt": "2022-02-11 10:11:12", //string
"profileImageUrl": "http://prgrms.stuti/profile/image1.jpg", //string
"contents": "오늘 spring security jwt에 대해서 학습했습니다.", //string
"postImageUrl": "http://prgrms.stuti/post/studyImage1.jpg", //string
"likedMembers":[1,2], //array // number
"totalPostComments": 10 //number
}
],
"hasNext": true //boolean
}
{
"lastPostId" : 4,
"size" : 10
}
{
"posts": [ //array
{
"postId": 1, //number
"memberId": 1, //number
"nickname": "김팽박이", //string
"mbti": "ENTP", //string
"updatedAt": "2022-02-11 10:11:12", //string
"profileImageUrl": "http://prgrms.stuti/profile/image1.jpg", //string
"contents": "오늘 spring security jwt에 대해서 학습했습니다.", //string
"postImageUrl": "http://prgrms.stuti/post/studyImage1.jpg", //string
"likedMembers":[1,2], //array // number
"totalPostComments": 10 //number
}
],
"hasNext": true //boolean
}
{
"contents": "어쩌구 저쩌구 오늘은 이걸 공부해보았습니다.",
"postImage": "image.jpg"
}
{
"postId" : 1 //number
}
{
"contents" : "내용 수정 합니다.",
"postImage" : "image.jpg"
}
{
"postId" : 1 //number
}
요청값 없음. postId는 url뒤에 붙는것으로 함
응답값 없음. HTTP response code 204 (No Content) // 수정 200 OK
요청값 없음. postId는 url뒤에 붙는것으로 함
{
"postLikeId" : 1 //number
}
요청값 없음. commentId는 url뒤에 붙는것으로 함
응답값 없음. HTTP response code 204 (No Content) // 수정 200 OK
{
"lastCommentId": 4,
"size": 10
}
{
"contents": [ //array
{
"postCommentId": 1, //number
"questionId": 1, //number
"parentId": null, //null (부모일때)
"profileImageUrl": "http://prgrms.stuti/image1.jpg", //string
"memberId": 1, //number
"nickname": "팽", //string
"contents": "글이 좋네요 어떤스터디에 참여하고 계신가요?", //string
"updatedAt": "2000-02-22 10:00:00", //(수정 changedAt -> updatedAt) string
"children": [
{
"parentId": 1, //number
"postCommentId": 2,
"questionId": 4,
"profileImageUrl": "http://prgrms.stuti/image33.jpg",
"memberId": 2,
"nickname": "키아",
"contents": "김팽박이라는 스터디에 참여하고있습니다.",
"updatedAt": "2000-02-22 10:00:00"
},
{
"parentId": 1,
"postCommentId": 3,
"questionId": 5,
"profileImageUrl": "http://prgrms.stuti/image33.jpg",
"memberId": 1,
"nickname": "팽",
"contents": "아직 모집중인가요? 저도 참여하고싶습니다.",
"updatedAt": "2000-02-22 10:00:00"
},
{
"parentId": 1,
"postCommentId": 4,
"questionId": 6,
"profileImageUrl": "http://prgrms.stuti/image33.jpg",
"memberId": 2,
"nickname": "키아",
"contents": "네~ 스터디 검색해서 신청해주세요 ~",
"updatedAt": "2000-02-22 10:00:00"
}
]
}
],
"hasNext": true, //boolean
"totalElements": 50 //number
}
요청값 없음. commentId는 url뒤에 붙는것으로 함
{
"postCommentId" : 1, //number
"parentId" : null, // 부모면 null 아니면 number
"contents" : "댓글입니다." //string
}
{
"parentId" : null //최상단 댓글인경우 null, 그 외는 부모의 commnentId
"contents": "댓글입니다."
}
{
"postCommentId": 1, //number
"parentId": null, //부모면 null 아니면 number
"profileImageUrl": "http://prgrms.stuti/image1.jpg", //string
"memberId": 1, //number
"nickname": "팽", //string
"contents": "글이 좋네요 어떤스터디에 참여하고 계신가요?", //string
"updatedAt": "2000-02-22 10:00:00" //string
}
{
"parentId": null, //댓글이면 null 아니면 number
"contents" : "수정된 대댓글입니다." //string
}
{
"postCommentId": 1, //댓글 작성과 동일
"parentId": null,
"profileImageUrl": "http://prgrms.stuti/image1.jpg",
"memberId": 1,
"nickname": "팽",
"contents": "글이 좋네요 어떤스터디에 참여하고 계신가요?",
"updatedAt": "2000-02-22 10:00:00"
}
요청값 없음. commentId는 url뒤에 붙는것으로 함
응답값 없음. HTTP response code 204 (No Content)