`KDT기수번호_이름
E.g, KDT0_ParkYoungWoong`
git branch KDTX_ParkYoungWoong
)main
브랜치에 푸시하지 않도록 꼭 주의하세요, git push origin KDTX_ParkYoungWoong
)main
브랜치를 대상으로 Pull Request 생성하면, 과제 제출이 완료됩니다!(E.g, main
<== KDTX_ParkYoungWoong
)main
혹은 다른 사람의 브랜치로 절대 병합하지 않도록 주의하세요!모든 API 요청(Request) headers
에 아래 정보가 꼭 포함돼야 합니다!
username
은 KDT5_TeamX
와 같이 본명 혹은 팀 이름을 포함해야 합니다!
확인할 수 없는 사용자나 팀의 DB 정보는 임의로 삭제될 수 있습니다!
{
"content-type": "application/json",
"apikey": "KDT5_nREmPe9B",
"username": "KDT5_TeamX"
}
'인증' 관련 API는 모두 일반 사용자 전용입니다.
사용자가 username
에 종속되어 회원가입합니다.
curl https://asia-northeast3-heropy-api.cloudfunctions.net/api/auth/signup
\ -X 'POST'
요청 데이터 타입 및 예시:
interface RequestBody {
email: string // 사용자 아이디 (필수!)
password: string // 사용자 비밀번호, 8자 이상 (필수!)
displayName: string // 사용자 이름, 20자 이하 (필수!)
profileImgBase64?: string // 사용자 프로필 이미지(base64) - jpg, jpeg, webp, png, gif, svg
}
{
"email": "thesecon@gmail.com",
"password": "********",
"displayName": "ParkYoungWoong",
"profileImgBase64": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAf...(생략)"
}
응답 데이터 타입 및 예시:
interface ResponseValue {
user: { // 회원가입한 사용자 정보
email: string // 사용자 아이디
displayName: string // 사용자 표시 이름
profileImg: string | null // 사용자 프로필 이미지(URL)
}
accessToken: string // 사용자 접근 토큰
}
{
"user": {
"email": "thesecon@gmail.com",
"displayName": "ParkYoungWoong",
"profileImg": "https://storage.googleapis.com/heropy-api/vjbtIrh5dGv163442.png"
},
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlM3WDhpQ...(생략)"
}
accessToken
은 24시간 후 만료됩니다.(만료 후 다시 로그인 필요)curl https://asia-northeast3-heropy-api.cloudfunctions.net/api/auth/login
\ -X 'POST'
요청 데이터 타입 및 예시:
interface RequestBody {
email: string // 사용자 아이디 (필수!)
password: string // 사용자 비밀번호 (필수!)
}
{
"email": "thesecon@gmail.com",
"password": "********"
}
응답 데이터 타입 및 예시:
interface ResponseValue {
user: { // 회원가입한 사용자 정보
email: string // 사용자 아이디
displayName: string // 사용자 표시 이름
profileImg: string | null // 사용자 프로필 이미지(URL)
}
accessToken: string // 사용자 접근 토큰
}
"user": {
"email": "thesecon@gmail.com",
"displayName": "ParkYoungWoong",
"profileImg": "https://storage.googleapis.com/heropy-api/vAKjlJ-Gx5v163442.png"
},
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjlQS3I...(생략)"
}
curl https://asia-northeast3-heropy-api.cloudfunctions.net/api/auth/me
\ -X 'POST'
\ -H 'Authorization: Bearer <accessToken>'
요청 데이터 타입 및 예시:
응답 데이터 타입 및 예시:
interface ResponseValue {
email: string // 사용자 아이디
displayName: string // 사용자 표시 이름
profileImg: string | null // 사용자 프로필 이미지(URL)
}
{
"email": "thesecon@gmail.com",
"displayName": "ParkYoungWoong",
"profileImg": "https://storage.googleapis.com/heropy-api/vAKjlJ-Gx5v163442.png"
}
curl https://asia-northeast3-heropy-api.cloudfunctions.net/api/auth/logout
\ -X 'POST'
\ -H 'Authorization: Bearer <accessToken>'
요청 데이터 타입 및 예시:
응답 데이터 타입 및 예시:
type ResponseValue = true // 로그아웃 처리 상태
curl https://asia-northeast3-heropy-api.cloudfunctions.net/api/auth/user
\ -X 'PUT'
\ -H 'Authorization: Bearer <accessToken>'
요청 데이터 타입 및 예시:
interface RequestBody {
displayName?: string // 새로운 표시 이름
profileImgBase64?: string // 사용자 프로필 이미지(base64) - jpg, jpeg, webp, png, gif, svg
oldPassword?: string // 기존 비밀번호
newPassword?: string // 새로운 비밀번호
}
{
"oldPassword": "********",
"newPassword": "**********"
}
응답 데이터 타입 및 예시:
interface ResponseValue {
email: string // 사용자 아이디
displayName: string // 사용자 표시 이름
profileImg: string | null // 사용자 프로필 이미지(URL)
}
{
"email": "thesecon@gmail.com",
"displayName": "ParkYoungWoong",
"profileImg": "https://storage.googleapis.com/heropy-api/vAKjlJ-Gx5v163442.png"
}
curl https://asia-northeast3-heropy-api.cloudfunctions.net/api/auth/users
\ -X 'GET'
\ -H 'masterKey: true'
요청 데이터 타입 및 예시:
응답 데이터 타입 및 예시:
type ResponseValue = User[]
interface User {
email: string // 사용자 아이디
displayName: string // 사용자 표시 이름
profileImg: string // 사용자 프로필 이미지 URL
}
[
{
"email": "thesecon@gmail.com",
"displayName": "HEROPY",
"profileImg": null
},
{
"email": "neo@zillinks.com",
"displayName": "박영웅",
"profileImg": "https://storage.googleapis.com/heropy-api/Z_una7lyijv074804.png"
},
{
"email": "test@test.com",
"displayName": "관리자",
"profileImg": "https://storage.googleapis.com/heropy-api/ZXcXjwsB7nv121507.png"
}
]
'계좌' 관련 API는 모두 일반 사용자 전용입니다.
disabled
속성이 true
로 변경됩니다.digits
속성의 숫자를 모두 더하면 각 은행의 유효한 계좌번호 길이가 됩니다.[3, 2, 4, 3]
=> 123-12-1234-123curl https://asia-northeast3-heropy-api.cloudfunctions.net/api/account/banks
\ -X 'GET'
\ -H 'Authorization: Bearer <accessToken>'
요청 데이터 타입 및 예시:
응답 데이터 타입 및 예시:
type ResponseValue = Bank[] // 선택 가능한 은행 정보 목록
interface Bank { // 선택 가능한 은행 정보
name: string // 은행 이름
code: string // 은행 코드
digits: number[] // 은행 계좌 자릿수
disabled: boolean // 사용자가 추가한 계좌 여부
}
[
{
"name": "KB국민은행",
"code": "004",
"digits": [3, 2, 4, 3],
"disabled": false
},
{
"name": "신한은행",
"code": "088",
"digits": [3, 3, 6],
"disabled": true
},
{
"name": "우리은행",
"code": "020",
"digits": [4, 3, 6],
"disabled": true
},
{
"name": "하나은행",
"code": "081",
"digits": [3, 6, 5],
"disabled": false
},
{
"name": "케이뱅크",
"code": "089",
"digits": [3, 3, 6],
"disabled": false
},
{
"name": "카카오뱅크",
"code": "090",
"digits": [4, 2, 7],
"disabled": false
},
{
"name": "NH농협은행",
"code": "011",
"digits": [3, 4, 4, 2],
"disabled": false
}
]
"123-XXXX-XXXX-XX"
curl https://asia-northeast3-heropy-api.cloudfunctions.net/api/account
\ -X 'GET'
\ -H 'Authorization: Bearer <accessToken>'
요청 데이터 타입 및 예시:
응답 데이터 타입 및 예시:
interface ResponseValue {
totalBalance: number // 사용자 계좌 잔액 총합
accounts: Bank[] // 사용자 계좌 정보 목록
}
interface Bank { // 사용자 계좌 정보
id: string // 계좌 ID
bankName: string // 은행 이름
bankCode: string // 은행 코드
accountNumber: string // 계좌 번호
balance: number // 계좌 잔액
}
{
"totalBalance": 5999900,
"accounts": [
{
"id": "jQMfKla8vOIFELA3mAXv",
"bankName": "NH농협은행",
"bankCode": "011",
"accountNumber": "356-XXXX-XXXX-XX",
"balance": 2999900
},
{
"id": "wiPgsXvMAmcLw8AuRHIi",
"bankName": "KB국민은행",
"bankCode": "004",
"accountNumber": "123-XX-XXXX-XXX",
"balance": 3000000
}
]
}
curl https://asia-northeast3-heropy-api.cloudfunctions.net/api/account
\ -X 'POST'
\ -H 'Authorization: Bearer <accessToken>'
요청 데이터 타입 및 예시:
interface RequestBody {
bankCode: string // 연결할 은행 코드 (필수!)
accountNumber: string // 연결할 계좌번호 (필수!)
phoneNumber: string // 사용자 전화번호 (필수!)
signature: boolean // 사용자 서명 (필수!)
}
{
"bankCode": "088",
"accountNumber": "123456789012",
"phoneNumber": "01012345678",
"signature": true
}
응답 데이터 타입 및 예시:
interface ResponseValue { // 연결된 계좌 정보
id: string // 계좌 ID
bankName: string // 은행 이름
bankCode: string // 은행 코드
accountNumber: string // 계좌 번호
balance: number // 계좌 잔액
}
{
"id": "1qRFC6Ey5VkSu6nyj5Ba",
"bankName": "신한은행",
"bankCode": "088",
"accountNumber": "123-XXX-XXXXXX",
"balance": 3000000
}
curl https://asia-northeast3-heropy-api.cloudfunctions.net/api/account
\ -X 'DELETE'
\ -H 'Authorization: Bearer <accessToken>'
요청 데이터 타입 및 예시:
interface RequestBody {
accountId: string // 계좌 ID (필수!)
signature: boolean // 사용자 서명 (필수!)
}
{
"accountId": "jQMfKla8vOIFELA3mAXv",
"signature": true
}
응답 데이터 타입 및 예시:
type ResponseValue = true // 계좌 해지 처리 상태
'제품' 관련 API는 관리자 전용과 일반 사용자 전용으로 구분됩니다.
공용 API도 있으니 주의하세요!
discountRate
)은 제품 가격과 직접 관계가 없는 단순 메모 속성입니다.0
으로 표시됩니다.curl https://asia-northeast3-heropy-api.cloudfunctions.net/api/products
\ -X 'GET'
\ -H 'masterKey: true'
요청 데이터 타입 및 예시:
응답 데이터 타입 및 예시:
type ResponseValue = Product[] // 관리하는 모든 제품의 목록
interface Product { // 제품 정보
id: string // 제품 ID
title: string // 제품 이름
price: number // 제품 가격
description: string // 제품 설명(최대 100자)
tags: string[] // 제품 태그
thumbnail: string | null // 제품 썸네일 이미지(URL)
isSoldOut: boolean // 제품 매진 여부
discountRate: number // 제품 할인율
}
[
{
"id": "cFmeC7aY5KjZbBAdJE9y",
"title": "삼성전자 스마트모니터 M7 S43AM700",
"price": 639000,
"description": "107.9cm(43인치) / 와이드(16:9) / 평면 / VA / 3840 x 2160(4K UHD) / 픽셀피치: 0.2451mm / 8ms(GTG) / 300cd / 5,00",
"tags": [
"가전",
"모니터",
"컴퓨터"
],
"thumbnail": "https://storage.googleapis.com/heropy-api/vBAK4MQdH5v195712.png",
"isSoldOut": false,
"discountRate": 20
},
{
"id": "nbqtQvEivYwEXTDet7YM",
"title": "MacBook Pro 16",
"price": 3360000,
"description": "역대 가장 강력한 MacBook Pro가 등장했습니다. 최초의 프로용 Apple Silicon인 M1 Pro 또는 M1 Max 칩을 탑재해 쏜살같이 빠른 속도는 물론, 획기적인 성",
"tags": [
"가전",
"노트북",
"컴퓨터"
],
"thumbnail": "https://storage.googleapis.com/heropy-api/vIKMk_jy4Yv195256.png",
"isSoldOut": false,
"discountRate": 0
}
]
curl https://asia-northeast3-heropy-api.cloudfunctions.net/api/products/transactions/all
\ -X 'GET'
\ -H 'masterKey: true'
요청 데이터 타입 및 예시:
응답 데이터 타입 및 예시:
type RequestValue = TransactionDetail[] // 모든 거래 내역의 목록
interface TransactionDetail { // 거래 내역 정보
detailId: string // 거래 내역 ID
user: { // 거래한 사용자 정보
email: string
displayName: string
profileImg: string | null
}
account: { // 거래한 사용자의 계좌 정보
bankName: string
bankCode: string
accountNumber: string
}
product: { // 거래한 제품 정보
productId: string
title: string
price: number
description: string
tags: string[]
thumbnail: string | null
discountRate: number
}
reservation: Reservation | null // 거래한 제품의 예약 정보
timePaid: string // 제품을 거래한 시간
isCanceled: boolean // 거래 취소 여부
done: boolean // 거래 완료 여부
}
interface Reservation {
start: string // 예약 시작 시간
end: string // 예약 종료 시간
isCanceled: boolean // 예약 취소 여부
isExpired: boolean // 예약 만료 여부
}
[
{
"detailId": "dMhfxyrAupQP18OYmywy",
"user": {
"email": "thesecon@gmail.com",
"displayName": "ParkYoungWoong",
"profileImg": "https://storage.googleapis.com/heropy-api/vsLRqTlPO5v200111.png"
},
"account": {
"bankName": "KB국민은행",
"bankCode": "004",
"accountNumber": "123-XX-XXXX-XXX"
},
"product": {
"productId": "cFmeC7aY5KjZbBAdJE9y",
"title": "삼성전자 스마트모니터 M7 S43AM700",
"price": 639000,
"description": "107.9cm(43인치) / 와이드(16:9) / 평면 / VA / 3840 x 2160(4K UHD) / 픽셀피치: 0.2451mm / 8ms(GTG) / 300cd / 5,00",
"tags": [
"가전",
"모니터",
"컴퓨터"
],
"thumbnail": "https://storage.googleapis.com/heropy-api/vBAK4MQdH5v195712.png",
"discountRate": 0
},
"reservation": null,
"timePaid": "2021-11-07T20:01:49.100Z",
"isCanceled": false,
"done": false
}
]
예약 정보(reservation
)가 있는 경우:
[
{
"reservation": {
"start": "2021-11-12T06:00:00.000Z",
"end": "2021-11-12T07:00:00.000Z",
"isCanceled": false,
"isExpired": true
}
}
]
curl https://asia-northeast3-heropy-api.cloudfunctions.net/api/products/transactions/:detailId
\ -X 'PUT'
\ -H 'masterKey: true'
요청 데이터 타입 및 예시:
interface RequestBody {
isCanceled?: boolean // 거래 취소 여부 (사용자의 '제품 거래(구매) 취소' 상태와 같습니다)
done?: boolean // 거래 완료 여부 (사용자의 '제품 거래(구매) 확정' 상태와 같습니다)
}
{
"isCanceled": true
}
응답 데이터 타입 및 예시:
type ResponseValue = true // 거래 내역 완료/취소 및 해제 처리 상태
discountRate
)은 제품 가격과 직접 관계가 없는 단순 메모 속성입니다.0
~99
사이 숫자를 입력하세요. 만약 할인율이 '20%'인 경우, 20
으로 입력해야 합니다.0
으로 적용됩니다.// 할인 전 가격을 계산!
const priceBeforeDiscount = price * 100 / (100 - discountRate)
curl https://asia-northeast3-heropy-api.cloudfunctions.net/api/products
\ -X 'POST'
\ -H 'masterKey: true'
요청 데이터 타입 및 예시:
interface RequestBody {
title: string // 제품 이름 (필수!)
price: number // 제품 가격 (필수!)
description: string // 제품 상세 설명 (필수!)
tags?: string[] // 제품 태그
thumbnailBase64?: string // 제품 썸네일(대표) 사진(base64) - jpg, jpeg, webp, png, gif, svg
photoBase64?: string // 제품 상세 사진(base64) - jpg, jpeg, webp, png, gif, svg
discountRate?: number // 제품 할인율
}
{
"title": "MacBook Pro 16",
"price": 3360000,
"description": "역대 가장 강력한 MacBook Pro가 등장했습니다. 최초의 프로용 Apple Silicon인 M1 Pro 또는 M1 Max 칩을 탑재해 쏜살같이 빠른 속도는 물론, 획기적인 성능과 놀라운 배터리 사용 시간을 자랑하죠. 여기에 시선을 사로잡는 Liquid Retina XDR 디스플레이, Mac 노트북 사상 최고의 카메라 및 오디오 그리고 더할 나위 없이 다양한 포트까지. 기존 그 어떤 카테고리에도 속하지 않는 노트북. 새로운 MacBook Pro는 그야말로 야수입니다.",
"tags": [
"가전",
"노트북",
"컴퓨터"
],
"thumbnailBase64": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...(생략)"
}
응답 데이터 타입 및 예시:
interface ResponseValue { // 추가한 제품의 상세 내용
id: string // 제품 ID
title: string // 제품 이름
price: number // 제품 가격
description: string // 제품 상세 설명
tags: string[] // 제품 태그
thumbnail: string | null // 제품 썸네일 이미지(URL)
photo: string | null // 제품 상세 이미지(URL)
isSoldOut: boolean // 제품 매진 여부
discountRate: number // 제품 할인율
}
{
"id": "nbqtQvEivYwEXTDet7YM",
"title": "MacBook Pro 16",
"price": 3360000,
"description": "역대 가장 강력한 MacBook Pro가 등장했습니다. 최초의 프로용 Apple Silicon인 M1 Pro 또는 M1 Max 칩을 탑재해 쏜살같이 빠른 속도는 물론, 획기적인 성능과 놀라운 배터리 사용 시간을 자랑하죠. 여기에 시선을 사로잡는 Liquid Retina XDR 디스플레이, Mac 노트북 사상 최고의 카메라 및 오디오 그리고 더할 나위 없이 다양한 포트까지. 기존 그 어떤 카테고리에도 속하지 않는 노트북. 새로운 MacBook Pro는 그야말로 야수입니다.",
"tags": [
"가전",
"노트북",
"컴퓨터"
],
"thumbnail": "https://storage.googleapis.com/heropy-api/vIKMk_jy4Yv195256.png",
"photo": "https://storage.googleapis.com/heropy-api/voihKb3NLGcv195257.png",
"isSoldOut": false,
"discountRate": 0
}
curl https://asia-northeast3-heropy-api.cloudfunctions.net/api/products/:productId
\ -X 'PUT'
\ -H 'masterKey: true'
요청 데이터 타입 및 예시:
interface RequestBody {
title?: string // 제품 이름
price?: number // 제품 가격
description?: string // 제품 상세 설명
tags?: string[] // 제품 태그
thumbnailBase64?: string // 제품 썸네일(대표) 사진(base64) - jpg, jpeg, webp, png, gif, svg
photoBase64?: string // 제품 상세 사진(base64) - jpg, jpeg, webp, png, gif, svg
isSoldOut?: boolean // 제품 매진 여부
discountRate?: number // 제품 할인율
}
{
"price": 1500
}
응답 데이터 타입 및 예시:
interface ResponseValue { // 수정한 제품의 상세 내용
id: string // 제품 ID
title: string // 제품 이름
price: number // 제품 가격
description: string // 제품 상세 설명
tags: string[] // 제품 태그
thumbnail: string | null // 제품 썸네일 이미지(URL)
photo: string | null // 제품 상세 이미지(URL)
isSoldOut: boolean // 제품 매진 여부
discountRate: number // 제품 할인율
}
{
"id": "nbqtQvEivYwEXTDet7YM",
"title": "MacBook Pro 16",
"price": 1500,
"description": "역대 가장 강력한 MacBook Pro가 등장했습니다. 최초의 프로용 Apple Silicon인 M1 Pro 또는 M1 Max 칩을 탑재해 쏜살같이 빠른 속도는 물론, 획기적인 성능과 놀라운 배터리 사용 시간을 자랑하죠. 여기에 시선을 사로잡는 Liquid Retina XDR 디스플레이, Mac 노트북 사상 최고의 카메라 및 오디오 그리고 더할 나위 없이 다양한 포트까지. 기존 그 어떤 카테고리에도 속하지 않는 노트북. 새로운 MacBook Pro는 그야말로 야수입니다.",
"tags": [
"가전",
"노트북",
"컴퓨터"
],
"thumbnail": "https://storage.googleapis.com/heropy-api/vIKMk_jy4Yv195256.png",
"photo": "https://storage.googleapis.com/heropy-api/voihKb3NLGcv195257.png",
"isSoldOut": false,
"discountRate": 0
}
curl https://asia-northeast3-heropy-api.cloudfunctions.net/api/products/:productId
\ -X 'DELETE'
\ -H 'masterKey: true'
요청 데이터 타입 및 예시:
응답 데이터 타입 및 예시:
type ResponseValue = true // 제품 삭제 처리 상태
curl https://asia-northeast3-heropy-api.cloudfunctions.net/api/products/:productId
\ -X 'GET'
요청 데이터 타입 및 예시:
응답 데이터 타입 및 예시:
interface ResponseValue { // 제품의 상세 내용
id: string // 제품 ID
title: string // 제품 이름
price: number // 제품 가격
description: string // 제품 상세 설명
tags: string[] // 제품 태그
thumbnail: string | null // 제품 썸네일 이미지(URL)
photo: string | null // 제품 상세 이미지(URL)
isSoldOut: boolean // 제품 매진 여부
reservations: Reservation[] // 제품의 모든 예약 정보 목록
discountRate: number // 제품 할인율
}
interface Reservation {
start: string // 예약 시작 시간
end: string // 예약 종료 시간
isCanceled: boolean // 예약 취소 여부
isExpired: boolean // 예약 만료 여부
}
{
"id": "nbqtQvEivYwEXTDet7YM",
"title": "MacBook Pro 16",
"price": 3360000,
"description": "역대 가장 강력한 MacBook Pro가 등장했습니다. 최초의 프로용 Apple Silicon인 M1 Pro 또는 M1 Max 칩을 탑재해 쏜살같이 빠른 속도는 물론, 획기적인 성능과 놀라운 배터리 사용 시간을 자랑하죠. 여기에 시선을 사로잡는 Liquid Retina XDR 디스플레이, Mac 노트북 사상 최고의 카메라 및 오디오 그리고 더할 나위 없이 다양한 포트까지. 기존 그 어떤 카테고리에도 속하지 않는 노트북. 새로운 MacBook Pro는 그야말로 야수입니다.",
"tags": [
"가전",
"노트북",
"컴퓨터"
],
"thumbnail": "https://storage.googleapis.com/heropy-api/vIKMk_jy4Yv195256.png",
"photo": "https://storage.googleapis.com/heropy-api/voihKb3NLGcv195257.png",
"isSoldOut": false,
"reservations": [],
"discountRate": 0
}
예약 정보(reservation
)가 있는 경우:
{
"reservations": [
{
"reservation": {
"start": "2021-11-12T06:00:00.000Z",
"end": "2021-11-12T07:00:00.000Z",
"isCanceled": false,
"isExpired": true
}
}
]
}
curl https://asia-northeast3-heropy-api.cloudfunctions.net/api/products/search
\ -X 'POST'
요청 데이터 타입 및 예시:
interface RequestBody {
searchText?: string // 검색할 제품 이름
searchTags?: string[] // 검색할 제품 태그
}
{
"searchText": "삼성전자",
"searchTags": ["가전"]
}
응답 데이터 타입 및 예시:
type ResponseValue = Product[] // 관리하는 모든 제품의 목록
interface Product { // 제품 정보
id: string // 제품 ID
title: string // 제품 이름
price: number // 제품 가격
description: string // 제품 설명(최대 100자)
tags: string[] // 제품 태그
thumbnail: string | null // 제품 썸네일 이미지(URL)
discountRate: number // 제품 할인율
}
[
{
"id": "cFmeC7aY5KjZbBAdJE9y",
"title": "삼성전자 스마트모니터 M7 S43AM700",
"price": 639000,
"description": "107.9cm(43인치) / 와이드(16:9) / 평면 / VA / 3840 x 2160(4K UHD) / 픽셀피치: 0.2451mm / 8ms(GTG) / 300cd / 5,00",
"tags": [
"가전",
"모니터",
"컴퓨터"
],
"thumbnail": "https://storage.googleapis.com/heropy-api/vBAK4MQdH5v195712.png",
"discountRate": 0
}
]
계좌 목록 및 잔액 조회
API를 사용하세요)curl https://asia-northeast3-heropy-api.cloudfunctions.net/api/products/buy
\ -X 'POST'
\ -H 'Authorization: Bearer <accessToken>'
요청 데이터 타입 및 예시:
interface RequestBody {
productId: string // 거래할 제품 ID (필수!)
accountId: string // 결제할 사용자 계좌 ID (필수!)
reservation?: { // 예약 정보(예약 시스템을 사용하는 경우만 필요)
start: string // 예약 시작 시간(ISO)
end: string // 예약 종료 시간(ISO)
}
}
const isoString = new Date().toISOString()
{
"productId": "nbqtQvEivYwEXTDet7YM",
"accountId": "Mq2KKHk8vlmr6Xkg58Fa",
"reservation": {
"start": "2021-11-12T06:00:00.000Z",
"end": "2021-11-12T07:00:00.000Z"
}
}
응답 데이터 타입 및 예시:
type ResponseValue = true // 거래 신청 처리 여부
curl https://asia-northeast3-heropy-api.cloudfunctions.net/api/products/cancel
\ -X 'POST'
\ -H 'Authorization: Bearer <accessToken>'
요청 데이터 타입 및 예시:
interface RequestBody {
detailId: string // 취소할 제품의 거래 내역 ID
}
{
"detailId": "dMhfxyrAupQP18OYmywy"
}
응답 데이터 타입 및 예시:
type ResponseValue = true // 거래 취소 처리 여부
curl https://asia-northeast3-heropy-api.cloudfunctions.net/api/products/ok
\ -X 'POST'
\ -H 'Authorization: Bearer <accessToken>'
요청 데이터 타입 및 예시:
interface RequestBody {
detailId: string // 거래(구매) 확정할 제품의 거래 내역 ID
}
{
"detailId": "dMhfxyrAupQP18OYmywy"
}
응답 데이터 타입 및 예시:
type ResponseValue = true // 거래(구매) 확정 처리 여부
curl https://asia-northeast3-heropy-api.cloudfunctions.net/api/products/transactions/details
\ -X 'GET'
\ -H 'Authorization: Bearer <accessToken>'
요청 데이터 타입 및 예시:
응답 데이터 타입 및 예시:
type RequestValue = TransactionDetail[] // 모든 거래 내역의 목록
interface TransactionDetail { // 거래 내역 정보
detailId: string // 거래 내역 ID
product: { // 거래한 제품 정보
productId: string
title: string
price: number
description: string
tags: string[]
thumbnail: string | null
discountRate: number // 제품 할인율
}
reservation: Reservation | null // 거래한 제품의 예약 정보
timePaid: string // 제품을 거래한 시간
isCanceled: boolean // 거래 취소 여부
done: boolean // 거래 완료 여부
}
interface Reservation {
start: string // 예약 시작 시간
end: string // 예약 종료 시간
isCanceled: boolean // 예약 취소 여부
isExpired: boolean // 예약 만료 여부
}
[
{
"detailId": "9jAoagzrZBkSWI5NctEB",
"product": {
"productId": "nbqtQvEivYwEXTDet7YM",
"title": "MacBook Pro 16",
"price": 3360000,
"description": "역대 가장 강력한 MacBook Pro가 등장했습니다. 최초의 프로용 Apple Silicon인 M1 Pro 또는 M1 Max 칩을 탑재해 쏜살같이 빠른 속도는 물론, 획기적인 성",
"tags": [
"가전",
"노트북",
"컴퓨터"
],
"thumbnail": "https://storage.googleapis.com/heropy-api/vIKMk_jy4Yv195256.png",
"discountRate": 0
},
"reservation": null,
"timePaid": "2021-11-07T20:17:32.112Z",
"isCanceled": true,
"done": false
},
{
"detailId": "dMhfxyrAupQP18OYmywy",
"product": {
"productId": "cFmeC7aY5KjZbBAdJE9y",
"title": "삼성전자 스마트모니터 M7 S43AM700",
"price": 639000,
"description": "107.9cm(43인치) / 와이드(16:9) / 평면 / VA / 3840 x 2160(4K UHD) / 픽셀피치: 0.2451mm / 8ms(GTG) / 300cd / 5,00",
"tags": [
"가전",
"모니터",
"컴퓨터"
],
"thumbnail": "https://storage.googleapis.com/heropy-api/vBAK4MQdH5v195712.png",
"discountRate": 0
},
"reservation": {
"start": "2021-11-12T06:00:00.000Z",
"end": "2021-11-12T07:00:00.000Z",
"isCanceled": false,
"isExpired": true
},
"timePaid": "2021-11-07T20:01:49.100Z",
"isCanceled": false,
"done": true
}
]
curl https://asia-northeast3-heropy-api.cloudfunctions.net/api/products/transactions/detail
\ -X 'POST'
\ -H 'Authorization: Bearer <accessToken>'
요청 데이터 타입 및 예시:
interface RequestBody {
detailId: string // 상세 내용을 확인할 거래(구매) 내역 ID
}
{
"detailId": "dMhfxyrAupQP18OYmywy"
}
응답 데이터 타입 및 예시:
interface TransactionDetail { // 상세 거래 정보
detailId: string // 거래 내역 ID
account: { // 거래한 사용자의 계좌 정보
bankName: string
bankCode: string
accountNumber: string
}
product: { // 거래한 제품 정보
productId: string
title: string
price: number
description: string
tags: string[]
thumbnail: string | null
photo: string | null
discountRate: number // 제품 할인율
}
reservation: Reservation | null // 거래한 제품의 예약 정보
timePaid: string // 제품을 거래한 시간
isCanceled: boolean // 거래 취소 여부
done: boolean // 거래 완료 여부
}
interface Reservation {
start: string // 예약 시작 시간
end: string // 예약 종료 시간
isCanceled: boolean // 예약 취소 여부
isExpired: boolean // 예약 만료 여부
}
{
"detailId": "dMhfxyrAupQP18OYmywy",
"account": {
"bankName": "KB국민은행",
"bankCode": "004",
"accountNumber": "123-XX-XXXX-XXX"
},
"product": {
"productId": "cFmeC7aY5KjZbBAdJE9y",
"title": "삼성전자 스마트모니터 M7 S43AM700",
"price": 639000,
"description": "107.9cm(43인치) / 와이드(16:9) / 평면 / VA / 3840 x 2160(4K UHD) / 픽셀피치: 0.2451mm / 8ms(GTG) / 300cd / 5,000:1 / 최대 주사율: 60Hz / HDMI 2.0 / USB Type-C / 플리커 프리 / 블루라이트 차단 / 게임모드 지원 / 스피커 / 리모컨 / USB허브 / Wi-Fi(무선) / 스마트TV / 블루투스 / 틸트(상하) / 200 x 200mm / HDR / HDR10 / 10.6kg 기획전 차세대 게임 라이프 PS5 매력분석 관련기사 큐소닉, 43인치 4K UHD 스마트 모니터 ‘삼성전자 M7 S43AM700’ 출시 및 할인 행사 사용기 삼성 스마트모니터 m7 s43am700",
"tags": [
"가전",
"모니터",
"컴퓨터"
],
"thumbnail": "https://storage.googleapis.com/heropy-api/vBAK4MQdH5v195712.png",
"photo": "https://storage.googleapis.com/heropy-api/vVLP-ox_zSDv195712.jpg",
"discountRate": 0
},
"reservation": null,
"timePaid": "2021-11-07T20:01:49.100Z",
"isCanceled": false,
"done": true
}