Skip to content

Commit

Permalink
[fix] 상품 목록 조회시 tradingRegion, status 응답형식 변경 (#108)
Browse files Browse the repository at this point in the history
* #107 fix: regions.csv 수정

* #107 fix: 응답형식 문제 해결
  • Loading branch information
yonghwankim-dev authored Sep 23, 2023
1 parent 1ddd420 commit 8573422
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 2 deletions.
3 changes: 3 additions & 0 deletions backend/docker-compose-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ services:
- backend_net
environment:
- NODE_ENV=prod
- VITE_APP_BASE_URL=http://localhost:8080/api
- VITE_APP_OAUTH_URL=https://kauth.kakao.com/oauth/authorize?response_type=code&client_id=a1bc0451582fb5371039f8cd515a584c&redirect_uri=http://localhost:5173/my-account/oauth
- VITE_APP_OAUTH_PROVIDER=kakao
db:
container_name: second_hand_db
image: mysql:latest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public Slice<ItemResponse> findByIdAndRegion(Long itemId, String region, int siz
item.id.as("itemId"),
item.thumbnailUrl,
item.title,
item.region,
item.region.as("tradingRegion"),
item.createdAt,
item.price,
item.status,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.Arrays;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

import codesquard.app.api.errors.errorcode.ItemErrorCode;
import codesquard.app.api.errors.exception.RestApiException;
Expand All @@ -17,6 +18,7 @@ public enum ItemStatus {
SOLD_OUT("판매완료"),
RESERVED("예약중");

@JsonValue
private final String status;

@JsonCreator
Expand Down
16 changes: 16 additions & 0 deletions backend/src/main/resources/db/mysql/data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,22 @@ VALUES (0, '롤러블레이드 팝니다', now(), 169000, '청운동', 'ON_SALE'
'https://second-hand-team03-a.s3.ap-northeast-2.amazonaws.com/public/sample/roller_blade.jpeg',
'롤러 블레이드', 0, 0, 1, 1);

INSERT INTO item(chat_count,
content,
created_at,
price,
region,
status,
thumbnail_url,
title,
view_count,
wish_count,
category_id,
member_id)
VALUES (0, '롤러블레이드 팝니다', now(), 169000, '역삼1동', 'ON_SALE',
'https://second-hand-team03-a.s3.ap-northeast-2.amazonaws.com/public/sample/roller_blade.jpeg',
'롤러 블레이드', 0, 0, 1, 1);

INSERT INTO image (image_url, thumbnail, item_id)
VALUES ('https://second-hand-team03-a.s3.ap-northeast-2.amazonaws.com/public/sample/roller_blade.jpeg',
true,
Expand Down
3 changes: 2 additions & 1 deletion backend/src/main/resources/regions.csv
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,8 @@
서울 서초구 내곡동
서울 서초구 염곡동
서울 서초구 신원동
서울 강남구 역삼동
서울 강남구 역삼1동
서울 강남구 역삼2동
서울 강남구 개포동
서울 강남구 청담동
서울 강남구 삼성동
Expand Down

0 comments on commit 8573422

Please sign in to comment.