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

κ°œμš”

κ²Œμ‹œλ¬Όμ˜ λŒ“κΈ€μ„ 생성, 쑰회, μˆ˜μ •, μ‚­μ œν•˜λŠ” 둜직

λŒ“κΈ€ μž‘μ„±

  • URL

    /replies/free

  • Method

    POST

  • Data Params

이름 μ„€λͺ… νƒ€μž… ν•„μˆ˜
user_no μ‚¬μš©μž ν•™λ²ˆ Int O
post_no κ²Œμ‹œκΈ€ 번호 Int O
reply_contents λŒ“κΈ€ λ‚΄μš© VARCHAR(150) O
wrt_date κ²Œμ‹œκΈ€ μž‘μ„±μΌ VARCHAR O
  • Sample Call
http://localhost:17394/replies/free
  • Data Input Exaple:
{ 
    "user_no": "201739412",
    "post_no": "519",
    "reply_contents" : "첫 번째 λŒ“κΈ€μž…λ‹ˆλ‹€!!"
}
  • Success Response
Code: 200
Content:
{
    "fieldCount": 0,
    "affectedRows": 1,
    "insertId": 4,
    "serverStatus": 2,
    "warningCount": 0,
    "message": "",
    "protocol41": true,
    "changedRows": 0
}
  • Error Response
Code: 400 BAD REQUEST
Content: { error : "null 값이 μ‘΄μž¬ν•©λ‹ˆλ‹€." }

λŒ€λŒ“κΈ€ μž‘μ„±

  • URL

    /replies/free/reply

  • Method

    POST

  • Data Params

이름 μ„€λͺ… νƒ€μž… ν•„μˆ˜
user_no μ‚¬μš©μž ν•™λ²ˆ Int O
post_no κ²Œμ‹œκΈ€ 번호 Int O
reply_no λŒ“κΈ€ 번호 Int O
reply_contents λŒ“κΈ€ λ‚΄μš© VARCHAR(150) O
wrt_date κ²Œμ‹œκΈ€ μž‘μ„±μΌ VARCHAR O
depth λŒ“κΈ€/λ‹΅κΈ€ μ—¬λΆ€(0:λŒ“κΈ€ 1:λ‹΅κΈ€) Int O
bundle_id 그룹아이디(λŒ“κΈ€κ³Ό λŒ€λŒ“κΈ€μ„ κ·Έλ£¨ν•‘ν•˜λŠ” κ°’) Int O
  • Sample Call
http://localhost:17394/replies/free/reply
  • Data Input Exaple:
{ 
    "user_no": "201739423",
    "post_no": "519",
    "reply_no": "173",
    "reply_contents": "첫 번째 λŒ€λŒ“κΈ€μž…λ‹ˆλ‹€!!"
}
  • Success Response
Code: 200
Content:
{
    "fieldCount": 0,
    "affectedRows": 1,
    "insertId": 4,
    "serverStatus": 2,
    "warningCount": 0,
    "message": "",
    "protocol41": true,
    "changedRows": 0
}
  • Error Response
Code: 400 BAD REQUEST
Content: { error : "null 값이 μ‘΄μž¬ν•©λ‹ˆλ‹€." }

전체 λŒ“κΈ€ 쑰회

  • URL

    /replies/free/:postNo

  • Method

    GET

  • URL Params

이름 μ„€λͺ… νƒ€μž… ν•„μˆ˜
post_no κ²Œμ‹œκΈ€ 번호 Int O
  • Sample Call
http://localhost:17394/replies/free/519
  • Success Response
Code: 200
Content: 
[
    {
        "reply_no": 173,
        "reply_contents": "첫 번째 λŒ“κΈ€μž…λ‹ˆλ‹€!!",
        "wrt_date": "2021-1-10 0:10:25",
        "user_no": 201739423,
        "post_no": 519,
        "depth": 0,
        "bundle_id": 1,
        "is_deleted": 0,
        "nickname": "dddddun"
    }
]
  • Error Response
Code: 400 BAD REQUEST
Content: { error : "null 값이 μ‘΄μž¬ν•©λ‹ˆλ‹€." }

λŒ“κΈ€ μˆ˜μ •

  • URL

    /reply/update/:id

  • Method

    PUT

  • URL Params

이름 μ„€λͺ… νƒ€μž… ν•„μˆ˜
id λŒ“κΈ€ 번호(전체 λŒ“κΈ€ 쑰회 μ‹œ reply_no둜 μ „λ‹¬λ˜λŠ” κ°’) Int O
  • Data Params
이름 μ„€λͺ… νƒ€μž… ν•„μˆ˜
reply_contents λŒ“κΈ€ λ‚΄μš© VARCHAR(150) O
  • Sample Call
http://localhost:17394/reply/update/3
  • Data Input Exaple:
{ 
    "reply_contents" : "λŒ“κΈ€ μˆ˜μ • ν…ŒμŠ€νŠΈ!!"
}
  • Success Response
Code: 200
Content: 
{
    "fieldCount": 0,
    "affectedRows": 0,
    "insertId": 0,
    "serverStatus": 2,
    "warningCount": 0,
    "message": "(Rows matched: 0  Changed: 0  Warnings: 0",
    "protocol41": true,
    "changedRows": 0
}
  • Error Response
Code: 400 BAD REQUEST
Content: { error : "null 값이 μ‘΄μž¬ν•©λ‹ˆλ‹€." }

λŒ€λŒ“κΈ€ μˆ˜μ •

  • URL

    /reply/update/reply/:id

  • Method

    PUT

  • URL Params

이름 μ„€λͺ… νƒ€μž… ν•„μˆ˜
id λŒ“κΈ€ 번호(전체 λŒ“κΈ€ 쑰회 μ‹œ reply_no둜 μ „λ‹¬λ˜λŠ” κ°’) Int O
  • Data Params
이름 μ„€λͺ… νƒ€μž… ν•„μˆ˜
reply_contents λŒ“κΈ€ λ‚΄μš© VARCHAR(150) O
  • Sample Call
http://localhost:17394/reply/update/reply/3
  • Data Input Exaple:
{ 
    "reply_contents" : "λŒ€λŒ“κΈ€ μˆ˜μ • ν…ŒμŠ€νŠΈ!!"
}
  • Success Response
Code: 200
Content: 
{
    "fieldCount": 0,
    "affectedRows": 0,
    "insertId": 0,
    "serverStatus": 2,
    "warningCount": 0,
    "message": "(Rows matched: 0  Changed: 0  Warnings: 0",
    "protocol41": true,
    "changedRows": 0
}
  • Error Response
Code: 400 BAD REQUEST
Content: { error : "null 값이 μ‘΄μž¬ν•©λ‹ˆλ‹€." }

λŒ“κΈ€ μ‚­μ œ

  • URL

    /replies/free/:bundle_id

  • Method

    DELETE

  • Data Params

이름 μ„€λͺ… νƒ€μž… ν•„μˆ˜
bundle_id 그룹아이디(λŒ“κΈ€κ³Ό λŒ€λŒ“κΈ€μ„ κ·Έλ£¨ν•‘ν•˜λŠ” κ°’) Int O
  • Sample Call
http://localhost:17394/replies/free/52
  • 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 값이 μ‘΄μž¬ν•©λ‹ˆλ‹€." }

λŒ€λŒ“κΈ€ μ‚­μ œ

  • URL

    /replies/free/reply/:reply_no

  • Method

    DELETE

  • Data Params

이름 μ„€λͺ… νƒ€μž… ν•„μˆ˜
reply_no λŒ“κΈ€ 번호 Int O
  • Sample Call
http://localhost:17394/replies/free/reply/11
  • 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 값이 μ‘΄μž¬ν•©λ‹ˆλ‹€." }
⚠️ **GitHub.com Fallback** ⚠️