Likes - Gachon-P-project/Back GitHub Wiki

κ°œμš”

κ²Œμ‹œκΈ€ μ’‹μ•„μš” 둜직 (μ’‹μ•„μš”ν•œ κΈ€μ˜ μ’‹μ•„μš” λ²„νŠΌμ„ λ‹€μ‹œ λˆ„λ₯΄λ©΄ μ’‹μ•„μš” μ·¨μ†Œ)

κ²Œμ‹œκΈ€ μ’‹μ•„μš”/μ’‹μ•„μš” μ·¨μ†Œ (O)

  • URL

    /likes

  • Method

    POST

  • Data Params

이름 μ„€λͺ… νƒ€μž… ν•„μˆ˜
post_no κ²Œμ‹œκΈ€ 번호 INT O
user_no μ‚¬μš©μž ν•™λ²ˆ INT O
board_flag κ²Œμ‹œνŒ μ’…λ₯˜(0 : κ³Όλͺ©κ²Œμ‹œνŒ, 1 : μžμœ κ²Œμ‹œνŒ, 2 : ν•™κ³Όκ²Œμ‹œνŒ) O
  • Data Input Sample
{ 
    "post_no": "519",
    "user_no": "201739412",
    "board_flag": "1"
}
  • Sample Call
http://localhost:17394/likes
  • Success Response - (μ’‹μ•„μš”)
Code: 200
{
    "fieldCount": 0,
    "affectedRows": 1,
    "insertId": 15,
    "serverStatus": 2,
    "warningCount": 0,
    "message": "",
    "protocol41": true,
    "changedRows": 0
}
  • Success Response - (μ’‹μ•„μš” μ·¨μ†Œ)
Code: 200
{
    "fieldCount": 0,
    "affectedRows": 1,
    "insertId": 0,
    "serverStatus": 34,
    "warningCount": 0,
    "message": "",
    "protocol41": true,
    "changedRows": 0
}
  • Error Response
Code: 400 BAD REQUEST
Content: { error : "null 값이 μ‘΄μž¬ν•©λ‹ˆλ‹€." }

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

μ’‹μ•„μš” 수 쑰회

  • URL

    /likes/:post_no

  • Method

    GET

  • URL Params

이름 μ„€λͺ… νƒ€μž… ν•„μˆ˜
post_no κ²Œμ‹œλ¬Ό 번호 Int O
  • Sample Call
http://localhost:17394/likes/519
  • Success Response
Code: 200
Content:
{
    "like_cnt": 1
}
  • Error Response
Code: 400 BAD REQUEST
Content: { error : "null 값이 μ‘΄μž¬ν•©λ‹ˆλ‹€." }

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