π μμΉ΄μμμμ ν· π
HTTP METHOD | API | λ΄λΉμ | path | μλ£ |
---|---|---|---|---|
GET | [μ°¨λ νλ] λμ μμ½ | μ΄λ€μ | /my/rent | β |
GET | [μ°¨λ νλ] μΆμ² μ°¨λ | μ΄λ€μ | /my/recommend | β |
GET | [μ°¨λ μμ½] μ°¨λ νν° λ¦¬μ€νΈ | λ°λν¬ | /reserve | β |
PUT | [μ°¨λ μμ½] ννΈ λ²νΌ ν΄λ¦ | μ΄λ€μ | /my/favorite | β |
ββ socar-backend
βββ firebase.json
βββ functions
βΒ Β βββ api
βΒ Β βΒ Β βββ index.js
βΒ Β βΒ Β βββ routes
βΒ Β βΒ Β βββ index.js
βΒ Β βΒ Β βββ my
βΒ Β βΒ Β βΒ Β βββ favoritePOST.js
βΒ Β βΒ Β βΒ Β βββ index.js
βΒ Β βΒ Β βΒ Β βββ recommendGET.js
βΒ Β βΒ Β βΒ Β βββ rentGET.js
βΒ Β βΒ Β βββ reserve
βΒ Β βΒ Β βββ index.js
βΒ Β βΒ Β βββ reserveGET.js
βΒ Β βββ config
βΒ Β βΒ Β βββ dbConfig.js
βΒ Β βββ constants
βΒ Β βΒ Β βββ responseMessage.js
βΒ Β βΒ Β βββ statusCode.js
βΒ Β βββ db
βΒ Β βΒ Β βββ db.js
βΒ Β βΒ Β βββ index.js
βΒ Β βΒ Β βββ my.js
βΒ Β βΒ Β βββ reserve.js
βΒ Β βββ index.js
βΒ Β βββ lib
βΒ Β βΒ Β βββ convertDate.js
βΒ Β βΒ Β βββ convertSnakeToCamel.js
βΒ Β βΒ Β βββ util.js
βΒ Β βββ package.json
βββ package-lock.json
βββ package.json
Base URL: https://asia-northeast3-socar-server-814e9.cloudfunctions.net/api
`GET` [μ°¨λ νλ] λμ μμ½
{
userId: int
}
EX)
{
userId: 3
}
{
"status": 200,
"success": true,
"message": "λμ μμ½ μ‘°ν μ±κ³΅",
"data": [
{
"date": "02 sat",
"location": "μ λΌμ€ν
μ΄ μΌμ±",
"address": "μμΈνΉλ³μ κ°λ¨κ΅¬ μλλλ‘ 506"
},
{
"date": "12 tue",
"location": "μ λ¦ΌνλμννΈ μ£Όμ°¨μ₯",
"address": "μμΈνΉλ³μ κ΄μ
ꡬ μ λ¦Όλ‘ 29κΈΈ 8"
},
{
"date": "21 thu",
"location": "μ λ¦Ό ν¬λλͺ° μ£Όμ°¨μ₯",
"address": "μμΈνΉλ³μ κ΄μ
ꡬ μ λ¦Όλ‘ 330"
}
]
}
`GET` [μ°¨λ νλ] μΆμ² μ°¨λ
{
userId: int,
}
EX)
{
userId: 4,
}
{
"status": 200,
"success": true,
"message": "μΆμ² μ°¨λ μ‘°ν μ±κ³΅",
"data": [
{
"carName": "ν¬μΌ(κ²½μ )",
"priceUnit": "μ",
"price": 503000,
"discountRate": 26,
"imageUrl": "https://firebasestorage.googleapis.com/v0/b/socar-server-814e9.appspot.com/o/car%2Ftosan.png?alt=media"
},
{
"carName": "μΉ΄λλ° 11μΈμΉ",
"priceUnit": "μ",
"price": 653000,
"discountRate": 16,
"imageUrl": "https://firebasestorage.googleapis.com/v0/b/socar-server-814e9.appspot.com/o/car%2Fcarnival11.png?alt=media"
},
{
"carName": "μ¬λ΄λͺ¨λ",
"priceUnit": "μ",
"price": 454000,
"discountRate": 15,
"imageUrl": "https://firebasestorage.googleapis.com/v0/b/socar-server-814e9.appspot.com/o/car%2Fallnewmorning.png?alt=media"
},
{
"carName": "λλ΄μλ°λΌ",
"priceUnit": "μ",
"price": 385000,
"discountRate": 37,
"imageUrl": "https://firebasestorage.googleapis.com/v0/b/socar-server-814e9.appspot.com/o/car%2Fthenewavante.png?alt=media"
}
]
}
`GET` [μ°¨λ μμ½] μ°¨λ νν° λ¦¬μ€νΈ
- 쿼리 보λ΄λ νμ (νν°κ° μ κ±Έλ €μλ 쿼리 κ°μ 보λ΄μ§ μμΌμ λ λ©λλ€.)
/reserve?start=20211113&end=20211115&type=μ€μ€ν&location=μμΈ/κ²½κΈ°/μΈμ²&price=desc&trend=true
- μμ
/reserve?start=202111118&end=20211128&type=μ€μ€ν&location=μμΈ/κ²½κΈ°/μΈμ²&price=desc
REQUEST HEADER
{
userId: int,
}
- μ‘°ν μ±κ³΅
{
"status": 200,
"success": true,
"message": "μμ½ κ°λ₯ν μ°¨λ 리μ€νΈ μ‘°ν μ±κ³΅",
"data": [
{
"carId": 2,
"carName": "λλ΄μλ°λΌ",
"modelYear": "2018λ
~2019λ
",
"priceUnit": "μ",
"price": 385000,
"discountRate": 37,
"currentLocation": "μ λ¦Ό ν¬λλͺ° μ£Όμ°¨μ₯",
"imageUrl": "https://firebasestorage.googleapis.com/v0/b/socar-server-814e9.appspot.com/o/car%2Fthenewavante.png?alt=media",
"isLiked": false
},
{
"carId": 1,
"carName": "ν¬μΌ(κ²½μ )",
"modelYear": "2016λ
~2017λ
",
"priceUnit": "μ",
"price": 503000,
"discountRate": 26,
"currentLocation": "μ λ¦ΌνλμννΈ μ£Όμ°¨μ₯",
"imageUrl": "https://firebasestorage.googleapis.com/v0/b/socar-server-814e9.appspot.com/o/car%2Ftosan.png?alt=media",
"isLiked": false
},
{
"carId": 5,
"carName": "μ¬λ΄K3",
"modelYear": "2018λ
~2019λ
",
"priceUnit": "μ",
"price": 542000,
"discountRate": 16,
"currentLocation": "μ λ¦ΌνλμννΈ μ£Όμ°¨μ₯",
"imageUrl": "https://firebasestorage.googleapis.com/v0/b/socar-server-814e9.appspot.com/o/car%2Fallnewk3.png?alt=media",
"isLiked": false
},
{
"carId": 4,
"carName": "μ½λ",
"modelYear": "2018λ
~2019λ
",
"priceUnit": "μ",
"price": 579000,
"discountRate": 14,
"currentLocation": "μ λΌμ€ν
μ΄ μΌμ±",
"imageUrl": "https://firebasestorage.googleapis.com/v0/b/socar-server-814e9.appspot.com/o/car%2Fcona.png?alt=media",
"isLiked": false
}
]
}
- startμ end λ μ€ νλλ§ μμ±ν κ²½μ° / userId μλ κ²½μ°
{
"status": 400,
"success": false,
"message": "νμν κ°μ΄ μμ΅λλ€"
}
`PUT` [μ°¨λ μμ½] ννΈ λ²νΌ ν΄λ¦
{
userId: int,
carId: int,
isLiked: boolean,
}
EX)
{
"userId": 1,
"carId": 2,
"isLiked": false
}
{
"status": 200,
"success": true,
"message": "μ’μμ μν λ³κ²½ μ±κ³΅",
"data": {
"carId": 2,
"isLiked": false
}
}