|
Request method |
url |
body |
설명 |
Response ststus code |
message |
| 회원가입 (예시) |
POST |
/users/signup |
{ "email" : "[email protected]", "password" : "test1234", "nickname" : "startup", "profile_image" : "https://image.kr/img.jpg"} |
필수 email: String password: String nickname: String선택 profile_image: String |
201 |
{ "message" : "register_success", "data" : { "user_id" : 1 }} |
|
|
|
|
|
400 |
{ "message" : "invalid_request", "data" : null} |
|
|
|
|
|
500 |
{ "message" : "internal_server_error", "data" : null} |
| 로그인 |
POST |
/users/login |
{ "email" : "[email protected]", "password" : "test1234",} |
email : StringPassword : String |
201 |
{ "message" : "login_success", "data" : { "user_id" : 1 }} |
|
|
|
|
|
401 |
{ "message" : "Wrong ID/PW", "data" : null} |
|
|
|
|
|
500 |
{ "message" : "internal_server_error", "data" : null} |
|
|
|
|
|
|
|
| 게시글 목록 조회 |
GET |
/post/{user_id} |
# 게시글 작성은 어떻게 해야 하는 것인가 # |
title : Stringnickname : String |
200 |
{ "message" : "result", "data" : { "title" : "제목 1", "likes": "좋아요 0", "comments": "댓글 0", "views" : 조회수 0, "Posttime": "2021-01-01 00:00:00", "profile-image": "https://image.kr/img.jpg", "nickname": "더미 작성자 1" }} |
|
|
|
|
|
401 |
"{ ""message"" : "Information Not Exists", ""data"" : null}" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 게시글 작성 |
POST |
/post-fix |
{title : "제목 1", text: "잡다한 이야기", image:"text.png"} |
title : Stringtext: Stringimage: String |
200 |
{ "message": "Post was fixed!, "data": { post_number: 1} |
|
|
|
|
|
401 |
"{ ""message"" : "Please fill the text", ""data"" : null}" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 게시글 상세조회 |
POST |
/post-detail/{post_number} |
{ comment : "댓글 예시 입력!"} |
comment : String |
200 |
"{ ""message"" : "comment_register", ""data"" : { comment_number: 1}" |
|
|
|
|
|
401 |
{ "message" : "Only members can use comment functions", "data" : null } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 게시글 상세조회 |
PATCH |
/post-detail/{comment_number} |
{ new_comment :"댓글 이걸로 수정!"} |
new_comment : String |
200 |
"{ ""message"" : "comment is changed to new comment", ""data"" : { comment_number: 2}" |
|
|
|
|
|
403 |
"{ ""message"" : "Only writer can fix comment", ""data"" : null}" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 게시글 상세조회 |
DELETE |
/post-detail/{comment_number} |
|
|
200 |
{ ""message"" : "comment was deleted", } |
|
|
|
|
|
403 |
{ ""message"" : "Only writer can delete comment", "data" : null } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 게시글 상세조회 |
POST |
/post-detail/{post_number} |
{ post : "글 입력!"} |
(필수)post : String |
200 |
"{ ""message"" : "comment_register", ""data"" : { comment_number: 1}" |
|
|
|
|
|
401 |
{ "message" : "Only members can use comment functions", "data" : null } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 게시글 상세조회 |
PATCH |
/post-detail/{post_number} |
{ new_post :"글 수정!"} |
(필수)new_post : String |
200 |
"{ ""message"" : "post was changed", ""data"" : { comment_number: 2}" |
|
|
|
|
|
403 |
"{ ""message"" : "Only writer can fix the post", ""data"" : null}" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 회원정보 수정 |
DELETE |
/fix-info/{user_id} |
|
|
200 |
"{ ""message"" : "Deleted your information",}" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 회원정보 수정2 |
PATCH |
/fix-info2/{user_id}/{password} |
{password : "test1234",password_check:"test1234"} |
필수password : Stringpassword_check : String |
200 |
{ "message" : "Your password was changed",} |
|
|
|
|
|
403 |
{ "message" : "Password is not same",} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|