API_User - Laterality/yummy-dishes-REST GitHub Wiki


Index


์‚ฌ์šฉ์ž ์ƒ์„ฑ


์‚ฌ์šฉ์ž๋ฅผ ์ƒ์„ฑํ•˜๋Š” API์ž…๋‹ˆ๋‹ค.

  • URL

    /user/register

  • Method:

    POST

  • URL Params

    none

  • Data Params

    Body

    email
    string
    ์‚ฌ์šฉ์ž ์ด๋ฉ”์ผ (์œ ํšจ์„ฑ ๊ฒ€์‚ฌ ํ•„์š”)
    password
    string
    ์•”ํ˜ธํ™”๋˜์ง€ ์•Š์€(raw) ์‚ฌ์šฉ์ž ํŒจ์Šค์›Œ๋“œ (์œ ํšจ์„ฑ ๊ฒ€์‚ฌ ํ•„์š”)
    username
    string
    ์‚ฌ์šฉ์ž ์œ ์ €๋„ค์ž„(์œ ํšจ์„ฑ ๊ฒ€์‚ฌ ํ•„์š”)
    login_type
    string
    ๋กœ๊ทธ์ธ ํ˜•ํƒœ ["native", "google"]
    access_token
    string
    ์™ธ๋ถ€ ํ”Œ๋žซํผ์— ์˜ํ•œ ๊ฐ€์ž…์ธ ๊ฒฝ์šฐ, ์•ก์„ธ์Šค ํ† ํฐ
    phone_number
    string
    ์‚ฌ์šฉ์ž ํœด๋Œ€ํฐ ๋ฒˆํ˜ธ (ํ•˜์ดํ”ˆ('-') ์ œ์™ธ, ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ ํ•„์š”)
    age
    integer
    ์‚ฌ์šฉ์ž ์—ฐ๋ น๋Œ€
    device_id
    string
    ํ‘ธ์‹œ์•Œ๋ฆผ์„ ์œ„ํ•œ device registration id
  • Success Response:

    • Code: 201
      Content:

      { 
      	"result": "ok",
      	"user": UserModel
      }
      
      result
      string
      ์š”์ฒญ์— ๋Œ€ํ•œ ์ฒ˜๋ฆฌ ๊ฒฐ๊ณผ["ok", "fail", "error"]
      message
      string
      ์ฒ˜๋ฆฌ ๊ฒฐ๊ณผ์— ๋Œ€ํ•œ ์ถ”๊ฐ€ ๋ฉ”์‹œ์ง€
      user
      UserModel
      ์š”์ฒญ์ด ์„ฑ๊ณตํ•œ ๊ฒฝ์šฐ ์ƒ์„ฑ๋œ ์‚ฌ์šฉ์ž์— ๋Œ€ํ•œ ์ •๋ณด
  • Error Response:

    • Code: 405 INVALID PARAMETERS
      Content:
      {
      	"result": "fail",
      	"message": "invalid parameters"
      }
      

    OR

    • Code: 409 DUPLICATES
      Content:
      {
      	"result": "fail",
      	"message": "email or username duplicates"
      }
      

    OR

    • Code: 500 SERVER FAULT
      Content:
      {
      	"result": "error",
      	"message": "server fault"
      }
      
  • Sample Call:

    {
      "email": "[email protected]",
      "username": "JohnSmith",
      "password": "p@ssW0rd",
      "login_type": "native",
      "phone_number": "01012345678",
      "age": 20,
      "device_id": "bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1..."
    }
    
  • Notes:

    • ๊ตฌ๊ธ€ ๋“ฑ ํƒ€ ํ”Œ๋žซํผ ๊ณ„์ •์„ ์ด์šฉํ•˜๋Š” ๊ฒฝ์šฐ ๋ณธ API ํ˜ธ์ถœ ์ „์— login API๋ฅผ ๋จผ์ € ํ˜ธ์ถœํ•ด์„œ ๊ฒŒ์ • ์ƒ์„ฑ ๊ฐ€๋Šฅ ์—ฌ๋ถ€๋ฅผ ํ™•์ธํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
    • email, password, username ๋“ฑ์— ๋Œ€ํ•ด API ํ˜ธ์ถœ ์ „์— ๋ฐ˜๋“œ์‹œ ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ๊ฐ€ ์ด๋ฃจ์–ด์ ธ์•ผ ํ•ฉ๋‹ˆ๋‹ค.
    • ํ‘ธ์‹œ์•Œ๋ฆผ๊ณผ ๊ฐœ์ธ์ •๋ณด ์ด์šฉ ๋™์˜๋Š” ์ƒ์„ฑ์‹œ ๊ธฐ๋ณธ๊ฐ’์„ '๋™์˜ํ•จ'์œผ๋กœ ์ƒ์„ฑํ•˜๋ฏ€๋กœ, ํ•„์š”ํ•œ ๊ฒฝ์šฐ ๊ฐฑ์‹  API๋ฅผ ํ˜ธ์ถœํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

์‚ฌ์šฉ์ž ๋กœ๊ทธ์ธ


์‚ฌ์šฉ์ž ๋กœ๊ทธ์ธ API์ž…๋‹ˆ๋‹ค.

  • URL

    /user/login

  • Method:

    POST

  • URL Params

    none

  • Data Params

    Body

    email
    string
    ์‚ฌ์šฉ์ž ์ด๋ฉ”์ผ (์œ ํšจ์„ฑ ๊ฒ€์‚ฌ ํ•„์š”)
    password
    string
    ์•”ํ˜ธํ™”๋˜์ง€ ์•Š์€(raw) ์‚ฌ์šฉ์ž ํŒจ์Šค์›Œ๋“œ (์œ ํšจ์„ฑ ๊ฒ€์‚ฌ ํ•„์š”)
    login_type
    string
    ๋กœ๊ทธ์ธ ํ˜•ํƒœ ["native", "google"]
  • Success Response:

    • Code: 200
      Content:

      {
      	"result": "ok",
      	"message": "redirect to sign up"
      }
      
      result
      string
      ์š”์ฒญ์— ๋Œ€ํ•œ ์ฒ˜๋ฆฌ ๊ฒฐ๊ณผ["ok", "fail", "error"]
      message
      string
      ์ฒ˜๋ฆฌ ๊ฒฐ๊ณผ์— ๋Œ€ํ•œ ์ถ”๊ฐ€ ๋ฉ”์‹œ์ง€
      user
      UserModel
      ๋กœ๊ทธ์ธ์— ์„ฑ๊ณตํ•œ ๊ฒฝ์šฐ ์‚ฌ์šฉ์ž ์ •๋ณด

    OR

    • Code: 201
      Content:
      { 
      	"result": "ok",
      	"user": {
      		...
      	}
      }
      
  • Error Response:

    • Code: 404 NOT FOUND
      Content:
      {
      	result: "fail",
      	message: "email or password incorrect"
      }
      

    OR

    • Code: 405 INVALID PARAMETERS
      Content:
      {
      	"result": "fail",
      	"message": "invalid parameters"
      }
      

    OR

    • Code: 500 SERVER FAULT
      Content:
      {
      	result: "error",
      	message: "server fault"
      }
      
  • Sample Call:

    {
      "email": "[email protected]",
      "password": "p@ssW0rd",
      "login_type": "native",
    }
    
  • Notes:

    • ์™ธ๋ถ€๊ณ„์ • ํšŒ์›์˜ ๊ฒฝ์šฐ ํšŒ์›๊ฐ€์ž… ์ „์— ๋ณธ API๋ฅผ ํ˜ธ์ถœํ•ด์„œ ํšŒ์›๊ฐ€์ž… ์—ฌ๋ถ€๋ฅผ ํ™•์ธํ•ด์ฃผ์„ธ์š”.
    • login_type์ด native๊ฐ€ ์•„๋‹Œ ๊ฒฝ์šฐ status code๊ฐ€ 200์ด๋ฉด ์™ธ๋ถ€๊ณ„์ • ์‚ฌ์šฉ์ž์˜ ํšŒ์›๊ฐ€์ž…์ด ํ•„์š”ํ•œ ๊ฒฝ์šฐ์ด๋ฏ€๋กœ ํด๋ผ์ด์–ธํŠธ์—์„œ ์ด๋ฅผ ์ฒ˜๋ฆฌํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
    • email, password ๋“ฑ์— ๋Œ€ํ•ด API ํ˜ธ์ถœ ์ „์— ๋ฐ˜๋“œ์‹œ ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ๊ฐ€ ์ด๋ฃจ์–ด์ ธ์•ผ ํ•ฉ๋‹ˆ๋‹ค.
    • ํ‘ธ์‹œ์•Œ๋ฆผ๊ณผ ๊ฐœ์ธ์ •๋ณด ์ด์šฉ ๋™์˜๋Š” ์ƒ์„ฑ์‹œ ๊ธฐ๋ณธ๊ฐ’์„ '๋™์˜ํ•จ'์œผ๋กœ ์ƒ์„ฑํ•˜๋ฏ€๋กœ, ํ•„์š”ํ•œ ๊ฒฝ์šฐ ๊ฐฑ์‹  API๋ฅผ ํ˜ธ์ถœํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

์‚ฌ์šฉ์ž ์กฐํšŒ


์‚ฌ์šฉ์ž ์ •๋ณด ์กฐํšŒ API์ž…๋‹ˆ๋‹ค.

  • URL

    /user/{userId}

  • Method:

    GET

  • URL Params

    Required:

    userId
    string
    ์‚ฌ์šฉ์ž์˜ "_id" ํ•„๋“œ ๊ฐ’

    Optional:

    q
    string
    ์š”์ฒญํ•˜๋Š” ์‚ฌ์šฉ์ž ์ •๋ณด(,๋กœ ๋ถ„๋ฆฌ)
    ["login_type", "phone_number", "date_reg", "age", "accept_push", "accept_privacy", "bucket", "tastes", "likes", "comments", "coupons", "cnt_reviewable", "cnt_stamp", "classes_prefer"]
  • Data Params

    None

  • Success Response:

    • Code: 200
      Content:

      {
      	"result": "ok",
      	"User": {
      		...
      	}
      }
      
      result
      string
      ์š”์ฒญ์— ๋Œ€ํ•œ ์ฒ˜๋ฆฌ ๊ฒฐ๊ณผ["ok", "fail", "error"]
      message
      string
      ์ฒ˜๋ฆฌ ๊ฒฐ๊ณผ์— ๋Œ€ํ•œ ์ถ”๊ฐ€ ๋ฉ”์‹œ์ง€
      user
      UserModel
      ์š”์ฒญ์— ์„ฑ๊ณตํ•œ ๊ฒฝ์šฐ ์‚ฌ์šฉ์ž ์ •๋ณด
  • Error Response:

    • Code: 404 NOT FOUND
      Content:
      {
      	result: "fail",
      	message: "not found"
      }
      

    OR

    • Code: 500 SERVER FAULT
      Content:
      {
      	result: "error",
      	message: "server fault"
      }
      
  • Sample Call:

    Path: GET /user/599297a54a03b51a11aa3d27?q=likes,comments,coupons
    
  • Notes:

    • ์ฟผ๋ฆฌ๋ฌธ์ž์—ด์€ ๋Œ€์†Œ๋ฌธ์ž ๊ตฌ๋ถ„ํ•ฉ๋‹ˆ๋‹ค. ์†Œ๋ฌธ์ž๋กœ๋งŒ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”.
    • ์ฟผ๋ฆฌ๋ฌธ์ž์—ด์— ๊ณต๋ฐฑ ๋“ค์–ด๊ฐ€์ง€ ์•Š์Œ์— ์œ ์˜ํ•˜์„ธ์š”.

์‚ฌ์šฉ์ž ๊ฐฑ์‹ 


์‚ฌ์šฉ์ž ์ •๋ณด ๊ฐฑ์‹  API์ž…๋‹ˆ๋‹ค.

  • URL

    /user/{userId}/update

  • Method:

    PUT

  • URL Params

    Required:

    userId
    string
    ์‚ฌ์šฉ์ž์˜ "_id" ํ•„๋“œ ๊ฐ’
  • Data Params

    email
    string
    ์ƒˆ๋กœ์šด ์ด๋ฉ”์ผ
    username
    string
    ์ƒˆ๋กœ์šด ์‚ฌ์šฉ์ž๋ช…
    device_id
    string
    ์ƒˆ๋กœ์šด device registration id
    tastes
    Array<string>
    ์‚ฌ์šฉ์ž ์ž…๋ง›
    cnt_stamp
    integer
    ์ƒˆ๋กœ์šด ์Šคํƒฌํ”„ ๊ฐœ์ˆ˜
  • Success Response:

    • Code: 200
      Content:

      {
      	"result": "ok",
      }
      
      result
      string
      ์š”์ฒญ์— ๋Œ€ํ•œ ์ฒ˜๋ฆฌ ๊ฒฐ๊ณผ["ok", "fail", "error"]
      message
      string
      ์ฒ˜๋ฆฌ ๊ฒฐ๊ณผ์— ๋Œ€ํ•œ ์ถ”๊ฐ€ ๋ฉ”์‹œ์ง€
  • Error Response:

    • Code: 404 NOT FOUND
      Content:
      {
      	result: "fail",
      	message: "user not found"
      }
      

    OR

    • Code: 409 USERNAME DUPLICATES
      Content:
      {
      	result: "fail",
      	message: "username duplicates",
      }
      

    OR

    • Code: 500 SERVER FAULT
      Content:
      {
      	result: "error",
      	message: "server fault"
      }
      
  • Sample Call:

    Path: PUT /user/599297a54a03b51a11aa3d27
    
    {
        "cnt_stamp": 2,
    }
    
  • Notes:

    • Request Body์˜ ๊ฐ ๊ฐ’์€ ๋ณ€๊ฒฝํ•˜๋Š” ๊ฐ’๋งŒ ์„ ํƒํ•˜์—ฌ ์ž…๋ ฅํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค.

์‚ฌ์šฉ์ž ์ œ๊ฑฐ


์‚ฌ์šฉ์ž๋ฅผ ์ œ๊ฑฐํ•˜๋Š” API์ž…๋‹ˆ๋‹ค.

  • URL

    /user/{userId}/delete

  • Method:

    GET

  • URL Params

    Required:

    userId
    string
    ์ œ๊ฑฐํ•  ์‚ฌ์šฉ์ž์˜ "_id" ํ•„๋“œ๊ฐ’
  • Data Params

    None

  • Success Response:

    • Code: 200
      Content:

      {
      	"result": "ok"
      }
      
      result
      string
      ์š”์ฒญ์— ๋Œ€ํ•œ ์ฒ˜๋ฆฌ ๊ฒฐ๊ณผ["ok", "fail", "error"]
      message
      string
      ์ฒ˜๋ฆฌ ๊ฒฐ๊ณผ์— ๋Œ€ํ•œ ์ถ”๊ฐ€ ๋ฉ”์‹œ์ง€
  • Error Response:

    • Code: 404 NOT FOUND
      Content:
      {
      	result: "fail",
      	message: "not found",
      }
      

    OR

    • Code: 500 SERVER FAULT
      Content:
      {
      	result: "error",
      	message: "server fault"
      }
      
  • Sample Call:

    Path: GET /user/is/duplicates?where=username&value=Lauren
    
  • Notes:

    • ์ฟผ๋ฆฌ๋ฌธ์ž์—ด ๋‘˜ ๋‹ค ํ•„์ˆ˜์‚ฌํ•ญ์ž…๋‹ˆ๋‹ค.

์ค‘๋ณต ํ™•์ธ


์ด๋ฉ”์ผ๊ณผ ์œ ์ €๋„ค์ž„ ์ค‘๋ณต์—ฌ๋ถ€๋ฅผ ํ™•์ธํ•˜๋Š” API์ž…๋‹ˆ๋‹ค.

  • URL

    /user/is/duplicates

  • Method:

    GET

  • URL Params

    Required:

    where
    string
    ์ค‘๋ณต์—ฌ๋ถ€๋ฅผ ํ™•์ธํ•  ํ•„๋“œ๋ช…
    ["email", "username"]
    value
    string
    ๋Œ€์กฐํ•  ๊ฐ’
  • Data Params

    None

  • Success Response:

    • Code: 200
      Content:

      {
      	"result": "ok",
      	"message": "duplicates"
      }
      
      result
      string
      ์š”์ฒญ์— ๋Œ€ํ•œ ์ฒ˜๋ฆฌ ๊ฒฐ๊ณผ["ok", "fail", "error"]
      message
      string
      ์ฒ˜๋ฆฌ ๊ฒฐ๊ณผ์— ๋Œ€ํ•œ ์ถ”๊ฐ€ ๋ฉ”์‹œ์ง€, ์š”์ฒญ์ด ์„ฑ๊ณตํ•œ ๊ฒฝ์šฐ ์ค‘๋ณต ์—ฌ๋ถ€["duplicates", "not duplicates""]
  • Error Response:

    • Code: 405 INVALID PARAMETERS
      Content:
      {
      	result: "fail",
      	message: "invalid parameters",
      }
      

    OR

    • Code: 500 SERVER FAULT
      Content:
      {
      	result: "error",
      	message: "server fault"
      }
      
  • Sample Call:

    Path: GET /user/is/duplicates?where=username&value=Lauren
    
  • Notes:

    • ์ฟผ๋ฆฌ๋ฌธ์ž์—ด ๋‘˜ ๋‹ค ํ•„์ˆ˜์‚ฌํ•ญ์ž…๋‹ˆ๋‹ค.

๋ฆฌ๋ทฐ ์กฐํšŒ


์‚ฌ์šฉ์ž๊ฐ€ ์ž‘์„ฑํ•œ ๋ฆฌ๋ทฐ ๋ฆฌ์ŠคํŠธ๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.

  • URL

    /user/{userId}/comments

  • Method:

    GET

  • URL Params

    Required:

    userId
    ์‚ฌ์šฉ์ž์˜ "_id" ํ•„๋“œ๊ฐ’
  • Data Params

    None

  • Success Response:

    • Code: 200
      Content:

      { 
      	"result": "ok",
      	"comments": [
      		...
      	]
      }
      
      result
      string
      ์š”์ฒญ์— ๋Œ€ํ•œ ์ฒ˜๋ฆฌ ๊ฒฐ๊ณผ["ok", "fail", "error"]
      message
      string
      ์ฒ˜๋ฆฌ ๊ฒฐ๊ณผ์— ๋Œ€ํ•œ ์ถ”๊ฐ€ ๋ฉ”์‹œ์ง€
      comments
      Array<CommentModel>
      ์š”์ฒญ์ด ์„ฑ๊ณตํ•œ ๊ฒฝ์šฐ ์ž‘์„ฑํ•œ ๋ฆฌ๋ทฐ ๋ชฉ๋ก
  • Error Response:

    • Code: 404 NOT FOUND
      Content:
      {
      	"result": "fail",
      	"message": "not found"
      }
      

    OR

    • Code: 500 SERVER FAULT
      Content:
      {
      	"result": "error",
      	"message": "server fault"
      }
      
  • Sample Call:

    GET /user/599297a54a03b51a11aa3d27/comments
    
  • Notes:

    None


์ฟ ํฐ ์กฐํšŒ


์‚ฌ์šฉ์ž๊ฐ€ ๋ณด์œ ํ•œ ์ฟ ํฐ ์ค‘, ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ์ฟ ํฐ ๋ฆฌ์ŠคํŠธ๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.

  • URL

    /user/{userId}/coupons

  • Method:

    GEt

  • URL Params

    Required:

    userId
    string
    ์‚ฌ์šฉ์ž์˜ "_id" ํ•„๋“œ ๊ฐ’
  • Data Params

    None

  • Success Response:

    • Code: 200
      Content:

      { 
      	"result": "ok",
      	"coupons": [
      		...
      	]
      }
      
      result
      string
      ์š”์ฒญ์— ๋Œ€ํ•œ ์ฒ˜๋ฆฌ ๊ฒฐ๊ณผ["ok", "fail", "error"]
      message
      string
      ์ฒ˜๋ฆฌ ๊ฒฐ๊ณผ์— ๋Œ€ํ•œ ์ถ”๊ฐ€ ๋ฉ”์‹œ์ง€
      coupons
      Array<CouponModel>
      ์š”์ฒญ์ด ์„ฑ๊ณตํ•œ ๊ฒฝ์šฐ ์ฟ ํฐ ๋ฆฌ์ŠคํŠธ
  • Error Response:

    • Code: 404 NOT FOUND
      Content:
      {
      	"result": "fail",
      	"message": "not found"
      }
      

    OR

    • Code: 500 SERVER FAULT
      Content:
      {
      	"result": "error",
      	"message": "server fault"
      }
      
  • Sample Call:

    GET /user/599297a54a03b51a11aa3d27/coupons
    
  • Notes:

    None


์žฅ๋ฐ”๊ตฌ๋‹ˆ ์ถ”๊ฐ€


์‚ฌ์šฉ์ž์˜ ์žฅ๋ฐ”๊ตฌ๋‹ˆ์— ์ œํ’ˆ์„ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค.

  • URL

    /user/{userId}/add-bucket

  • Method:

    POST

  • URL Params

    REQUIRED:

    userId
    string
    ์‚ฌ์šฉ์ž์˜ "_id" ํ•„๋“œ๊ฐ’
  • Data Params

    Body

    product
    string
    ์ถ”๊ฐ€ํ•  ์ œํ’ˆ์˜ "_id" ํ•„๋“œ๊ฐ’
    quantity
    integer
    ์ œํ’ˆ์˜ ์ˆ˜๋Ÿ‰
  • Success Response:

    • Code: 200
      Content:

      { 
      	"result": "ok"
      }
      
      result
      string
      ์š”์ฒญ์— ๋Œ€ํ•œ ์ฒ˜๋ฆฌ ๊ฒฐ๊ณผ["ok", "fail", "error"]
      message
      string
      ์ฒ˜๋ฆฌ ๊ฒฐ๊ณผ์— ๋Œ€ํ•œ ์ถ”๊ฐ€ ๋ฉ”์‹œ์ง€
  • Error Response:

    • Code: 404 NOT FOUND
      Content:

      {
      	"result": "fail",
      	"message": "not found(user)"
      }
      
      {
      	"result": "fail",
      	"message": "not found(product)"
      }
      
    • Code: 405 INVALID PARAMETERS
      Content:

      {
      	"result": "fail",
      	"message": "invalid parameters"
      }
      

    OR

    • Code: 500 SERVER FAULT
      Content:
      {
      	"result": "error",
      	"message": "server fault"
      }
      
  • Sample Call:

    {
      "product": "...",
      "quantity": 1,
    }
    
  • Notes:

    none


์ˆ˜๋Ÿ‰ ๋ณ€๊ฒฝ


์žฅ๋ฐ”๊ตฌ๋‹ˆ์— ์ถ”๊ฐ€๋œ ์ œํ’ˆ์˜ ์ˆ˜๋Ÿ‰์„ ๋ณ€๊ฒฝํ•ฉ๋‹ˆ๋‹ค.

  • URL

    /user/{userId}/update-bucket

  • Method:

    PUT

  • URL Params

    REQUIRED:

    userId
    string
    ์‚ฌ์šฉ์ž์˜ "_id" ํ•„๋“œ๊ฐ’
  • Data Params

    Body

    product
    string
    ๋ณ€๊ฒฝํ•  ์ œํ’ˆ์˜ "_id" ํ•„๋“œ๊ฐ’
    quantity
    integer
    ๋ณ€๊ฒฝ๋  ์ˆ˜๋Ÿ‰
  • Success Response:

    • Code: 200
      Content:

      { 
      	"result": "ok"
      }
      
      result
      string
      ์š”์ฒญ์— ๋Œ€ํ•œ ์ฒ˜๋ฆฌ ๊ฒฐ๊ณผ["ok", "fail", "error"]
      message
      string
      ์ฒ˜๋ฆฌ ๊ฒฐ๊ณผ์— ๋Œ€ํ•œ ์ถ”๊ฐ€ ๋ฉ”์‹œ์ง€
  • Error Response:

    • Code: 404 NOT FOUND
      Content:
      {
      	"result": "fail",
      	"message": "not found(user)"
      }
      

    OR

    • Code: 500 SERVER FAULT
      Content:
      {
      	"result": "error",
      	"message": "server fault"
      }
      
  • Sample Call:

    {
      "product": "...",
      "quantity": 3
    }
    
  • Notes:

    • ์žฅ๋ฐ”๊ตฌ๋‹ˆ์— product์™€ ์ผ์น˜ํ•˜๋Š” ์ œํ’ˆ์ด ์—†๋Š” ๊ฒฝ์šฐ์—๋Š” 200 ์‘๋‹ต์„ ๋ฐ˜ํ™˜ํ•˜๋˜, message์— "not updated: bucket has no matched product"๊ฐ€ ์ „๋‹ฌ๋ฉ๋‹ˆ๋‹ค.

์žฅ๋ฐ”๊ตฌ๋‹ˆ์˜ ์ œํ’ˆ ์ œ๊ฑฐ


์žฅ๋ฐ”๊ตฌ๋‹ˆ์— ์ถ”๊ฐ€๋œ ์ œํ’ˆ์„ ์ œ๊ฑฐํ•ฉ๋‹ˆ๋‹ค.

  • URL

    /user/{userId}/delete-from-bucket

  • Method:

    PUT

  • URL Params

    REQUIRED:

    userId
    string
    ์‚ฌ์šฉ์ž์˜ "_id" ํ•„๋“œ๊ฐ’
  • Data Params

    Body

    product
    string
    ์ œ๊ฑฐํ•  ์ œํ’ˆ์˜ "_id" ํ•„๋“œ๊ฐ’
  • Success Response:

    • Code: 200
      Content:

      { 
      	"result": "ok"
      }
      
      result
      string
      ์š”์ฒญ์— ๋Œ€ํ•œ ์ฒ˜๋ฆฌ ๊ฒฐ๊ณผ["ok", "fail", "error"]
      message
      string
      ์ฒ˜๋ฆฌ ๊ฒฐ๊ณผ์— ๋Œ€ํ•œ ์ถ”๊ฐ€ ๋ฉ”์‹œ์ง€
  • Error Response:

    • Code: 404 NOT FOUND
      Content:
      {
      	"result": "fail",
      	"message": "not found(user)"
      }
      

    OR

    • Code: 500 SERVER FAULT
      Content:
      {
      	"result": "error",
      	"message": "server fault"
      }
      
  • Sample Call:

    {
      "product": "..."
    }
    
  • Notes:

    • ์žฅ๋ฐ”๊ตฌ๋‹ˆ์— product์™€ ์ผ์น˜ํ•˜๋Š” ์ œํ’ˆ์ด ์—†๋Š” ๊ฒฝ์šฐ์—๋Š” 200 ์‘๋‹ต์„ ๋ฐ˜ํ™˜ํ•˜๋˜, message์— "not deleted: bucket has no matched product"๊ฐ€ ์ „๋‹ฌ๋ฉ๋‹ˆ๋‹ค.
โš ๏ธ **GitHub.com Fallback** โš ๏ธ