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 : "μΈμ¦ μ€ν¨" }