Coder Social home page Coder Social logo

3term-mini-back's People

Contributors

bsb99 avatar hoonloper avatar subroooo avatar

Stargazers

 avatar

Forkers

hoonloper bsb99

3term-mini-back's Issues

[report] 신고 API

💡  작성자 프로필 API 명세서

1. 신고 카테고리 조회 API

URL: /moae/report

METHOD: GET

Response

Success

  • Status: 200 OK
  • Content-Type: application/json; charset=utf-8
{
    "success": true,
    "category": [
        {
            "no": 1,
            "content": "욕설및비방"
        },
        {
            "no": 2,
            "content": "개인정보요구"
        },
        {
            "no": 3,
            "content": "사기"
        },
        {
            "no": 4,
            "content": "사적인연락"
        },
        {
            "no": 5,
            "content": "도배"
        },
        {
            "no": 6,
            "content": "선정적인게시물"
        },
        {
            "no": 7,
            "content": "폭력적위협"
        }
    ]
}

Fail

  • Status: 404 Not Found
  • Content-Type: application/json; charset=utf-8
{
   success: false,
   msg: "신고 카테고리 조회에 실패했습니다."
}

설명

2. 게시판 신고 저장 API

URL: /moae/report/board 예시 : /moae/report/board

METHOD: POST

Request

  • Content-Type: application/json; charset=utf-8
{
    "reportedBoardNo" : 1, 
    "reportUserNo" : 1, 
    "description" : "애자일 게시글 신고"
    "reportId" : [1, 2, 3]
}
{
    "reportedBoardNo" : 25, 
    "reportUserNo" : 14, 
    "description" : "신고합니다.", 
    "reportId" : [2, 5, 7]
}

Response

Success

  • Status: 201 Create
  • Content-Type: application/json; charset=utf-8
{
    "success": true,
    "msg": "게시글 신고가 접수되었습니다."
}

Fail

  • Status: 404 Not Found
  • Content-Type: application/json; charset=utf-8
{
    "success": false,
    "msg": "신고 내용 입력 또는 체크박스를 선택해 주세요."
}

3. 이용자 신고 저장 API

URL: /moae/report/user 예시 : /moae/report/user

METHOD: POST

Request

  • Content-Type: application/json; charset=utf-8
{
    "reportedUserNo" : 1, 
    "reportUserNo" : 1, 
    "description" : "애자일 게시글 신고"
    "reportId" : [1, 2, 3]
}
{
    "reportedUserNo" : 14, 
    "reportUserNo" : 8, 
    "description" : "잘생겨서 신고합니다.", 
    "reportId" : [1, 3, 5]
}

Response

Success

  • Status: 201 Create
  • Content-Type: application/json; charset=utf-8
{
    "success": true,
    "msg": "이용자 신고가 접수되었습니다."
}

Fail

  • Status: 404 Not Found
  • Content-Type: application/json; charset=utf-8
{
    "success": false,
    "msg": "신고 내용 입력 또는 체크박스를 선택해 주세요."
}

[MySQL] DB Table 백업

DB 명 - mini_db

⭐️ 생성 쿼리문

유저 정보 저장 테이블 생성
CREATE TABLE users(
    no INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
    id VARCHAR(255) NOT NULL,
    password VARCHAR(255) NOT NULL,
    mail VARCHAR(255),
    nickname VARCHAR(255),
    name VARCHAR(15) NOT NULL
);
게시글 정보 저장 테이블 생성
CREATE TABLE boards(
	no INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
    user_no INT NOT NULL,
    title VARCHAR(255) NOT NULL,
    description MEDIUMTEXT NOT NULL,
    in_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    modify_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    hit INT NOT NULL DEFAULT 0,
    
    FOREIGN KEY (user_no) REFERENCES users(no) ON UPDATE CASCADE
);
신고된 게시글 저장 테이블
CREATE TABLE report_boards(
	no INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
    reported_board_no INT NOT NULL,
    report_user_no INT NOT NULL,
    description MEDIUMTEXT,
    first_check VARCHAR(30),
    second_check VARCHAR(30),
    third_check VARCHAR(30),
    
    FOREIGN KEY (reported_board_no) REFERENCES boards(no) ON UPDATE CASCADE,
    FOREIGN KEY (report_user_no) REFERENCES users(no) ON UPDATE CASCADE,
    FOREIGN KEY (first_check) REFERENCES report_categories(no) ON UPDATE CASCADE,
    FOREIGN KEY (second_check) REFERENCES report_categories(no) ON UPDATE CASCADE,
    FOREIGN KEY (third_check) REFERENCES report_categories(no) ON UPDATE CASCADE
);
신고된 사용자 저장 테이블 생성
CREATE TABLE report_users(
	no INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
    reported_user_no INT NOT NULL,
    report_user_no INT NOT NULL,
    description MEDIUMTEXT,
    first_check VARCHAR(30),
    second_check VARCHAR(30),
    third_check VARCHAR(30),
    
    FOREIGN KEY (reported_user_no) REFERENCES users(no) ON UPDATE CASCADE,
    FOREIGN KEY (report_user_no) REFERENCES users(no) ON UPDATE CASCADE,
    FOREIGN KEY (first_check) REFERENCES report_categories(no) ON UPDATE CASCADE,
    FOREIGN KEY (second_check) REFERENCES report_categories(no) ON UPDATE CASCADE,
    FOREIGN KEY (third_check) REFERENCES report_categories(no) ON UPDATE CASCADE
);
댓글 저장 테이블 생성
CREATE TABLE comments(
	no INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
    board_no INT NOT NULL,
    user_no INT NOT NULL,
    description MEDIUMTEXT NOT NULL,
    
    FOREIGN KEY (board_no) REFERENCES boards(no) ON UPDATE CASCADE,
    FOREIGN KEY (user_no) REFERENCES users(no) ON UPDATE CASCADE
);
신고 카테고리 테이블 생성
CREATE TABLE report_categories (
	no INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
    content VARCHAR(20) NOT NULL
);

⭐️ 수정 쿼리문

[profile] 작성자 프로필 API

💡  작성자 프로필 API 명세서

설명

1. 작성자 프로필 조회

URL: /moae/profile/:userNo 예시 : /moae/profile/31

METHOD: GET

Request

  • Content-Type: application/json; charset=utf-8

Response

Success

  • Status: 200 OK
  • Content-Type: application/json; charset=utf-8
{
    "success": true,
    "profile": {
        "name": "agile",
        "nickname": "agileGood",
        "mail": "[email protected]",
        "boards": 5
    },
    "msg": "프로필 불러오기에 성공했습니다."
}

예시 :

{
    "success": true,
    "profile": {
        "name": "현경",
        "nickname": "닉네임",
        "mail": "[email protected]",
        "boards": 1
    },
    "msg": "프로필 불러오기에 성공했습니다."
}

Fail

  • Status: 404 Not Found
  • Content-Type: application/json; charset=utf-8
{
   success: false,
   msg: "해당 유저의 정보가 없습니다."
}

[board] 게시판 기능 API

💡 게시판 API 3기

2팀

1.게시판 전체 조회 API

2.게시판 상세 조회 API

6.게시글 삭제 API

1팀

3.게시판 생성 API

4.게시판 수정화면 API

5.게시판 수정 API

7.비회원 특정 게시판 접속 API

8.회원 특정 게시판 접속 API

9.인기 게시글 조회 API

10.게시글 정렬 API

⭐️ 예시

Request

  • Content-Type: application/json; charset=utf-8

Response

Success

  • Status: 201 Created
  • Content-Type: application/json; charset=utf-8

`{

}`

Fail

  • Status: 404 Not Found
  • Content-Type: application/json; charset=utf-8

// 주석 { success: false, msg: "존재하지 않는 API입니다." }

1. 게시판 전체조회 API

URL: /moae/board

METHOD: GET

Request

  • Content-Type: application/json; charset=utf-8
{
   없음
}

Response

Success

  • Status: 200 Okay
  • Content-Type: application/json; charset=utf-8
[
  {
        "no": int,
        "title":  "string",
        "description": "string",
        "inDate": "월/일 시:분", (ex>"02/07 10:10")
        "modifyDate": "월/일 시:분",
        "comments_length": int,
        "hit": int,
        "nickname": "string",
        "id": "string"
   },
   {
        ...
    } 
]

Fail

서버의 코드가 잘못되었거나, 서버 자체에 에러가 났을 경우

  • Status: 500 Server Error
  • Content-Type: application/json; charset=utf-8
{
   success: false,
   msg: "게시글 전체조회 오류입니다. 서버개발자에게 문의해주세요."
}

2. 게시판 상세조회 API

URL: /moae/board/searchBoard?order=(작성자 || 제목)&keyword=(유저가 검색창에 입력한 검색어)
예시 : /moae/board/searchBoard?order=작성자&keyword=정용훈

METHOD: GET

Request

  • Content-Type: application/json; charset=utf-8
{
   없음
}

Response

Success

  • Status: 200 Okay
  • Content-Type: application/json; charset=utf-8
[
  {
        "title": "string",
        "name": "string",
        "in_date": "년-월-일 시간", (ex> 2022-01-24T14:18:58.000Z)
        "description": "string"
    },
   {
       ...
    }
]

Fail

입력해주는 URL형식이 잘못된 경우

  • Status: 404 Not Found
  • Content-Type: application/json; charset=utf-8
{
    "success": false,
    "msg": "정확한 주소를 입력해 주세요."
}

Fail

서버의 코드가 잘못되었거나, 서버 자체에 에러가 났을 경우

  • Status: 500 Server Error
  • Content-Type: application/json; charset=utf-8
{
   success: false,
   msg: "게시글 상세조회 에러입니다, 서버 개발자에게 문의해주세요."
}

3. 게시판 생성 API

URL: /moae/board/create

METHOD: POST

Request

  • Content-Type: application/json; charset=utf-8
{
    "user_no" : Number, 
    "title" : String, 
    "description" : String,
}

예시 :

{
    "user_no" : 8, 
    "title" : "모던애자일 개발실력 거품아님?", 
    "description" : "언벌리버블.",
}

Response

Success

  • Status: 201 Create
  • Content-Type: application/json; charset=utf-8
{
    "success": true,
    "msg": "게시글 등록 성공."
}

Fail

제목 또는 내용이 없을 경우

  • Status: 400 Bad Request
  • Content-Type: application/json; charset=utf-8
{
   success: false,
   msg: "제목 또는 내용을 입력해주세요"
}

Fail

로그인 기능이 추가되면 할게요ㅎㅎ

  • Status: 400 Bad Request
  • Content-Type: application/json; charset=utf-8
{
   success: false,
   msg: "게시글 등록 실패."
}

Fail

서버의 코드가 잘못되었거나, 서버 자체에 에러가 났을 경우

  • Status: 500 Server Error
  • Content-Type: application/json; charset=utf-8
{
   success: false,
   msg: "게시글 생성 기능 에러입니다, 서버 개발자에게 문의해주세요."
}

4. 게시판 수정 화면 API

URL: /moae/board/updatePage/:boardNo/:userNo 예시 : /moae/board/updatePage/25/14

METHOD: GET

Success

  • Status: 200 UpdatePage
  • Content-Type: application/json; charset=utf-8
{
    "success": true,
    "boardInfo": {
        "title": "agile",
        "description": "agile"
    },
    "msg": "게시글 수정화면 접속 성공"
}

Fail

게시글이 없거나 해당 유저가 아닌경우

  • Status: 400 Bad Request
  • Content-Type: application/json; charset=utf-8
{
   success: false,
   msg: "해당 게시글이 존재하지 않습니다"
}

Fail

서버의 코드가 잘못되었거나, 서버 자체에 에러가 났을 경우

  • Status: 500 Server Error
  • Content-Type: application/json; charset=utf-8
{
   success: false,
   msg: "게시글 수정 화면 에러입니다, 서버 개발자에게 문의해주세요."
}

5. 게시판 수정 API

URL: /moae/board/update 예시 : /moae/board/update

METHOD: PUT

Request

  • Content-Type: application/json; charset=utf-8
{
    "title" : String, 
    "description" : String,
    "boardNo" : Number
}

예시 :

{
    "title" : "모던애자일", 
    "description" : "최고bb",
    "boardNo" : 1,
    "userNo" : 1
}

Response

Success

  • Status: 200 Update
  • Content-Type: application/json; charset=utf-8
{
    "success": true,
    "msg": "게시글 수정 성공."
}

Fail

제목 또는 내용이 없을 경우

  • Status: 400 Bad Request
  • Content-Type: application/json; charset=utf-8
{
   success: false,
   msg: "제목 또는 내용을 입력해주세요"
}

Fail

게시글 번호가 맞지 않거나, 작성자가 아닐 경우

  • Status: 400 Bad Request
  • Content-Type: application/json; charset=utf-8
{
   success: false,
   msg: "게시글 수정 실패."
}

Fail

서버의 코드가 잘못되었거나, 서버 자체에 에러가 났을 경우

  • Status: 500 Server Error
  • Content-Type: application/json; charset=utf-8
{
   success: false,
   msg: "게시글 수정 기능 에러입니다, 서버 개발자에게 문의해주세요."
}

6. 게시글 삭제 API

URL: /moae/board/deleteBoard/(삭제할 게시글 번호) 예시 : /moae/board/deleteBoard/1

METHOD: DELETE

Success

게시글 삭제 완료

  • Status: 200 Okay
  • Content-Type: application/json; charset=utf-8
{
   success: true,
   msg: "게시글이 성공적으로 삭제되었습니다."
}

Fail

없는 게시글 번호를 삭제하려고 할 때

  • Status: 403 Forbidden
  • Content-Type: application/json; charset=utf-8
{
   success: false,
   msg: "게시글이 삭제되지 않았습니다."
}

Fail

신고당한 게시글을 삭제하려고 할 때

  • Status: 403 Forbidden
  • Content-Type: application/json; charset=utf-8
{
   success: false,
   msg: "신고당한 게시글은 삭제할 수가 없습니다."
}

Fail

서버의 코드가 잘못되었거나, 서버 자체에 에러가 났을 경우

  • Status: 500 Server Error
  • Content-Type: application/json; charset=utf-8
{
   success: false,
   msg: "게시글 삭제 기능 에러입니다, 서버 개발자에게 문의해주세요."
}

7. 비회원 특정 게시판 접속 API

URL: /moae/board/connect/:boardNo 예시 : /moae/board/connect/1

METHOD: GET

Success

게시판 접속 완료, 댓글 O

  • Status: 201 NonUserConnect
  • Content-Type: application/json; charset=utf-8
{
    "success": true,
    "board": {
        "no": 1,
        "boardWriteUserNo": 14,
        "title": "agile",
        "description": "agile",
        "boardInDate": "01/24 11:12",
        "comments_length": 0,
        "hit": 0,
        "nickname": "nickname"
    },
    "comments": [
        {
            "cmtId": 1,
            "commentUserNo": 1,
            "description": "agile",
            "inDate": "02/03 10:27",
            "nickname": "nickname"
        }
    ],
    "msg": "비회원: 게시글 접속 성공"
}

Success

게시판 접속 완료, 댓글 X

  • Status: 201 NonUserConnect
  • Content-Type: application/json; charset=utf-8
{
    "success": true,
    "board": {
        "no": 1,
        "boardWriteUserNo": 1,
        "title": "agile",
        "description": "agile",
        "boardInDate": "01/24 15:23",
        "comments_length": 0,
        "hit": 0,
        "nickname": "nickname"
    },
    "msg": "비회원: 게시글 접속 성공(댓글 X)"
}

Fail

게시글이 없을 경우

  • Status: 404 Not Found
  • Content-Type: application/json; charset=utf-8
{
   success: false,
   msg: "비회원 : 해당 게시글이 존재하지 않습니다."
}

Fail

서버의 코드가 잘못되었거나, 서버 자체에 에러가 났을 경우

  • Status: 500 Server Error
  • Content-Type: application/json; charset=utf-8
{
   success: false,
   msg: "비회원 게시글 접속 기능 에러입니다, 서버 개발자에게 문의해주세요."
}

8. 회원 특정 게시판 접속 API

URL: /moae/board/connect/:boardNo/:userNo 예시 :/moae/board/connect/1/1

METHOD: GET

Success

게시판 작성자 접속 완료, 댓글 O

  • Status: 200 UserConnect
  • Content-Type: application/json; charset=utf-8
{
    "success": true,
    "boardData": {
        "boardNo": 1,
        "boardWriteUserNo": 1,
        "title": "agile",
        "description": "agile",
        "boardInDate": "01/24 11:12",
        "comments_length": 1,
        "hit": 0,
        "nickname": "백승범 일해라"
    },
    "comments": [
        {
            "cmtId": 1,
            "commentUserNo": 1,
            "description": "modern",
            "inDate": "02/03 10:27",
            "nickname": "nickname"
        }
    ],
    "boardWriter": true,
    "msg": "회원 : 게시글 접속 성공"
}

Success

게시판 작성자 접속 완료, 댓글 X

  • Status: 200 UserConnect
  • Content-Type: application/json; charset=utf-8
{
    "success": true,
    "boardData": {
        "boardNo": 1,
        "boardWriteUserNo": 1,
        "title": "agile",
        "description": "agile",
        "boardInDate": "01/24 15:23",
        "comments_length": 0,
        "hit": 0,
        "nickname": "nickname"
    },
    "boardWriter": true,
    "msg": "회원 : 게시글 접속 성공(댓글 X)"
}

Success

게시판 비작성자 접속 완료, 댓글 O

  • Status: 200 UserConnect
  • Content-Type: application/json; charset=utf-8
{
    "success": true,
    "boardData": {
        "boardNo": 1,
        "boardWriteUserNo": 1,
        "title": "agile",
        "description": "agile",
        "boardInDate": "01/24 11:12",
        "comments_length": 1,
        "hit": 1,
        "nickname": "nickname"
    },
    "comments": [
        {
            "cmtId": 1,
            "commentUserNo": 1,
            "description": "modern",
            "inDate": "02/03 10:27",
            "nickname": "modern"
        }
    ],
    "boardWriter": false,
    "msg": "회원 : 게시글 접속 성공(댓글 O, 작성자 X)"
}

Success

게시판 비작성자 접속 완료, 댓글 X

  • Status: 200 UserConnect
  • Content-Type: application/json; charset=utf-8
{
    "success": true,
    "boardData": {
        "boardNo": 1,
        "boardWriteUserNo": 1,
        "title": "agile",
        "description": "agile",
        "boardInDate": "01/24 15:23",
        "comments_length": 0,
        "hit": 2,
        "nickname": "백승범 일해라"
    },
    "boardWriter": false,
    "msg": "회원 : 게시글 접속 성공(댓글 X, 작성자 X)"
}

Fail

게시글이 없을 경우

  • Status: 404 Not Found
  • Content-Type: application/json; charset=utf-8
{
   success: false,
   msg: "회원 : 해당 게시글이 존재하지 않습니다."
}

Fail

서버의 코드가 잘못되었거나, 서버 자체에 에러가 났을 경우

  • Status: 500 Server Error
  • Content-Type: application/json; charset=utf-8
{
   success: false,
   msg: "회원 게시글 접속 기능 에러입니다, 서버 개발자에게 문의해주세요."
}

9. 인기 게시글 조회 API

URL: /board/hotBoard**

METHOD: GET

Request

Response

게시판 작성자 접속 완료, 댓글 O

  • Status: 200 connect
  • Content-Type: application/json; charset=utf-8
{
    "success": true,
    "hotBoard": [
        {
            "no": 25,
            "title": "today",
            "inDate": "22/01/24 14:18"
        },
        {
            "no": 16,
            "title": "test1",
            "inDate": "22/01/24 11:12"
        },
        {
            "no": 39,
            "title": "",
            "inDate": "22/01/24 16:07"
        },
        {
            "no": 68,
            "title": "test2",
            "inDate": "22/02/03 13:21"
        },
        {
            "no": 66,
            "title": "test2",
            "inDate": "22/02/03 13:20"
        }
    ]
}

Fail

서버의 코드가 잘못되었거나, 서버 자체에 에러가 났을 경우

  • Status: 500 Server Error
  • Content-Type: application/json; charset=utf-8
{
   err: "인기 게시글 조회 에러입니다. 서버 개발자에게 문의하세요."
}

10. 게시판 정렬 API

URL: /moae/board/sort?order=(최신순, 오래된순)
예시 : /moae/board/sort?order=ASC
예시 : /moae/board/sort?order=DESC

METHOD: GET

Request

  • Content-Type: application/json; charset=utf-8
{
   없음
}

Response

Success

  • Status: 200 Okay
  • Content-Type: application/json; charset=utf-8
{
    "success": true,
    "order": [
        {
            "userNo": int,
            "boardNo": int,
            "title": string,
            "description": string,
            "inDate": "02/16 23:41",
            "modifyDate": "02/16 23:41",
            "comments_length": int,
            "hit": int,
            "nickname": string
        },
      {
         ...
      }
   ]
}

Fail

서버의 코드가 잘못되었거나, 서버 자체에 에러가 났을 경우

  • Status: 500 Server Error
  • Content-Type: application/json; charset=utf-8
{
   success: false,
   msg: "전체 게시글 정렬 조회 에러입니다. 서버 개발자에게 문의하세요."
}

[login,register] 로그인, 회원가입 기능 API

💡 로그인 API 3기

목차

1.로그인 API

2.회원가입 API

3.약관동의 API

1.로그인 API

URL: moae/user/login

METHOD: POST

Request

  • Content-Type: application/json; charset=utf-8
{
    "id" : "string",
    "password" : "string"
} 

예시 : (테스트 이걸로 고고고)

{
    "id" : "subro",
    "password" : "1023"
} 

데이터를 보내 주었을 때에 대한 응답
Response

Success

  • Status: 201 Create
  • Content-Type: application/json; charset=utf-8

로그인이 성공한 경우

{
    "success" : "true",
    "msg" : "로그인 성공."
}

Fail

  • Status: 401 Bad Request
  • Content-Type: application/json; charset=utf-8

비밀번호가 틀린 경우

{
    "success" : "false",
    "msg" : "비밀번호가 틀렸습니다"
}

아이디가 없는 경우

{ 
    "success" : "false" , 
    "msg" : "존재하지 않는 아이디입니다." 
}

2.회원가입 API

URL: moae/user/register

METHOD: POST

Request

  • Content-Type: application/json; charset=utf-8
{
    "id" : "string(필수,중복불가)",
    "password" : "string(필수)",
    "passwordConfirm" : "string",
    "mail" : "string(중복불가)",
    "name" : "string(필수)", 
    "nickname" : "string(중복불가)",
    "year" : "int",
    "school" : "int"
} 

image
image

예시 : (테스트 이걸로 고고 id,nickname,mail 중복되었다고 나오면 성공)

{
    "id" : "subro",
    "password" : "1023",
    "mail" : "[email protected]",
    "nickname" : "수브로",
    "year" : "3",
    "school" : "1"
} 

데이터를 보내 주었을 때에 대한 응답
Response

Success

  • Status: 201 Create
  • Content-Type: application/json; charset=utf-8
{
   "success" :  "true" ,
   "msg" : "회원가입이 정상적으로 수행되었습니다."
} 

Fail

  • Status: 401 Bad Request
  • Content-Type: application/json; charset=utf-8

필수 정보를 보내주지 않았을 때

{
   "success" :  "false" ,
   "msg" : "(보내주지 않은 정보)에 해당하는 값을 입력해 주세요"
} 

비밀번호와 비밀번호 확인이 서로 다를 때

{
    "success" : "false",
    "msg" : "비밀번호와 비밀번호 확인이 서로 다릅니다."   
} 

아이디,닉네임,이메일이 중복된 사용자가 이미 있을 때

{
    "success" : "false",
    "msg" : "(중복된 값)는 중복된 값입니다.."   
} 

3.약관동의 API

URL : moae/user/agreement

METHOD: POST

Request

  • Content-Type: application/json; charset=utf-8
{
    "id": string,
    "0": true,
    "1": true,
    "2": true,
    "3": true/false,
    "4": true,
    "5": true
}

Success

  • Status: 201 POST
  • Content-Type: application/json; charset=utf-8

약관동의 정보가 정상적으로 담긴 경우

{
   "success" : "true" ,
    "msg" : "약관동의가 정상적으로 등록되었습니다."
}

Fail

  • Status: 401 Bad Request
  • Content-Type: application/json; charset=utf-8
{
    "success" : "false",
    "msg" : "약관동의가 등록되지 않았습니다."
}

Fail

서버의 코드가 잘못되었거나, 서버 자체에 에러가 났을 경우

  • Status: 500 Server Error
  • Content-Type: application/json; charset=utf-8
{
   msg: "약관동의 오류 입니다. 서버 개발자에게 문의하세요."
}

[comment] 댓글 API

💡 댓글 API

1. 댓글 생성 API

URL: /moae/comment**

METHOD: POST

Request

  • Content-Type: application/json; charset=utf-8
{
    "userNo" : 1,
    "boardNo" : 1,
    "description" : "애자일 파이팅."
}

예시 :

{
    "userNo" : 14,
    "boardNo" : 25,
    "description" : "왕이 넘어지면 킹.콩"
}

Response

Success

  • Status: 201 Create
  • Content-Type: application/json; charset=utf-8
{
    "success": true,
    "msg": "댓글 작성이 완료되었습니다."
}

Fail

댓글 내용이 없을 경우

  • Status: 404 Not Found
  • Content-Type: application/json; charset=utf-8
{
    "success": false,
    "msg": "댓글 내용을 입력해 주세요."
}

Fail

서버의 코드가 잘못되었거나, 서버 자체에 에러가 났을 경우

  • Status: 500 Server Error
  • Content-Type: application/json; charset=utf-8
{
   success: false,
   msg: "댓글 작성 에러입니다, 서버 개발자에게 문의해주세요."
}

2. 댓글 수정 API

URL: /moae/comment**

METHOD: PUT

Success

  • Status: 201 Create
  • Content-Type: application/json; charset=utf-8
{
    "commentId" : 1,
    "writeUserNo" : 1,
    "boardNo" : 1,
    "description" : "agile"
}

예시 :

{
    "commentId" : 6,
    "writeUserNo" : 8,
    "boardNo" : 25,
    "description" : "댓글 수정했습니다."
}

Fail

게시글이 없거나 해당 유저가 아닌경우

  • Status: 400 Bad Request
  • Content-Type: application/json; charset=utf-8
{
   success: false,
   msg: ""
}

Fail

서버의 코드가 잘못되었거나, 서버 자체에 에러가 났을 경우

  • Status: 500 Server Error
  • Content-Type: application/json; charset=utf-8
{
   success: false,
   msg: "댓글 수정 에러입니다, 서버 개발자에게 문의해주세요."
}

3. 댓글 삭제 API

URL: /moae/comment/:cmtNo 예시 : /moae/comment/6

METHOD: DELETE

Response

Success

  • Status: 200 Delete
  • Content-Type: application/json; charset=utf-8
{
    "success": true,
    "msg": "댓글 삭제가 완료되었습니다."
}

Fail

서버의 코드가 잘못되었거나, 서버 자체에 에러가 났을 경우

  • Status: 500 Server Error
  • Content-Type: application/json; charset=utf-8
{
   success: false,
   msg: "댓글 삭제 에러입니다, 서버 개발자에게 문의해주세요."
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.