authRouter
- 예시 계정은 이미 있는 것이라서 중복되지 않게 써야함.
- 비밀번호 찾는 기능은 없기 때문에 회원가입 후 비밀번호는 알고 있어야 함.
(DB에는 해시화된 비밀번호가 저장됨.)
- admin 계정 만드실 때는 DB에서 role부분을 직접 admin으로 변경하셔야 합니다.
기본값은 ‘user’로 생성되도록 했습니다.
- 이메일 인증요청은 구글 gmail 계정만 가능합니다.
- 인증요청 시 해당 gmail로 인증번호 6자리가 발송되며, 해당 인증번호와 이메일이 DB에 저장됩니다.
- 5분 후 DB에서 자동 삭제되도록 설정해놓았으니, 5분이 지나고 인증번호를 입력하시면 에러가 납니다.
| URL | 기능 | method | Request
-
headers
(토큰) | Request
-
Body | |
| --- | --- | --- | --- | --- | --- |
| http://localhost:3000/api/v1/auth/sign-up | 회원가입 | POST | | {
"name": "꿀단집",
"phoneNumber": "01012341234",
"email": "[email protected]",
"password": "honeymoney0219",
"address": "당신의 마음속",
"addressDetail": "어딘가"
} | |
| http://localhost:3000/api/v1/auth/sign-in | 로그인 | POST | | {
"email": "[email protected]",
"password": "honeymoney0219"
} | |
| http://localhost:3000/api/v1/auth/me | 개인정보 조회 | GET | O | {
"email": "[email protected]"
} | |
| http://localhost:3000/api/v1/auth/me | 개인정보 수정
-
이메일 변경 불가
-
비밀번호 변경 가능
-
주소 변경 가능
-
상세주소 변경 가능 | PATCH | O | {
"email": "[email protected]",
"password": "honeymoney0219",
"address": "당신의 마음속",
"addressDetaill": "어딘가"
} | |
| http://localhost:3000/api/v1/auth/withdraw | 개인정보 삭제
(탈퇴) | POST | O | {
"email": "[email protected]"
} | |
| http://localhost:3000/api/v1/auth/send-confirmation-email | 이메일 인증 요청
(구글/네이) | POST | | {
"email": "[email protected]"
} | |
| http://localhost:3000/api/v1/auth/confirm-email | 이메일 인증 완료
(5분 내로 하기) | POST | | {
"inputNumber": "235312",
"email": "[email protected]"
} | |
| http://localhost:3000/api/v1/auth/change-password | 비밀번호 변경
(비밀번호 찾기) | POST | O
(로그인 상태) | {
"email": "[email protected]",
"newPassword" :"honeymoney1234",
"newPasswordConfirm": "honeymoney1234"
} | |
-
사진
adminRouter
- admin인지를 확인하는 adminMiddleware를 거쳐감.
- 관리자 계정 접속 필수
| URL | 기능 | method | Request
- headers
(토큰) | Request
- Body |
| --- | --- | --- | --- | --- |
| http://localhost:3000/api/v1/admin/orders | 관리자 주문 조회 | GET | O | - |
| http://localhost:3000/api/v1/admin/orders | 관리자 주문 추가 | POST | O | {
"status": "배송 완료",
"customerId": "65dd77891b0a898650d853f2",
"product": [
{
"id": "507f1f78bcf86cd799439046",
"name": "상품이름임시",
"count": 600000,
"image": "https://honeytouse.s3.ap-northeast-2.amazonaws.com/item02-10.png",
"options": "65de8dd5544b3aedec22070d",
}
],
"memo": "이미지 테스트",
"payment": {
"ttlPriceItem": 5000000,
"ttlPriceDelivery": 0,
"ttlPrice": 5000000
}
} |
| http://localhost:3000/api/v1/admin/orders/:id | 관리자 주문 수정
(단일 상품) | PUT | O | {
"status": "배송 완료",
"customerId": "65dd77891b0a898650d853f2",
"product": [
{
"id": "507f1f78bcf86cd799439046",
"name": "상품이름임시",
"count": 600000,
"image": "https://honeytouse.s3.ap-northeast-2.amazonaws.com/item02-10.png",
"options": "65de8dd5544b3aedec22070d",
}
],
"memo": "이미지 테스트",
"payment": {
"ttlPriceItem": 5000000,
"ttlPriceDelivery": 0,
"ttlPrice": 5000000
}
} |
| http://localhost:3000/api/v1/admin/orders/:id | 관리자 주문 삭제
(단일 상품) | DELETE | O | - |
| http://localhost:3000/api/v1/admin/categories | 관리자 카테고리 추가 | POST | O | {
"name": "아네스 LED 리노 서랍 침대",
} |
| http://localhost:3000/api/v1/admin/categories/:id | 관리자 카테고리 수정 | PUT | O | {
"name": "아네스 LED 리노 서랍 침대",
} |
| http://localhost:3000/api/v1/admin/categories/:id | 관리자 카테고리 삭제 | DELETE | O | - |
| http://localhost:3000/api/v1/admin/products | 관리자 상품 추가 | POST | O | {
"categoryId": "507f1f77bcf86cd799439012",
"name": "아네스 LED 리노 서랍 침대",
"brand": "딜라이트",
"price": 935990,
"image": "https://some.image.url",
"options": {
"name": "size",
"value": ["슈퍼싱글ss", "퀸Q"]
},
"description": "푹신푹신 수정"
} |
| http://localhost:3000/api/v1/admin/products/:id | 관리자 상품 수정
(단일 상품) | PUT | O | {
"categoryId": "507f1f77bcf86cd799439012",
"name": "아네스 LED 리노 서랍 침대",
"brand": "딜라이트",
"price": 935990,
"image": "https://some.image.url",
"options": {
"name": "size",
"value": ["슈퍼싱글ss", "퀸Q"]
},
"description": "푹신푹신 수정"
} |
| http://localhost:3000/api/v1/admin/products/:id | 관리자 상품 삭제
(단일 상품) | DELETE | O | - |
| http://localhost:3000/api/v1/admin/userInfo | 관리자 전체 회원 조회 | GET | O | - |
categoryRouter
| URL | 기능 | method | Request
orderRouter
| URL | 기능 | method | Request
- headers
(토큰) | Request
- Body |
| --- | --- | --- | --- | --- |
| http://localhost:3000/api/v1/orders | 주문 추가 | POST | | {
"status": "배송 완료",
"customerId": "65dd77891b0a898650d853f2",
"product": [
{
"id": "507f1f78bcf86cd799439046",
"name": "상품이름임시",
"count": 600000,
"image": "https://honeytouse.s3.ap-northeast-2.amazonaws.com/item02-10.png",
"options": "65de8dd5544b3aedec22070d",
}
],
"memo": "이미지 테스트",
"payment": {
"ttlPriceItem": 5000000,
"ttlPriceDelivery": 0,
"ttlPrice": 5000000
}
} |
| http://localhost:3000/api/v1/orders/:id | 주문 조회 (단일 상품) | GET | | - |
| http://localhost:3000/api/v1/orders/ | 구매자별 주문 조회 | GET | O | - |
| http://localhost:3000/api/v1/orders/:id | 주문 수정 (단일 상품) | PUT | | {
"status": "배송 완료",
"customerId": "65dd77891b0a898650d853f2",
"product": [
{
"id": "507f1f78bcf86cd799439046",
"name": "상품이름임시",
"count": 600000,
"image": "https://honeytouse.s3.ap-northeast-2.amazonaws.com/item02-10.png",
"options": "65de8dd5544b3aedec22070d",
}
],
"memo": "이미지 테스트",
"payment": {
"ttlPriceItem": 5000000,
"ttlPriceDelivery": 0,
"ttlPrice": 5000000
}
} |
| http://localhost:3000/api/v1/orders/:id | 주문 삭제 (단일 상품) | DELETE | | - |