Skip to content

Response_Format

BeautterLife edited this page Jan 23, 2023 · 101 revisions

모든 응답 헤더는 Content-Type: application-json을 포함한다.

인증이 요구되는 end point에 대한 응답은 token: jwt.token.here을 포함한다.

모든 응답 메시지는 다음과 같이 code, message, data 필드를 가진다.

{
  "code": 200,
  "message": "Success",
  "data": {
    "member": {
      "id": 1,
      "token": "jwt.token.here",
      "email": "[email protected]",
      "offerLevel": 1
      "nickname": "awesomeo184",
      "profileImageUrl": "profile_image_url",
      "address": "동대문구 회기동"
    }
  }
}

Member

{
  "member": {
    "id": 1,
    "token": "jwt.token.here",
    "email": "[email protected]",
    "offerLevel": 1
    "nickname": "awesomeo184",
    "profileImageUrl": "profile_image_url",
    "address": "동대문구 회기동"
  }
}

카카오 로그인의 경우 email 필드는 카카오의 고유 회원 식별 아이디로 대체되며 address 필드는 빈 값으로 대체됨

MemberProfile

{
	"member": {
		"id": 1,
		"offerLevel": 1,
		"nickname": "awesomeo184",
		"profileImageUrl": "aws.bucket.url",
		"address": "동대문구 회기동" 
	},
	"sellingArticleCount": 30,
	"reviewCount": 60
}

MyProfile

{
	"member": {
		"id": 1,
		"offerLevel": 1,
		"nickname": "awesomeo184",
		"profileImageUrl": "aws.bucket.url",
		"address": "동대문구 회기동" 
	},
	"sellingArticleCount": 30,
	"likedArticleCount": 60,
	"offerCount": 60,
	"reviewCount": 60
}

Artice

{
            "id": 2,
            "author": {
                "id": 1,
                "email": "string",
                "offerLevel": 1,
                "nickname": "123",
                "profileImageUrl": "http://naver.com",
                "address": "string"
            },
            "title": "제목입니다.",
            "content": "내용입니다.",
            "category": {
                "code": 7,
                "name": "유아도서"
            },
            "tradeStatus": {
                "code": 4,
                "name": "판매중"
            },
            "tradeArea": "서울시 강남구",
            "productStatus": {
                "code": 2,
                "name": "새상품"
            },
            "tradeMethod": {
                "code": 4,
                "name": "택배거래"
            },
            "quantity": 5,
            "price": 36500,
            "mainImageUrl": "http://naver.com",
            "createdDate": "2021-12-10T15:01:30",
            "modifiedDate": "2021-12-10T15:01:30",
            "likeCount": 0,
            "viewCount": 1,
            "isLiked": false
       
}

비로그인 사용자에 대해서는 isLiked필드가 false 로 응답된다.

Articles

{
        "elements": [
            {
                "id": 4,
                "mainImageUrl": "string",
                "title": "string",
                "price": 36500,
                "tradeArea": "서울시 강남구",
                "tradeStatus": {
                    "code": 4,
                    "name": "판매중"
                },
                "createdDate": "2021-12-10T14:25:30",
                "modifiedDate": "2021-12-10T14:25:30",
                "isLiked": false
                "likeCount" : 0 // Todo
                "isReviewed" : false // Todo
                "sellerNickName" : "hypeboy" // Todo
            },
            {
                "id": 2,
                "mainImageUrl": "string",
                "title": "string",
                "price": 8000,
                "tradeArea": "서울시 강남구",
                "tradeStatus": {
                    "code": 4,
                    "name": "판매중"
                },
                "createdDate": "2021-12-10T14:23:53",
                "modifiedDate": "2021-12-10T14:23:53",
                "isLiked": false
                "likeCount" : 0 // Todo
                "isReviewed" : false // Todo
                "sellerNickName" : "hypeboy" // Todo
            }
        ],
        "pageInfo": {
            "currentPageNumber": 1,
            "lastPageNumber": 1,
            "sizePerPage": 2,
            "totalElementCount": 2,
            "isFirstPage": true,
            "isLastPage": true
        }
}

Offer

{
  "offer": {
    "id": 23,
    "offerer": {
      "id": 1,
      "nickname": "awesomeo184",
      "address": "동대문구 회기동",
      "offerLevel": 1,
      "profileImageUrl": "http://sss"
    },
    "articleId": 2,
    "price": 1500,
    "createdDate": "2021-12-02T19:19:18",
    "isSelected": false
  },
  "offerCountOfCurrentMember": 0
}

Offers

{
  "elements" : [
       {
          "id": 23,
          "offerer": {
              "id": 1,
              "nickname": "awesomeo184",
              "address": "동대문구 회기동",
              "offerLevel": 2,
              "profileImageUrl": "http://sss"
           },
           "articleId": 2,
           "price": 1500,
           "createdDate": "2021-12-02T19:19:18",
           "isSelected": false
       },
       {
           "id": 24,
           "offerer": {
              "id": 2,
              "nickname": "awesomeo184",
              "address": "동대문구 회기동",
              "offerLevel": 2,
              "profileImageUrl": "http://sss"
           },
           "articleId": 2,
           "price": 1700,
           "createdDate": "2021-12-03T19:19:18",
           "isSelected": true
       }
   ],
  "pageInfo": {
       "currentPageNumber": 1,
       "lastPageNumber": 1,
       "sizePerPage": 2,
       "totalElementCount": 2,
       "isFirstPage": true,
       "isLastPage": true
   },
   "offerCountOfCurrentMember": 1
}

Review

{
    "review": {
      "id": 4,
      "reviewer": {
        "id": 1,
        "profileImageUrl": "http://~~~"
        "nickname": "awesomeo184",
        "offerLevel": 1
      },
      "article": {
          "id": 1,
          "title": "exam title"
      },
      "score": 2,
      "content": "쿨거래 조아요",
      "createdDate": "2021-12-02T19:19:18"
    }
}

Reviews

  • 타사용자의 프로필에서 리뷰조회시, isWritingAvailableFromCurrentMember는 반환되지 않음.
{
  "elements": [
    {
      "id": 4,
      "reviewer": {
        "id": 1,
        "profileImageUrl": "http://~~~"
        "nickname": "awesomeo184",
        "offerLevel": 1
      },
      "article": {
          "id": 1,
          "title": "exam title"
      },
      "score": 2,
      "content": "쿨거래 조아요",
      "isWritingAvailableFromCurrentMember": true,
      "createdDate": "2021-12-02T19:19:18"
    },
    {
      "id": 5,
      "reviewer": {
        "id": 1,
        "profileImageUrl": "http://~~~"
        "nickname": "awesomeo184",
        "offerLevel": 1
      },
      "article": {
          "id": 1,
          "title": "exam title"
      },
      "score": 2,
      "content": "쿨거래 조아요",
      "isWritingAvailableFromCurrentMember": false,
      "createdDate": "2021-12-02T19:19:18"
    },
    {
      "id": 6,
      "reviewer": {
        "id": 1,
        "profileImageUrl": "http://~~~"
        "nickname": "awesomeo184",
        "offerLevel": 1
      },
      "article": {
          "id": 1,
          "title": "exam title"
      },
      "score": 2,
      "content": "쿨거래 조아요",
      "isWritingAvailableFromCurrentMember": true,
      "createdDate": "2021-12-02T19:19:18"
    }
  ],
  "pageInfo": {
       "currentPageNumber": 1,
       "lastPageNumber": 2,
       "sizePerPage": 3,
       "totalElementCount": 6,
       "firstPage": true,
       "lastPage": false
   }
}

ArticleCreateResponse

{
        "articleId": 2,
        "createdDate": "2021-12-10T14:53:49",
        "modifiedDate": "2021-12-10T14:53:49"
}

ArticleImageUrls

{   
    "imageUrls" : [
        "http://~~~~~",
        "http://~~~~~",
        "http://~~~~~"
    ]
}

ImageUrls

{   
    "imageUrls" : [
        "http://~~~~~",
        "http://~~~~~",
        "http://~~~~~"
    ]
}

ImageUrl

{   
    "imageUrls" : "http://~~~~~"
}

Infos

{
        "categories": [
            {
                "code": 1,
                "name": "인기매물"
            },
            {
                "code": 2,
                "name": "디지털기기"
            },
            {
                "code": 3,
                "name": "생활가전"
            },
            {
                "code": 4,
                "name": "가구/인테리어"
            },
            {
                "code": 5,
                "name": "유아동"
            },
            {
                "code": 6,
                "name": "생활/가공식품"
            },
            {
                "code": 7,
                "name": "유아도서"
            },
            {
                "code": 8,
                "name": "스포츠/레저"
            },
            {
                "code": 9,
                "name": "여성잡화"
            },
            {
                "code": 10,
                "name": "여성의류"
            },
            {
                "code": 11,
                "name": "남성패션/잡화"
            },
            {
                "code": 12,
                "name": "게임/취미"
            },
            {
                "code": 13,
                "name": "뷰티/미용"
            },
            {
                "code": 14,
                "name": "반려동물용품"
            },
            {
                "code": 15,
                "name": "도서/티켓/음반"
            },
            {
                "code": 16,
                "name": "식물"
            },
            {
                "code": 17,
                "name": "식품"
            },
            {
                "code": 18,
                "name": "기타 중고물품"
            },
            {
                "code": 19,
                "name": "삽니다"
            }
        ],
        "productStatus": [
            {
                "code": 2,
                "name": "새상품"
            },
            {
                "code": 4,
                "name": "중고상품"
            }
        ],
        "tradeMethod": [
            {
                "code": 2,
                "name": "직거래"
            },
            {
                "code": 4,
                "name": "택배거래"
            },
            {
                "code": 8,
                "name": "상관없음"
            }
        ],
        "tradeStatus": [
            {
                "code": 2,
                "name": "예약중"
            },
            {
                "code": 4,
                "name": "판매중"
            },
            {
                "code": 8,
                "name": "거래완료"
            }
        ]
}

MessageContent

{
        "content": "일반 쪽지 1->2",
        "createdDate": "2021-12-15T12:56:28"
}

AllMessage

{
        "elements": [
            {
                "messageId" : "10",
                "content": "offer 쪽지",
                "isSendMessage": true,
                "createdDate": "2021-12-15T00:12:43"
            },
            {
                "messageId" : "8",
                "content": "일반 쪽지 member 2-> member 1",
                "isSendMessage": true,
                "createdDate": "2021-12-15T00:13:49"
            },
            {
                "messageId" : "6",
                "content": "일반 쪽지 member 1->member 2",
                "isSendMessage": false,
                "createdDate": "2021-12-15T00:15:31"
            }
        ],
        "pageInfo": {
            "currentPageNumber": 1,
            "lastPageNumber": 1,
            "sizePerPage": 20,
            "totalElementCount": 3,
            "isLastPage": true,
            "isFirstPage": true
        }
}

MessageRoomInfo

{
        "articleInfo": {
            "title": "Galaxy1",
            "price": 100,
            "offerPrice": 2344,
            "productImageUrl" : "상품 이미지 url"
        },
        "offerInfo": {
            "offerPrice": 3000,
            "isSelected": false    # 거래 완료 여부
        }
        "messagePartnerInfo": {
            "nickName": "2",
            "profileImageUrl": null
        }
}

MessageBox

{
        "elements": [
            {
                "userInfo": {
                    "nickName": "2",
                    "profileImageUrl": null,
                    "address": "asf"
                },
                "productImageUrl": "sad",
                "message": {
                    "content": "제안 쪽지 2->1 offer 2 article 2",
                    "createdDate": "2021-12-15T13:55:19"
                },
                "messageRoomId": 4
            },
            {
                "userInfo": {
                    "nickName": "2",
                    "profileImageUrl": null,
                    "address": "asf"
                },
                "productImageUrl": "sad",
                "message": {
                    "content": "제안 쪽지 2->1 offer 1 article 1",
                    "createdDate": "2021-12-15T13:55:08"
                },
                "messageRoomId": 2
            }
        ],
        "pageInfo": {
            "currentPageNumber": 1,
            "lastPageNumber": 1,
            "sizePerPage": 20,
            "totalElementCount": 2,
            "isLastPage": true,
            "isFirstPage": true
        }
    }

isLiked

{
  "isLiked": true
}

ReviewCreateResponse

{
        "id": 2,
        "createdDate": "2021-12-15T14:39:22"
}
Clone this wiki locally