Free board - Gachon-P-project/Back GitHub Wiki

κ°œμš”

μ‚¬μš©μžκ°€ μžμœ κ²Œμ‹œνŒμ— κ²Œμ‹œλ¬Όμ„ μ‚½μž…, 쑰회, μˆ˜μ •, μ‚­μ œν•˜λŠ” 둜직

κ²Œμ‹œλ¬Ό μž‘μ„±

  • URL

    /board/free

  • Method

    POST

  • Data Params

이름 μ„€λͺ… νƒ€μž… ν•„μˆ˜
post_title κ²Œμ‹œκΈ€ 제λͺ© VARCHAR(60) O
post_contents κ²Œμ‹œκΈ€ λ‚΄μš© VARCHAR(1000) O
wrt_date κ²Œμ‹œκΈ€ μž‘μ„± μ‹œκ°„ varchar(30) O
board_flag κ²Œμ‹œνŒ μ’…λ₯˜(0 : κ³Όλͺ©κ²Œμ‹œνŒ, 1 : μžμœ κ²Œμ‹œνŒ, 2 : ν•™κ³Όκ²Œμ‹œνŒ) INT(11) O
user_no μ‚¬μš©μž ν•™λ²ˆ INT(11) O
  • Query String
이름 μ„€λͺ… νƒ€μž… ν•„μˆ˜
reply_yn λŒ“κΈ€ μ‚¬μš© 유무(0 : μ‚¬μš©μ•ˆν•¨, 1: μ‚¬μš©) VARCHAR(1) X
  • Sample Call
http://localhost:17394/boards/free

or

http://localhost:17394/boards/free?reply_yn=1
  • Data Input Exaple:
{ 
    post_title : "κ²Œμ‹œκΈ€ μž‘μ„± ν…ŒμŠ€νŠΈ 제λͺ©",
    post_contents : "κ²Œμ‹œκΈ€ μž‘μ„± ν…ŒμŠ€νŠΈ λ‚΄μš©",
    reply_yn : "1",
    major_name : "컴퓨터곡학과",
    subject_name : "μ»΄ν“¨ν„°κ³΅ν•™κ°œλ‘ ",
    professor_name : "κΉ€μ§„μ˜",
    user_no : 201739423
}
  • Success Response
Code: 200
Content: { id : 12 }
  • Error Response
Code: 400 BAD REQUEST
Content: { error : "null 값이 μ‘΄μž¬ν•©λ‹ˆλ‹€." }

Code: 401 UNAUTHORIZED
Content: { error : "인증 μ‹€νŒ¨" }

전체 κ²Œμ‹œλ¬Ό 쑰회

  • URL

    /boards/free/:boardFlag/:userNo/:page_num

  • Method

    GET

  • URL Params

이름 μ„€λͺ… νƒ€μž… ν•„μˆ˜
board_flag κ²Œμ‹œνŒ μ’…λ₯˜(0 : κ³Όλͺ©κ²Œμ‹œνŒ, 1 : μžμœ κ²Œμ‹œνŒ, 2 : ν•™κ³Όκ²Œμ‹œνŒ) INT(11) O
user_no μ‚¬μš©μžν•™λ²ˆ INT(11) O
page_num κ°€μ Έμ˜¬ νŽ˜μ΄μ§€ 번호(0λΆ€ν„° μ‹œμž‘) INT(11) O
  • Sample Call
http://localhost:17394/boards/free/1/201739412/0
  • Success Response
Code: 200
Content:
[
    {
        "post_no": 516,
        "post_title": "κ²Œμ‹œκΈ€ μž‘μ„± ν…ŒμŠ€νŠΈ 제λͺ©",
        "post_contents": "κ²Œμ‹œκΈ€ μž‘μ„± ν…ŒμŠ€νŠΈ λ‚΄μš©",
        "wrt_date": "2021. 1. 7. μ˜€ν›„ 12:57:03",
        "reply_yn": "1",
        "major_name": "컴퓨터곡학과",
        "subject_name": "μ»΄ν“¨ν„°κ³΅ν•™κ°œλ‘ ",
        "professor_name": "κΉ€μ§„μ˜",
        "user_no": 201739423,
        "board_flag": "0",
        "nickname": "dddddun",
        "reply_cnt": 0,
        "like_cnt": 0,
        "like_user": 0
    }
]
  • Error Response
Code: 400 BAD REQUEST
Content: { error : "null 값이 μ‘΄μž¬ν•©λ‹ˆλ‹€." }

Code: 401 UNAUTHORIZED
Content: { error : "인증 μ‹€νŒ¨" }

νŠΉμ • κ²Œμ‹œλ¬Ό 쑰회

  • URL

    /boards/free/:boardFlag/:userNo/:word/:page_num

  • Method

    GET

  • URL Params

이름 μ„€λͺ… νƒ€μž… ν•„μˆ˜
board_flag κ²Œμ‹œνŒ μ’…λ₯˜(0 : κ³Όλͺ©κ²Œμ‹œνŒ, 1 : μžμœ κ²Œμ‹œνŒ, 2 : ν•™κ³Όκ²Œμ‹œνŒ) INT(11) O
user_no μ‚¬μš©μžν•™λ²ˆ INT(11) O
word 검색할 단어 String O
page_num κ°€μ Έμ˜¬ νŽ˜μ΄μ§€ 번호(0λΆ€ν„° μ‹œμž‘) INT(11) O
  • Sample Call
http://localhost:17394/boards/free/1/201739412/test/0
  • Success Response
Code: 200
Content:

  • Error Response
Code: 400 BAD REQUEST
Content: { error : "null 값이 μ‘΄μž¬ν•©λ‹ˆλ‹€." }

Code: 401 UNAUTHORIZED
Content: { error : "인증 μ‹€νŒ¨" }

κ²Œμ‹œλ¬Ό μˆ˜μ •

  • URL

    /boards/major

  • Method

    PUT

  • Data Params

이름 μ„€λͺ… νƒ€μž… ν•„μˆ˜
post_no μ„ νƒν•œ κ²Œμ‹œκΈ€μ˜ κΈ€ 번호(전체 κΈ€ μ‘°νšŒμ—μ„œ post_no으둜 받은 번호) Int O
post_title κ²Œμ‹œκΈ€ 제λͺ© VARCHAR(60) O
post_contents κ²Œμ‹œκΈ€ λ‚΄μš© VARCHAR(1000) O
  • Data Input Exaple:
{ 
    "post_no" : "520"
    "post_title" : "κ²Œμ‹œκΈ€ μˆ˜μ • ν…ŒμŠ€νŠΈ 제λͺ©",
    "post_contents" : "κ²Œμ‹œκΈ€ μˆ˜μ • ν…ŒμŠ€νŠΈ λ‚΄μš©"
}
  • Sample Call
http://localhost:17394/boards/subject
  • Success Response
Code: 200
Content:
{
    "fieldCount": 0,
    "affectedRows": 1,
    "insertId": 0,
    "serverStatus": 2,
    "warningCount": 0,
    "message": "Rows matched: 1  Changed: 0  Warnings: 0",
    "protocol41": true,
    "changedRows": 0
}
  • Error Response
Code: 400 BAD REQUEST
Content: { error : "null 값이 μ‘΄μž¬ν•©λ‹ˆλ‹€." }

Code: 401 UNAUTHORIZED
Content: { error : "인증 μ‹€νŒ¨" }

κ²Œμ‹œλ¬Ό μ‚­μ œ

  • URL

    /boards/free

  • Method

    DELETE

  • Data Params

이름 μ„€λͺ… νƒ€μž… ν•„μˆ˜
post_no μ„ νƒν•œ κ²Œμ‹œκΈ€μ˜ κΈ€ 번호(전체 κΈ€ μ‘°νšŒμ—μ„œ post_no으둜 받은 번호) INT(11) O
  • Data Input Exaple:
{ 
    "post_no" : "520"
}
  • Sample Call
http://localhost:17394/boards/free
  • Success Response
Code: 200
Content:
{
    "fieldCount": 0,
    "affectedRows": 1,
    "insertId": 0,
    "serverStatus": 2,
    "warningCount": 0,
    "message": "",
    "protocol41": true,
    "changedRows": 0
}
  • Error Response
Code: 400 BAD REQUEST
Content: { error : "null 값이 μ‘΄μž¬ν•©λ‹ˆλ‹€." }

Code: 401 UNAUTHORIZED
Content: { error : "인증 μ‹€νŒ¨" }
⚠️ **GitHub.com Fallback** ⚠️