Replies - Gachon-P-project/Back GitHub Wiki
κ²μλ¬Όμ λκΈμ μμ±, μ‘°ν, μμ , μμ νλ λ‘μ§
- λκΈ μμ±
- λλκΈ μμ±
- μ 체 λκΈ μ‘°ν
λκΈ μμ λλκΈ μμ - λκΈ μμ
- λλκΈ μμ
-
URL
/replies/subject
-
Method
POST
-
Data Params
μ΄λ¦ | μ€λͺ | νμ | νμ |
---|---|---|---|
user_no | μ¬μ©μ νλ² | Int | O |
post_no | κ²μκΈ λ²νΈ | Int | O |
reply_contents | λκΈ λ΄μ© | VARCHAR(150) | O |
- Sample Call
http://localhost:17394/replies/subject
- 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/subject/reply
-
Method
POST
-
URL Params
μ΄λ¦ | μ€λͺ | νμ | νμ |
---|---|---|---|
userNo | μ¬μ©μ νλ² | Int | O |
postNo | κ²μκΈ λ²νΈ | Int | O |
replyNo | λκΈ λ²νΈ | Int | O |
- Data Params
μ΄λ¦ | μ€λͺ | νμ | νμ |
---|---|---|---|
user_no | μ¬μ©μ νλ² | Int | O |
post_no | κ²μκΈ λ²νΈ | Int | O |
reply_no | λκΈ λ²νΈ | Int | O |
reply_contents | λκΈ λ΄μ© | VARCHAR(150) | O |
- Sample Call
http://localhost:17394/replies/subject/reply
- Data Input Exaple:
{
"user_no": "201739412",
"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/subject/:post_no
-
Method
GET
-
URL Params
μ΄λ¦ | μ€λͺ | νμ | νμ |
---|---|---|---|
post_no | κ²μκΈ λ²νΈ | Int | O |
- Sample Call
http://localhost:17394/replies/subject/519
-
Success Response
Code: 200
Content:
[
{
"reply_no": 173,
"reply_contents": "첫 λ²μ§Έ λκΈμ
λλ€!!",
"wrt_date": "2021-1-10 0:10:25",
"user_no": 201739412,
"post_no": 519,
"depth": 0,
"bundle_id": 1,
"is_deleted": 0,
"nickname": "νΉμ짱123"
}
]
-
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/rereply/:id
-
Method
PUT
-
URL Params
μ΄λ¦ | μ€λͺ | νμ | νμ |
---|---|---|---|
id | λκΈ λ²νΈ(μ 체 λκΈ μ‘°ν μ reply_noλ‘ μ λ¬λλ κ°) | Int | O |
- Data Params
μ΄λ¦ | μ€λͺ | νμ | νμ |
---|---|---|---|
reply_contents | λκΈ λ΄μ© | VARCHAR(150) | O |
- Sample Call
http://localhost:17394/reply/update/rereply/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/subject
-
Method
DELETE
-
Data Params
μ΄λ¦ | μ€λͺ | νμ | νμ |
---|---|---|---|
bundle_id | κ·Έλ£Ήμμ΄λ(λκΈκ³Ό λλκΈμ 그루ννλ κ°) | Int | O |
- Data Input Exaple:
{
"bundle_id": "173"
}
- Sample Call
http://localhost:17394/replies/subject
-
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/subject/reply
-
Method
DELETE
-
Data Params
μ΄λ¦ | μ€λͺ | νμ | νμ |
---|---|---|---|
reply_no | λκΈ λ²νΈ | Int | O |
- Data Input Exaple:
{
"reply_no": "174"
}
- Sample Call
http://localhost:17394/replies/subject/reply
-
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 κ°μ΄ μ‘΄μ¬ν©λλ€." }