Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

12/08 메인 오류 #5

Open
Ccolornyong opened this issue Dec 8, 2024 · 1 comment
Open

12/08 메인 오류 #5

Ccolornyong opened this issue Dec 8, 2024 · 1 comment

Comments

@Ccolornyong
Copy link
Collaborator

내 파트 다 해서 메인이랑 합쳤는데 오류가 났어

CocktailDTO랑 Utils랑 달라서 생긴 문제인데,

  • CocktailDTO
    private Long idx;

    private String name; // 칵테일 이름
    private int abv; // 도수
    private String taste; // 칵테일 맛
    private int ageGroup; // 연령대
    private String snacks; // 안주
    private int priceRange; // 가격
    private String cocktailInfo; // 정보
    private String image; // 이미지
    private List ingredients;

  • Utils
    return new CocktailDTO(
    entity.getIdx(),
    entity.getName(),
    entity.getAbv(),
    entity.getTaste(),
    entity.getAgeGroup(),
    entity.getSnacks(),
    entity.getPriceRange(),
    entity.getCocktailInfo(),
    entity.getImage(),
    ingredientDTOS
    );

이렇게 하면 내 파트는 문제 없이 동작하는 것 같아

@Ccolornyong
Copy link
Collaborator Author

Ccolornyong commented Dec 8, 2024

그리고 추가로 만든 table ingredient SQL 구문 올려놓을게

CREATE TABLE ingredient (
ingredient_idx BIGINT(20) AUTO_INCREMENT PRIMARY KEY,
ing_idx BIGINT(20) NOT NULL,
name VARCHAR(255) NOT NULL,
base_info VARCHAR(255) NOT NULL,
image VARCHAR(255) NOT NULL,
CONSTRAINT FK_ingredient_cocktail FOREIGN KEY (ing_idx) REFERENCES cocktail (idx) ON UPDATE CASCADE ON DELETE CASCADE
);

-- 데이터 삽입 시 ingredient_idx 생략
INSERT INTO ingredient (ing_idx, name, base_info, image) VALUES
(1, "데킬라", "증류주의 한 종류. 알코올 도수는 대개 40도 이상이며 주로 칵테일을 제조하는 데 많이 사용된다.", "/img/base4.jpg"),
(1, "럼", "사탕수수즙 또는 당밀 등의 제당 공정 부산물을 발효·증류시켜 만든 증류주. 달콤한 냄새와 특유의 맛이 있고, 알콜분은 44∼45%, 엑스트랙트분은 0.2∼0.8%이다.", "/img/base3.jpg"),
(1, "비번 위스키", "아메리칸 위스키의 한 종류. 줄여서 '버번' 또는 '버본'이라 부른다. '부르봉'이라고 드물게 불린다.", "/img/base2.jpg"),
(1, "라이 위스키", "미국과 캐나다에서 생산되는 위스키의 한 종류. 호밀을 주원료로 사용해서 만든 위스키를 뜻한다. 줄여서 '라이'라고 부른다.", "/img/base6.jpg"),
(1, "럼", "멕시코에서 생산되는 술. 증류주 중 하나로 알콜 농도는 38~52%. 할리스코 주에 위치한 테킬라1라는 지역의 이름을 딴 것.", "/img/base1.jpg"),
(1, "진", "에베베", "/img/base1.jpg");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant