code stringlengths 41 34.3k | lang stringclasses 8
values | review stringlengths 1 4.74k |
|---|---|---|
@@ -0,0 +1,34 @@
+package domain.result;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.Arrays;
+
+public enum GameResult {
+ WIN(1, new BigDecimal("1")),
+ DRAW(0, new BigDecimal("0")),
+ LOSE(-1, new BigDecimal("-1"));
+
+ private static final int SCALE = 0;
+
+ priva... | Java | ์ธํ
๋ฆฌ์ ์ด ํ๋ฉด์ ์ฐ์ธก ์ธ๋ก์ ์ ๋๊ธฐ๋ ๊ฒฝ์ฐ์๋ ๊ฐ๊ธ์ ๋์ด์ฐ๊ธฐ๋ฅผ ํด์ฃผ์ธ์ ๐
 |
@@ -0,0 +1,36 @@
+package domain.card;
+
+import domain.user.User;
+import domain.user.Users;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+public class Deck {
+ private static final int ZERO = 0;
+ private static final int NUMBER_OF_CARDS_BY_RULE = 2;
+ private stati... | Java | ๊ฐ์ธ์ ์ธ ์๊ฐ์ด์ง๋ง, cards๋ฅผ ``Stack`` ์ด๋ ``Queue`` ์๋ฃํ์ ์ฌ์ฉํด๋ณด๋ ๊ฒ๋ ์ข์ ๊ฒ ๊ฐ์์ ๐
์ด๋ฐ ๋ฐฉ๋ฒ๋ ์๋ค ์ ๋ก๋ ์์๋ฉด ์ข์๊ฑฐ ๊ฐ์์ |
@@ -1,4 +1,70 @@
package controller;
+
+import domain.card.Deck;
+import domain.user.*;
+import view.InputView;
+import view.OutputView;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+import static java.util.stream.Collectors.toList;
+
public class BlackJackGame {
+
+ public static void main(String[]... | Java | ์ด ๋ถ๋ถ์ ๊ดํ์ฌ [์ฐธ๊ณ ์๋ฃ](https://namocom.tistory.com/754)๋ฅผ ์ฐพ์๋ดค์ต๋๋ค! |
@@ -1,4 +1,70 @@
package controller;
+
+import domain.card.Deck;
+import domain.user.*;
+import view.InputView;
+import view.OutputView;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+import static java.util.stream.Collectors.toList;
+
public class BlackJackGame {
+
+ public static void main(String[]... | Java | ๊ณผ๋ํ๊ฒ ์์๊ฐ์ `View`์ ์ ๋ฌํ๋ ค๊ณ ํ๋ ๊ฒ ๊ฐ์ต๋๋ค. ํผ๋๋ฐฑ ๊ฐ์ฌํฉ๋๋ค :) |
@@ -1,4 +1,70 @@
package controller;
+
+import domain.card.Deck;
+import domain.user.*;
+import view.InputView;
+import view.OutputView;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+import static java.util.stream.Collectors.toList;
+
public class BlackJackGame {
+
+ public static void main(String[]... | Java | ๋์ณค๋ ๋ถ๋ถ์ด๋ค์! ๊ผผ๊ผผํ ํผ๋๋ฐฑ ๊ฐ์ฌํฉ๋๋ค :) |
@@ -1,4 +1,70 @@
package controller;
+
+import domain.card.Deck;
+import domain.user.*;
+import view.InputView;
+import view.OutputView;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+import static java.util.stream.Collectors.toList;
+
public class BlackJackGame {
+
+ public static void main(String[]... | Java | ์ ๋
ํ๋๋ก ํ๊ฒ ์ต๋๋ค! |
@@ -1,6 +1,18 @@
package domain.card;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
public class Card {
+ private static final List<Card> CACHED_CARDS = new ArrayList<>();
+
+ static {
+ for (Symbol symbol : Symbol.values()) {
+ Arrays.stream(Type.values())... | Java | ํผ๋๋ฐฑ ๊ฐ์ฌํฉ๋๋ค :)
Enum์ ์ ์ธ๋ ๊ฒ๋ค๋ง ์กด์ฌํ๊ธฐ ๋๋ฌธ์ ์ ์ผํ๋ค๊ณ ๋ณผ ์ ์๊ณ , ๊ทธ๋์ `==`์ ํตํด `๋์ผ์ฑ` ๋น๊ต๋ฅผ ํ๋๊ฒ ๋ง์๊น์?
๋ฌผ๋ก `null`์ ๋ํ ๋ฐฉ์ด๋ ๊ฐ๋ฅํ๊ฒ ์ง๋ง์! |
@@ -0,0 +1,36 @@
+package domain.card;
+
+import domain.user.User;
+import domain.user.Users;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+public class Deck {
+ private static final int ZERO = 0;
+ private static final int NUMBER_OF_CARDS_BY_RULE = 2;
+ private stati... | Java | ๋ฐ์ํ๋๋ก ํ๊ฒ ์ต๋๋ค :) |
@@ -0,0 +1,36 @@
+package domain.card;
+
+import domain.user.User;
+import domain.user.Users;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+public class Deck {
+ private static final int ZERO = 0;
+ private static final int NUMBER_OF_CARDS_BY_RULE = 2;
+ private stati... | Java | ๋์ณค๋ ๋ถ๋ถ์ธ ๊ฒ ๊ฐ์ต๋๋ค. ๋ฐ์ํ๋๋ก ํ๊ฒ ์ต๋๋ค! |
@@ -0,0 +1,34 @@
+package domain.result;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.Arrays;
+
+public enum GameResult {
+ WIN(1, new BigDecimal("1")),
+ DRAW(0, new BigDecimal("0")),
+ LOSE(-1, new BigDecimal("-1"));
+
+ private static final int SCALE = 0;
+
+ priva... | Java | ์ ๋
ํ๋๋ก ํ๊ฒ ์ต๋๋ค. |
@@ -0,0 +1,36 @@
+package domain.card;
+
+import domain.user.User;
+import domain.user.Users;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+public class Deck {
+ private static final int ZERO = 0;
+ private static final int NUMBER_OF_CARDS_BY_RULE = 2;
+ private stati... | Java | ํผ๋๋ฐฑ ๊ฐ์ฌํฉ๋๋ค. ๋ฐ์ํ๊ฒ ์ต๋๋ค :) |
@@ -1,4 +1,70 @@
package controller;
+
+import domain.card.Deck;
+import domain.user.*;
+import view.InputView;
+import view.OutputView;
+
+import java.math.BigDecimal;
+import java.util.List;
+
+import static java.util.stream.Collectors.toList;
+
public class BlackJackGame {
+
+ public static void main(String[]... | Java | ์์ง ์ปจํธ๋กค๋ฌ์ ๋ํ ๊ฐ๋
์ด ์์ ์น ์์์ ๊ทธ๋ฐ ๊ฒ ๊ฐ์ต๋๋ค. ๋ฐ์ํ๋๋ก ํ๊ฒ ์ต๋๋ค! |
@@ -0,0 +1,77 @@
+package christmas.controller;
+
+import christmas.constants.ConstantsMessage;
+import christmas.domain.PreviewResult;
+import christmas.domain.event.enums.EventDate;
+import christmas.dto.EventResultDTO;
+import christmas.services.date.DateValidator;
+import christmas.services.order.AmountCalculator;
... | Java | ์ปจํธ๋กค๋ฌ๊ฐ ์ปจํธ๋กค๋ฌ๋ฅผ ์์กดํ๋๋ก ๊ตฌ์ฑํ์
จ๋๋ฐ ์ด๋ ๊ฒ ๊ตฌ์ฑํ์ ์ด์ ๊ฐ ๊ถ๊ธํด์.
๊ฐ์ ๊ณ์ธต ๋ด์์ ์๋ก๋ฅผ ์์กดํ๋ฉด ์ํ ์ฐธ์กฐ๊ฐ ๋ฐ์ํ ์ฌ์ง๋ฅผ ๋ง๋ค๊ฒ ๋ผ์ ์ง์ํ๋ ํธ์ด ์ข๋ค๊ณ ์๊ฐํฉ๋๋ค. |
@@ -0,0 +1,77 @@
+package christmas.controller;
+
+import christmas.constants.ConstantsMessage;
+import christmas.domain.PreviewResult;
+import christmas.domain.event.enums.EventDate;
+import christmas.dto.EventResultDTO;
+import christmas.services.date.DateValidator;
+import christmas.services.order.AmountCalculator;
... | Java | ์์กด์ฑ ์ฃผ์
๋ฐฉ์์ ์ฑํํ์
จ๋ค๋ฉด parse ๊ฐ์ ๋ฌด์ํ์ฑ ํด๋์ค ์ญ์ ์ฑ๊ธํค์ผ๋ก ์์ฑํด์ ์์กด์ฑ ์ฃผ์
ํ๋ ๊ฒ ์ข์ง ์์๊น ์ถ์ต๋๋ค. |
@@ -0,0 +1,29 @@
+package christmas.domain.event;
+
+public class Badge {
+ public static final int BADGE_STAR_LIMIT = 5_000;
+ public static final int BADGE_TREE_LIMIT = 10_000;
+ public static final int BADGE_SANTA_LIMIT = 20_000;
+ private final String badgeType;
+
+ public Badge(int totalDiscountAmou... | Java | ๋ฑ์ง๋ Enum์ผ๋ก ๊ด๋ฆฌํด์ฃผ์
๋ ์ข์ ๊ฒ ๊ฐ์์. |
@@ -0,0 +1,18 @@
+package christmas.domain.event.items;
+
+import christmas.domain.event.enums.EventType;
+
+public abstract class Event {
+ private int discountAmount;
+ private final EventType eventType;
+
+ public Event(EventType eventType) {
+ this.eventType = eventType;
+ }
+
+ public EventTy... | Java | ์ด๋ฒคํธ๋ฅผ ์ธํฐํ์ด์ค๋ก ๊ด๋ฆฌํ์ ๋ถ๋ค์ด ๋ง์๋ฐ ์์์ ํ์ฉํ์ ์ ํฅ๋ฏธ๋ก์์ ๐ |
@@ -0,0 +1,74 @@
+package christmas.domain.menu;
+
+import christmas.domain.menu.items.Appetizer;
+import christmas.domain.menu.items.Beverage;
+import christmas.domain.menu.items.Dessert;
+import christmas.domain.menu.items.MainDish;
+import christmas.domain.menu.items.MenuItem;
+import java.util.Arrays;
+import java.... | Java | ๋ฆฌ์คํธ์ ์ถ๊ฐ๋ก ์์ ์ด๋ ์ญ์ ์์
์ด ์๋ค๋ฉด List.of()๋ก immutable list ๋ฅผ ์ฌ์ฉํ๋ ๊ฒ๋ ์ข์ ๊ฒ ๊ฐ์์. |
@@ -0,0 +1,27 @@
+package christmas.domain.menu.items;
+
+public enum Appetizer implements MenuItem {
+ YANGSONG_ISUPE("์์ก์ด์ํ", 6000),
+ TAPAS("ํํ์ค", 5500),
+ CAESAR_SALAD("์์ ์๋ฌ๋", 8000);
+
+ private final String name;
+ private final int price;
+
+ Appetizer(String name, int price) {
+ this.na... | Java | ๋ณ์ ๋ค์ด๋ฐ ์ปจ๋ฒค์
์ ์ด๋ฌํ ๋ค์ด๋ฐ์ ์ง์ํ๋๋ก ํ ๊ฒ์ผ๋ก ๊ธฐ์ตํด์. BUTTON_MUSHROOM__SOUP ์ด๋ MUSHROOM_SOUP ์ด ๋ ์ ์ ํ ๋ณ์ ์ด๋ฆ์ด ์๋๊น ์๊ฐ๋ฉ๋๋ค. |
@@ -0,0 +1,7 @@
+package christmas.domain.menu.items;
+
+public interface MenuItem {
+ String getName();
+
+ int getPrice();
+} | Java | getType()์ MenuItem ์ธํฐํ์ด์ค์ ๋ฉ์๋์์ ์ ์ธํ ์ด์ ๊ฐ ํน์ ์์๊น์? |
@@ -0,0 +1,77 @@
+package christmas.controller;
+
+import christmas.constants.ConstantsMessage;
+import christmas.domain.PreviewResult;
+import christmas.domain.event.enums.EventDate;
+import christmas.dto.EventResultDTO;
+import christmas.services.date.DateValidator;
+import christmas.services.order.AmountCalculator;
... | Java | ์ ๋ ์ปจํธ๋กค๋ฌ๋ ๋น์ฆ๋์ค ๋ก์ง์ ๊ฐ์ง์ง ์๋ ๊ฒ์ด ์ ํฉํ๋ค๊ณ ์๊ฐํฉ๋๋ค. ์คํ๋ง์์ ์ปจํธ๋กค๋ฌ๋ค์ด ํด๋ผ์ด์ธํธ์ ์์ฒญ์ ์๋ง๋ ์๋น์ค ํด๋์ค๋ค๋ก ๋๊ธฐ๋ ์ญํ ๋ง ํ๋๊ฒ์ฒ๋ผ ๋ง์ด์ฃ . ๊ทธ๋์ ์ ๋ ์ปจํธ๋กค๋ฌ๋ ๊ป๋ฐ๊ธฐ ์ญํ ๋ง ํ ์ง๋ผ๋ ์ปจํธ๋กค๋ฌ์ ๋น์ฆ๋์ค ๋ก์ง์ ๋ด๋นํ๋ ์๋น์ค๋ฅผ ๋ฐ๋ก ๊ตฌํํ์๋๋ฐ ์ด ๋ถ๋ถ์ ๋ํด์ ์ด๋ป๊ฒ ์๊ฐํ์๋์ง ๊ถ๊ธํฉ๋๋ค. |
@@ -0,0 +1,90 @@
+package christmas.domain;
+
+import christmas.constants.ConstantsMessage;
+import christmas.domain.event.enums.EventDate;
+import christmas.domain.event.items.GiftPromotion;
+import christmas.utils.Parser;
+import christmas.vo.EligibleEventVO;
+import christmas.vo.OrderMenuVO;
+import java.util.List;
... | Java | ์์ฑ์๋ฅผ ์ ์ํ์ง ์์๊ฒฝ์ฐ ๊ธฐ๋ณธ ์์ฑ์๊ฐ ์๊ธฐ๋ ๊ฒ์ผ๋ก ์๊ณ ์์ต๋๋ค. ๋ฐ๋ก ์ ์ํ์ ์ด์ ๊ฐ ์๋์ง ๊ถ๊ธํฉ๋๋ค. |
@@ -0,0 +1,90 @@
+package christmas.domain;
+
+import christmas.constants.ConstantsMessage;
+import christmas.domain.event.enums.EventDate;
+import christmas.domain.event.items.GiftPromotion;
+import christmas.utils.Parser;
+import christmas.vo.EligibleEventVO;
+import christmas.vo.OrderMenuVO;
+import java.util.List;
... | Java | ์ด๋ฐ ๋ฐฉ๋ฒ์ด ์์๊ตฐ์! ํ๋ ๋ฐฐ์๊ฐ๋๋ค ๐ |
@@ -0,0 +1,90 @@
+package christmas.domain;
+
+import christmas.constants.ConstantsMessage;
+import christmas.domain.event.enums.EventDate;
+import christmas.domain.event.items.GiftPromotion;
+import christmas.utils.Parser;
+import christmas.vo.EligibleEventVO;
+import christmas.vo.OrderMenuVO;
+import java.util.List;
... | Java | `LINE_SEPARATOR` ์์๋ ์ค๋ฐ๊ฟ์ ์ํด ์ ์ธํ์ ๊ฒ์ผ๋ก ์๊ฐ๋ฉ๋๋ค. ๊ทธ๋ฐ๋ฐ ์ค๋ฐ๊ฟ ๊ธฐ๋ฅ์ด ํ์ํ ๊ณณ์ `LINE_SEPARATOR` ์ `\n` ๋ฅผ ํผ์ฉํด์ ์ฌ์ฉํ๊ณ ๊ณ์ ๊ฒ ๊ฐ์๋ฐ ๊ทธ ์ด์ ๊ฐ ๊ถ๊ธํฉ๋๋ค. |
@@ -0,0 +1,25 @@
+package christmas.domain.event.enums;
+
+import java.time.LocalDate;
+
+public enum EventDate {
+ CHRISTMAS_DAY(LocalDate.of(2023, 12, 25));
+
+ private final LocalDate date;
+
+ EventDate(LocalDate date) {
+ this.date = date;
+ }
+
+ public LocalDate getDate() {
+ return ... | Java | EventDate ๋ ์ฌ๋ฌ ์ด๋ฒคํธ๋ค์์ ์ฌ์ฉํ๋ ๋ ์ง๋ฅผ ์ ์ํ enum ์ด๋ผ๊ณ ์๊ฐ๋์ง๋ง ์ค์ ๋ก ํฌ๋ฆฌ์ค๋ง์ค ๋ฐ์ ์ ์๋์ง ์์์ต๋๋ค. ์ง๊ธ์ฒ๋ผ ๋ค๋ฅธ ์ด๋ฒคํธ๋ค์ ๋ ์ง๋ค๋ ๊ฐ์ด ๊ด๋ฆฌํ ๊ฒ ์๋๋ผ๋ฉด ํด๋์ค ๋ด์์ ์์๋ก ์ ์ธํด๋ ์ถฉ๋ถํ์ง ์์๊น ํ๋ ์๊ฐ์ด ๋๋๋ฐ ์ด๋ป๊ฒ ์๊ฐํ์๋์? |
@@ -0,0 +1,54 @@
+package christmas.domain.event.enums;
+
+import christmas.domain.event.items.ChristmasDdayDiscount;
+import christmas.domain.event.items.Event;
+import christmas.domain.event.items.GiftPromotion;
+import christmas.domain.event.items.SpecialDiscount;
+import christmas.domain.event.items.WeekdayDiscount... | Java | ์ด๋ ๊ฒ enum ์ ์ฌ์ฉํ๋ ๋ฐฉ๋ฒ๋ ์๊ตฐ์! |
@@ -0,0 +1,21 @@
+package christmas.domain.event.items;
+
+import christmas.domain.event.enums.EventType;
+
+public class ChristmasDdayDiscount extends Event {
+ private static final int BASE_DISCOUNT = 1_000;
+ private static final int ADDITIONAL_DISCOUNT_PER_DAY = 100;
+ private static final int CHRISTMAS_DA... | Java | EventDate ์์ ๋ฏธ๋ฆฌ ํฌ๋ฆฌ์ค๋ง์ค ์์๋ฅผ ์ ์ํ๊ธฐ ๋๋ฌธ์ ๊ทธ ๋ถ๋ถ์ ํ์ฉํ๋ ๊ฒ์ด ์ข์๋ณด์
๋๋ค! |
@@ -0,0 +1,18 @@
+package christmas.domain.event.items;
+
+import christmas.domain.event.enums.EventType;
+
+public abstract class Event {
+ private int discountAmount;
+ private final EventType eventType;
+
+ public Event(EventType eventType) {
+ this.eventType = eventType;
+ }
+
+ public EventTy... | Java | ์ถ์ ํด๋์ค์ ์ธํฐํ์ด์ค์ ์ฐจ์ด๋ ์ถ์ํ์ ์ ๋๋ผ๊ณ ์๊ฐํฉ๋๋ค. ์ถ์ํด๋์ค๋ `extends` ํค์๋๋ฅผ ์ฌ์ฉํ์ฌ ํ์ฅ์ ๋ชฉ์ ์ ๊ฐ๊ธฐ ๋๋ฌธ์ ์ถ๊ฐ ๊ตฌํ์ ๊ฐ๋ฅ์ฑ์ด ์์๋ ์ฌ์ฉํ๊ณ ์ธํฐํ์ด์ค๋ `implements` ํค์๋๋ฅผ ์ฌ์ฉํ์ฌ ํน์ ํ์์ ๊ตฌํ์ ๊ฐ์ ํ๋ ๋ชฉ์ ์ด ์๋ค๊ณ ์๊ฐํฉ๋๋ค.
๊ทธ๋ฐ์ ์์ ๋ณผ๋ ์ด๋ฒ ๊ณผ์ ์ ์ด๋ฒคํธ ๋๋ฉ์ธ์ ํ์ฅ์ ๊ฐ๋ฅ์ฑ์ ๋ฎ๋ค๊ณ ์๊ฐํฉ๋๋ค. ํ์ฌ๋ก์๋ ์ด๋ฒคํธ์์ ํ ์ ์๋ ํ์๋ ํ ์ธ ์ด๊ฑฐ๋ ์ฆ์ ํ ๋์ค ํ๋๊ธฐ ๋๋ฌธ์ ์ธํฐํ์ด์ค๋ก ๊ตฌํํด์ผํ๋ค๊ณ ์๊ฐํด์ ์ ๋ ์ธํฐํ์ด์ค๋ฅผ ์ ์ฉํ์ต๋๋ค. ์ถ์ํด๋์ค๋ก ๊ตฌํํ์ ์ด์ ๋ฅผ ์ฌ์ญค๋ณด๊ณ ์ถ์ต๋๋ค. |
@@ -0,0 +1,74 @@
+package christmas.domain.menu;
+
+import christmas.domain.menu.items.Appetizer;
+import christmas.domain.menu.items.Beverage;
+import christmas.domain.menu.items.Dessert;
+import christmas.domain.menu.items.MainDish;
+import christmas.domain.menu.items.MenuItem;
+import java.util.Arrays;
+import java.... | Java | ์๊ตฌ์ฌํญ๊ณผ ๋ค๋ฆ
๋๋ค๐ข ์ด๋ฒ ๊ณผ์ ์์ `switch-case` ๋ ํ์ฉ๋์ง ์์์ต๋๋ค. |
@@ -0,0 +1,27 @@
+package christmas.domain.menu.items;
+
+public enum Appetizer implements MenuItem {
+ YANGSONG_ISUPE("์์ก์ด์ํ", 6000),
+ TAPAS("ํํ์ค", 5500),
+ CAESAR_SALAD("์์ ์๋ฌ๋", 8000);
+
+ private final String name;
+ private final int price;
+
+ Appetizer(String name, int price) {
+ this.na... | Java | ์ ๋ ๋์ํฉ๋๋ค. ๋ง์ฝ ํ์
์ ํ๋ ํ์์ด ์ธ๊ตญ์ธ์ด๋ผ๋ฉด ํผ๋์ด ์๊ธธ์๋ ์์๊ฒ ๊ฐ์ต๋๋ค. |
@@ -0,0 +1,28 @@
+package christmas.domain.menu.items;
+
+public enum MainDish implements MenuItem {
+ T_BONE_STEAK("ํฐ๋ณธ์คํ
์ดํฌ", 55000),
+ BBQ_RIB("๋ฐ๋นํ๋ฆฝ", 54000),
+ SEAFOOD_PASTA("ํด์ฐ๋ฌผํ์คํ", 35000),
+ CHRISTMAS_PASTA("ํฌ๋ฆฌ์ค๋ง์คํ์คํ", 25000);
+
+ private final String name;
+ private final int price;
+
+ MainD... | Java | ๋งค์ง ๋๋ฒ๋ฅผ ๋ฆฌํดํ๊ธฐ ๋ณด๋ค๋ ๋งค๋ด ํ์
๋ ์์ํ ํด์ ๋ฆฌํดํ๋๊ฒ์ ์ด๋จ๊น์? |
@@ -0,0 +1,77 @@
+package christmas.controller;
+
+import christmas.constants.ConstantsMessage;
+import christmas.domain.PreviewResult;
+import christmas.domain.event.enums.EventDate;
+import christmas.dto.EventResultDTO;
+import christmas.services.date.DateValidator;
+import christmas.services.order.AmountCalculator;
... | Java | ```ReservationController```๋ ์์ฝ๊ณผ ๊ด๋ จ๋ ๋น์ฆ๋์ค ๋ก์ง์ ๋ด๋นํ๊ณ , ```EventController```๋ ์ด๋ฒคํธ ๊ด๋ จ๋ ๋น์ฆ๋์ค ๋ก์ง์ ์ฒ๋ฆฌํ๊ณ ์ ํ์ต๋๋ค.
๋ค์ ์ดํด๋ณด๋, ```EventController```๋ ์ปจํธ๋กค๋ฌ๋ณด๋ค๋ Service์ ์ญํ ์ ์ํํ๊ณ ์๋ค๋ ์๊ฐ์ด ๋๋ค์! ๊ธฐ์กด์ ```EventController```์์ ์ฒ๋ฆฌํ๋ ๋น์ฆ๋์ค ๋ก์ง์ ```EventService```๋ก ์ด๋์ํค๋ฉด ๋ ๋์ ๊ตฌ์กฐ๊ฐ ๋ ๊ฒ ๊ฐ์ต๋๋ค. ์ ์ฉํ ํผ๋๋ฐฑ ๊ฐ์ฌํฉ๋๋ค :) |
@@ -0,0 +1,77 @@
+package christmas.controller;
+
+import christmas.constants.ConstantsMessage;
+import christmas.domain.PreviewResult;
+import christmas.domain.event.enums.EventDate;
+import christmas.dto.EventResultDTO;
+import christmas.services.date.DateValidator;
+import christmas.services.order.AmountCalculator;
... | Java | ํด๋น ํด๋์ค์์ ๋จ ํ๋ฒ๋ง ์ฌ์ฉ๋๊ณ , ๋ค๋ฅธ ํด๋์ค์์ ์์กด์ฑ์ด ๋ฎ์ ์์กด์ฑ ์ฃผ์
์ผ๋ก ์ฒ๋ฆฌํ ํ์๊ฐ ์๋ค๊ณ ์๊ฐํ์์ต๋๋ค. |
@@ -0,0 +1,27 @@
+package christmas.domain.menu.items;
+
+public enum Appetizer implements MenuItem {
+ YANGSONG_ISUPE("์์ก์ด์ํ", 6000),
+ TAPAS("ํํ์ค", 5500),
+ CAESAR_SALAD("์์ ์๋ฌ๋", 8000);
+
+ private final String name;
+ private final int price;
+
+ Appetizer(String name, int price) {
+ this.na... | Java | ์ด๋ฐ ๋ถ๋ถ๊น์ง๋ ๊ณ ๋ คํ์ง ๋ชปํ๋ค์...! ์ข์ ์ง์ ๊ฐ์ฌํฉ๋๋ค ๐๐ |
@@ -0,0 +1,74 @@
+package christmas.domain.menu;
+
+import christmas.domain.menu.items.Appetizer;
+import christmas.domain.menu.items.Beverage;
+import christmas.domain.menu.items.Dessert;
+import christmas.domain.menu.items.MainDish;
+import christmas.domain.menu.items.MenuItem;
+import java.util.Arrays;
+import java.... | Java | ์ ๊ฐ ์ ๊ทธ๋ฌ์๊น์... ๐จ ์ด์ง๋ ๋ชฐ๋๋ค์ใ
์ฝ๋๋ฅผ ๊ตฌํํ ๋ ๋ ์ฃผ์ ๊น๊ฒ ํ์ธํด์ผ๊ฒ ์ต๋๋ค! ๊ฐ์ฌํฉ๋๋ค. |
@@ -0,0 +1,7 @@
+package christmas.domain.menu.items;
+
+public interface MenuItem {
+ String getName();
+
+ int getPrice();
+} | Java | ์ด๋ฒ ๊ณผ์ ์์ ์ ๋ง ๋ง์ ์ค์๊ฐ ์์๋ ๊ฒ ๊ฐ์์ ๐ ๊ฐ์ฌํฉ๋๋ค. |
@@ -1,9 +1,100 @@
-function Header(logo, searchBox) {
+import Input from './Input';
+import Button from './Button';
+import { handleSearch } from '../services/handleSeach';
+
+function Header({ logoSrc, logoAlt, onSearch }) {
const headerElement = document.createElement('header');
- headerElement.classList.add(... | JavaScript | ์ ๋ ์ด๋ฒคํธ์ ์ด๋ฆ์ด ์๋ฏธํ๋๊ฒ "ํ์์ ๋ฐ์" ์ด๋ผ๊ณ ์๊ฐํด์.
๊ฐ๋ น, `onChange` ๋ ์ค์ ๋ก change๊ฐ ์ผ์ด๋ฌ์ ๋์ด๊ณ , `onKeyDown` ์ ํค๋ฅผ ๋๋ ์ ๋ ์
๋๋ค.
`onSearch`๋ "๊ฒ์์ด ๋์์ ๋ ๋ฐ์" ์ธ๋ฐ, ์ด ์ปดํฌ๋ํธ์์ ์ค์ ๋ก "๊ฒ์"์ด๋ผ๋ ํ์๊ฐ ์ผ์ด๋ฌ๋ค๊ณ ํ ์ ์์๊น์?
์ง๊ธ์ "๊ฒ์"์ด๋ผ๋ ํ์๋ฅผ ๋ฐ์์ ์ฃผ์
ํด์ฃผ๊ณ , ์ด ์ปดํฌ๋ํธ ๋ด๋ถ์์ ์ผ์ด๋ ์ผ์ "์ํฐํค๋ฅผ ๋๋ ์" ์
๋๋ค.
์ฆ, ์ด๋ฒคํธ๋ "๊ฒ์ํ์ ๋ ๋ฐ์ํจ"์ ์ด์ผ๊ธฐํ๊ณ ์๋๋ฐ ๊ฒ์์ด๋ผ๋ ๊ธฐ๋ฅ์ ๋ฐ์์ ์ฃผ์
ํด์ค ์ ๋ฐ์ ์๋ ์ํฉ์ธ๊ฑฐ์ฃ . |
@@ -1,9 +1,100 @@
-function Header(logo, searchBox) {
+import Input from './Input';
+import Button from './Button';
+import { handleSearch } from '../services/handleSeach';
+
+function Header({ logoSrc, logoAlt, onSearch }) {
const headerElement = document.createElement('header');
- headerElement.classList.add(... | JavaScript | ์ด ๋ถ๋ถ๋ ๋์ผํฉ๋๋ค! |
@@ -1,9 +1,100 @@
-function Header(logo, searchBox) {
+import Input from './Input';
+import Button from './Button';
+import { handleSearch } from '../services/handleSeach';
+
+function Header({ logoSrc, logoAlt, onSearch }) {
const headerElement = document.createElement('header');
- headerElement.classList.add(... | JavaScript | ์ฌ๊ธฐ์ ์ฐ์ด๋ 390 ์ด๋ผ๋ ์ซ์๋ ์์๋ก ๋ง๋ค์ด์ ์ฌ์ฉํด์ฃผ๋ฉด ์ด๋จ๊น์!? |
@@ -1,9 +1,100 @@
-function Header(logo, searchBox) {
+import Input from './Input';
+import Button from './Button';
+import { handleSearch } from '../services/handleSeach';
+
+function Header({ logoSrc, logoAlt, onSearch }) {
const headerElement = document.createElement('header');
- headerElement.classList.add(... | JavaScript | ์ ๋ณด๋๊น ๋ก์ง์ด ๊ฑฐ์ ์ ์ฌํ๋ค์! |
@@ -0,0 +1,33 @@
+import handleMovie from '../services/handleMovie';
+import Button from './Button';
+
+function MainContent(initialPage) {
+ let page = initialPage;
+ const mainElement = document.createElement('main');
+ mainElement.id = 'main';
+
+ mainElement.innerHTML = `
+ <section class="item-v... | JavaScript | ```suggestion
const mainElement = html(`
<main id="main">
<section class="item-view">
<h2>์ง๊ธ ์ธ๊ธฐ ์๋ ์ํ</h2>
<ul class="item-list"></ul>
</section>
<main>
`);
```
์ด๋ ๊ฒ ํํํ ์ ์๋๋ก ํจ์๋ฅผ ํ๋ ๋ง๋ค์ด์ฃผ์๋ฉด ์ด๋จ๊น์!? |
@@ -0,0 +1,33 @@
+import handleMovie from '../services/handleMovie';
+import Button from './Button';
+
+function MainContent(initialPage) {
+ let page = initialPage;
+ const mainElement = document.createElement('main');
+ mainElement.id = 'main';
+
+ mainElement.innerHTML = `
+ <section class="item-v... | JavaScript | ์์์๋ html template์ผ๋ก ํํ๋๊ณ ์ฌ๊ธฐ์๋ ์ด๋ ๊ฒ ํํ๋๊ณ ์์ด์ ์ฝ๋๋ฅผ ์ฝ๋ ์ฌ๋ ์
์ฅ์์๋ ์กฐ๊ธ ํท๊ฐ๋ฆฌ์ง ์์๊น ์ถ์ด์! |
@@ -0,0 +1,47 @@
+import { BASE_URL } from '../constants/api';
+import { APIError } from '../apis/error';
+
+interface ApiClientType {
+ method: 'GET' | 'POST' | 'PUT' | 'DELETE';
+ endpoint: string;
+ params?: Record<string, string>;
+ headers?: Record<string, string>;
+ body?: Record<string, any>;
+}
+... | TypeScript | ์ํ.. ์ด ํ์ผ ๋๋ฌธ์ tsconfig๊ฐ ์๊ธด๊ฑฐ์๊ตฐ์ |
@@ -0,0 +1,47 @@
+import { BASE_URL } from '../constants/api';
+import { APIError } from '../apis/error';
+
+interface ApiClientType {
+ method: 'GET' | 'POST' | 'PUT' | 'DELETE';
+ endpoint: string;
+ params?: Record<string, string>;
+ headers?: Record<string, string>;
+ body?: Record<string, any>;
+}
+... | TypeScript | try ๊ตฌ๊ฐ์์ ์ค๋ฅ ๋ฐ์ -> catch๋ก ์ง์
-> ๋ฌด์กฐ๊ฑด status๋ 400์ผ๋ก ๊ณ ์ ํ์ฌ ๋ค์ error throw
์ด๋ ๊ฒ ๋ฉ๋๋ค.
์ ์๋ฏธํ ์๋ฌ ํ๋ก์ฐ์ผ๊น์~? |
@@ -0,0 +1,47 @@
+import { BASE_URL } from '../constants/api';
+import { APIError } from '../apis/error';
+
+interface ApiClientType {
+ method: 'GET' | 'POST' | 'PUT' | 'DELETE';
+ endpoint: string;
+ params?: Record<string, string>;
+ headers?: Record<string, string>;
+ body?: Record<string, any>;
+}
+... | TypeScript | ๊ทธ๋ฐ๋ฐ ์ด ํ์ผ์ด ์ domain ์ ํด๋นํ๋๊ฑธ๊น์~?
domain์ด๋ผ๊ณ ํ๊ธฐ์ ๋ง ๊ทธ๋๋ก ์ฌ์ด๋ ์ดํํธ(client)๋ฅผ ํํํ๊ฑฐ๋ผ์... ์ ํ ์ฐ๊ด์ด ์์ด๋ณด์ฌ์! |
@@ -0,0 +1,24 @@
+import getMovieList from '../apis/getMovieList';
+import ConfirmModal from '../components/modal/ConfirmModal';
+import { Modal } from '../components/modal/container/Modal';
+import { NOT_MORE_MOVIES_MESSAGE } from '../constants/message';
+import renderMovies from '../view/renderMovies';
+import render... | JavaScript | api์์ ๋ฐ์ํ ์๋ฌ ์ค์ message๋ง ์ฌ์ฉํ๊ณ ์๋๋ฐ, CustomError๋ฅผ ๋ง๋ค์ด์ ์ฐ๋ ์๋ฏธ๊ฐ ์๋๊ฑด๊ฐ ์ถ์ด์! |
@@ -0,0 +1,47 @@
+import { BASE_URL } from '../constants/api';
+import { APIError } from '../apis/error';
+
+interface ApiClientType {
+ method: 'GET' | 'POST' | 'PUT' | 'DELETE';
+ endpoint: string;
+ params?: Record<string, string>;
+ headers?: Record<string, string>;
+ body?: Record<string, any>;
+}
+... | TypeScript | domain์ด apis๋ฅผ ์ฐธ์กฐํ๋๊ฑด ์ด์ํด๋ณด์ฌ์! |
@@ -1,2 +1 @@
export const BASE_URL = 'https://api.themoviedb.org';
-export const IMAGE_BASE_URL = 'https://image.tmdb.org/t/p/w500'; | JavaScript | ์ด๋ฐ ์ ๋ณด๋ ์์ API๋ฅผ ์์ฒญํ๋ ์ชฝ์์ ๊ฐ์ง๊ณ ์์ผ๋ฉด ์ด๋จ๊น์? |
@@ -0,0 +1 @@
+export const NOT_MORE_MOVIES_MESSAGE = '๋์ด์ ์ํ๊ฐ ์กด์ฌํ์ง ์์ต๋๋ค.'; | JavaScript | ์ด๋ฐ ์๋ฌ ๋ฉ์ธ์ง๋ ๋ฉ์ธ์ง๋ฅผ ์ฌ์ฉํ๋ ์ชฝ์์ ๊ฐ์ง๊ณ ์์ผ๋ฉด ์ด๋จ๊น์?
๋ค๋ฅธ ๊ตฌ๊ฐ์์๋ ์์ ์ฌ์ฉ๋ ๊ฒ ๊ฐ์ง ์์์์! |
@@ -0,0 +1,17 @@
+package lotto
+
+import lotto.service.LottoService
+import lotto.view.Input
+import lotto.view.Output
+
+fun main() {
+ val money = Input.money()
+ val randomNums = Input.getRandomLottoNumsPerMoney(money)
+ val winNums = Input.winNums()
+
+ val lottoService = LottoService()
+ val lottoR... | Kotlin | VO์ ๋ํด ์์๋ณด๊ณ ์์๊ฐ์ ํฌ์ฅํด๋ณด๋ฉด ์ด๋จ๊น์? [์ฐธ๊ณ ](https://tecoble.techcourse.co.kr/post/2020-05-29-wrap-primitive-type/) |
@@ -0,0 +1,36 @@
+package lotto.view
+
+import lotto.domain.LottoTicket.Companion.TICKET_PRICE
+
+object Input {
+ fun money(): Int {
+ println("๊ตฌ์
๊ธ์ก์ ์
๋ ฅํด ์ฃผ์ธ์.")
+ return readln().toInt()
+ }
+
+ fun getRandomLottoNumsPerMoney(money: Int): List<List<Int>> {
+ val ticketNumber = money.div(T... | Kotlin | ์ค์ฒฉ ์ปฌ๋ ์
๋ณด๋ค๋ ์๋ฏธ๋ฅผ ๋ด์ ์ ์๋ ๊ฐ์ฒด๋ฅผ ๋ง๋ค์ด๋ณด๋ฉด ์ด๋จ๊น์? |
@@ -0,0 +1,36 @@
+package lotto.view
+
+import lotto.domain.LottoTicket.Companion.TICKET_PRICE
+
+object Input {
+ fun money(): Int {
+ println("๊ตฌ์
๊ธ์ก์ ์
๋ ฅํด ์ฃผ์ธ์.")
+ return readln().toInt()
+ }
+
+ fun getRandomLottoNumsPerMoney(money: Int): List<List<Int>> {
+ val ticketNumber = money.div(T... | Kotlin | ๊ตฌ๋งคํ ํฐ์ผ์๋์ view์์ ๊ตฌํ๋๊ฒ์ด ์ ์ ํ ์์น์ผ์ง ๊ณ ๋ฏผํด๋ณด๋ฉด ์ข์ ๊ฒ ๊ฐ์์! |
@@ -0,0 +1,36 @@
+package lotto.view
+
+import lotto.domain.LottoTicket.Companion.TICKET_PRICE
+
+object Input {
+ fun money(): Int {
+ println("๊ตฌ์
๊ธ์ก์ ์
๋ ฅํด ์ฃผ์ธ์.")
+ return readln().toInt()
+ }
+
+ fun getRandomLottoNumsPerMoney(money: Int): List<List<Int>> {
+ val ticketNumber = money.div(T... | Kotlin | ๋งค์ง๋๋ฒ๋ฅผ ์์ํํด๋ณด๋ฉด ์ด๋จ๊น์?! |
@@ -9,3 +9,8 @@
- [x] ๋ฌธ์์ด ๊ณ์ฐ๊ธฐ์ ์ซ์ ์ด์ธ์ ๊ฐ ๋๋ ์์๋ฅผ ์ ๋ฌํ๋ ๊ฒฝ์ฐ RuntimeException ์์ธ๋ฅผ throw ํ๋ค.
- [x] ์์๊ฐ์ ํฌ์ฅํ ๋๋ฉ์ธ๊ฐ์ฒด ๊ตฌํ
- [x] ์ฐ์ฐ์ ์ค๋ฒ๋ผ์ด๋ฉ ๊ตฌํ
+
+## ๋ก๋ (์๋) ๊ธฐ๋ฅ ์๊ตฌ์ฌํญ
+- [x] ๋ก๋ ๊ตฌ์
๊ธ์ก์ ์
๋ ฅํ๋ฉด ๊ตฌ์
๊ธ์ก์ ํด๋นํ๋ ๋ก๋๋ฅผ ๋ฐ๊ธํด์ผ ํ๋ค.
+ - [x] ๊ธ์ก์ 0 ์ด์์ด๋ค.
+- [x] ๋ก๋ 1์ฅ์ ๊ฐ๊ฒฉ์ 1000์์ด๋ค. | Unknown | ํด๋น validation์ ์ด๋์ ์ํํด์ฃผ๊ณ ์๋์?! |
@@ -0,0 +1,23 @@
+package lotto.service
+
+import lotto.domain.LottoTicketMachine
+import lotto.domain.Rank
+
+class LottoService {
+ fun getLottoRanks(nums: List<List<Int>>, winNums: List<Int>): List<Rank> {
+ return nums.map {
+ val issue = LottoTicketMachine.issue(it)
+ val winLottoTi... | Kotlin | object ์ฌ์ฉ์ ๊ณ ๋ คํด๋ณด๋ฉด ์ด๋จ๊น์? |
@@ -0,0 +1,17 @@
+package lotto.domain
+
+object LottoTicketMachine {
+ fun issue(nums: List<Int>): LottoTicket {
+ require(nums.size == 6) {
+ "๋ก๋ ๊ฐ์๋ฅผ ์๋ชป ์
๋ ฅํ์ต๋๋ค"
+ }
+
+ val lottoBox = LottoBox()
+
+ val lottoNums = nums.map {
+ lottoBox.getLottoNum(it)
+ }.t... | Kotlin | issue๋ผ๋ ๋ค์ด๋ฐ์ ๋ถ์ด์ ์ด์ ๊ฐ ๊ถ๊ธํฉ๋๋ค! |
@@ -0,0 +1,24 @@
+package lotto.domain
+
+class LottoBox {
+ private val lottoNums: MutableMap<Int, LottoNum>
+
+ init {
+ val intRange = 1..45
+
+ lottoNums = intRange
+ .map { LottoNum(it) }
+ .associateBy { it.num }
+ .toMutableMap()
+ }
+
+ fun getLottoNum(... | Kotlin | LottoBox๋ง ๋ดค์๋ lottoNum์ด null์ด๋ผ๊ณ ํด์ ์ค๋ณต๋ ์ซ์๋ฅผ ์
๋ ฅํ๋ค๊ณ ๋ณด์ฅํ ์ ์์๊น์? |
@@ -0,0 +1,28 @@
+package lotto.domain
+
+class LottoNum(num: Int) {
+ val num: Int
+
+ init {
+ require(num in 1..45) {
+ "๋ก๋ ์ซ์ ๋ฒ์๋ 1 ~ 45 ์
๋๋ค."
+ }
+
+ this.num = num
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) return true
+ if (... | Kotlin | inline class๋ฅผ ํ์ฉํด๋ด๋ ์ข์ ๊ฒ ๊ฐ์์!! :)
> ๋ํผํด๋์ค๋ก inline class์ value class ๋ฅผ ์ฌ์ฉํ๋๊ฑฐ ๊ฐ์๋ฐ์!
์ ์ดํด๊ฐ ์๊ฐ์์~
๋ญ๊ฐ ์ข์ ๊ธฐ๋ฅ๊ฐ๊ธฐ๋ ํ๋ฐ, ์ค๋ฌด์์ ์ด๋ป๊ฒ, ์ด๋ค์ํฉ์ ์ฌ์ฉํ๋ฉด ์ข์์ง ์ง๋ฌธ๋๋ฆฝ๋๋ค!
์ฌ์ค ์ ๋ ์ ์ฌ์ฉํ๋ค๊ณ ๋ง์๋๋ฆฌ๊ธฐ๋ ์ด๋ ต์ง๋ง, ์ ๋ ์๋์ ๊ฐ์ ๊ธฐ์ค์ ์ถฉ์กฑ์ํค๋ ๊ฒฝ์ฐ ์ธ๋ผ์ธ ํด๋์ค๋ฅผ ์ฌ์ฉํ๊ณ ์์ด์
* ํด๋น ๋ํผํ์
์ด ์ฌ๋ฌ๊ณณ์์ ํธ์ถ๋๋๊ฐ?
* ํด๋น ํด๋์ค๊ฐ data class์ ํน์ง์ ๊ฐ์ง๊ณ ์๋๊ฐ?
์ค๋ฌด์์ ์ ์ฉ์ ํ์๊ฐ ์๋๊ณ ํ์๋ค๋ง๋ค ์๊ฒฌ์ด ๋ค๋ฅผ ์... |
@@ -0,0 +1,28 @@
+package lotto.domain
+
+class LottoNum(num: Int) {
+ val num: Int
+
+ init {
+ require(num in 1..45) {
+ "๋ก๋ ์ซ์ ๋ฒ์๋ 1 ~ 45 ์
๋๋ค."
+ }
+
+ this.num = num
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) return true
+ if (... | Kotlin | ์ฌ๊ธฐ๋ ๋งค์ง๋๋ฒ๋ฅผ ์์ํํด๋ณด๋ฉด ์ด๋จ๊น์? |
@@ -2,6 +2,7 @@ spring.application.name=delivery
spring.jpa.hibernate.ddl-auto=update
+
spring.jpa.properties.hibernate.show_sql=true
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.properties.hibernate.use_sql_comments=true | Unknown | ์ฌ๊ธฐ DB ๋ฏผ๊ฐ์ ๋ณด .env๋ก ๋นผ์ฃผ์ค ์ ์๋์?? ๋์ค์ฝ๋์ ์ ๊ฐ ์ฌ์ฉํ .env๋ ์ฌ๋ ค๋์์ต๋๋ค! |
@@ -0,0 +1,8 @@
+import "./css/reset.css";
+import "./css/common.css";
+import App from "./App";
+
+addEventListener("DOMContentLoaded", async () => {
+ const app = new App();
+ app.init();
+}); | JavaScript | ์ ํจ์๊ฐ ๋ฐ๋ก ์ฑ์ ๊ตฌ๋์ํค๋ Entry ํฌ์ธํธ๊ตฐ์!
`controller`๋ฅผ ์ด๊ธฐํํ๋ค? ๋ณด๋ค๋ `App`์ ์ด๊ธฐํํ๋ค๋ ๋๋์ด ์ด๋จ๊น์? |
@@ -0,0 +1,14 @@
+import { apiClient } from "./apiClient";
+import { BASE_URL } from "./constants";
+
+export const fetchPopularMovies = async ({ page = 1 }) => {
+ const param = new URLSearchParams({
+ api_key: process.env.TMDB_API_KEY,
+ language: "ko-KR",
+ page,
+ });
+
+ const response = await apiClien... | JavaScript | ์ค ์ข์ต๋๋ค! |
@@ -0,0 +1,34 @@
+import { ApiError } from "./apiError";
+
+export const apiClient = {
+ get: async (url, headers = {}) => {
+ return apiClient.request("GET", url, null, headers);
+ },
+
+ request: async (method, url, body = null, headers = {}) => {
+ const options = {
+ method,
+ headers: {
+ ... | JavaScript | `request()`์ `get()`์ ์ฐจ์ด๋ ๋ฌด์์ด๊ณ ๋๋ ์ด์ ๋ ๋ฌด์์ผ๊น์? |
@@ -0,0 +1,31 @@
+import { ERROR_MSG } from "./constants";
+
+export class ApiError extends Error {
+ constructor(message, details, status = -1) {
+ super(message);
+ this.details = details;
+ this.status = status;
+ }
+
+ static handle(error) {
+ let errMsg;
+ let errDetails;
+
+ switch (parseInt(... | JavaScript | ์ค ์ข์ ์๋์
๋๋ค ๐ |
@@ -0,0 +1,16 @@
+import { mainTitle, mainMoreButton, movieCardsList } from "./index";
+
+export const mainSection = {
+ render() {
+ const element = document.createElement("section");
+ element.classList.add("item-view");
+
+ const title = mainTitle.render();
+ const itemList = movieCardsList.render();
+ ... | JavaScript | [append()](https://developer.mozilla.org/en-US/docs/Web/API/Element/append)๋ฅผ ํ์ฉํด๋ณด์ธ์! |
@@ -0,0 +1,46 @@
+describe("API ํ
์คํธ", () => {
+ it("์ํ ๋ชฉ๋ก API๋ฅผ ํธ์ถํ๋ฉด 20๊ฐ์ฉ ์ํ๋ฅผ ๋ฐ์์จ๋ค.", () => {
+ const baseUrl = "https://api.themoviedb.org/3/movie/popular";
+ const param = new URLSearchParams({
+ api_key: Cypress.env("TMDB_API_KEY"),
+ language: "ko-KR",
+ page: 1,
+ });
+
+ cy.request(`${b... | JavaScript | ์คํธ?
`exist`๋ก ๊ฒ์ฌํ๋ฉด ๋ฌด์์ด ๋ค๋ฅผ๊น์? |
@@ -0,0 +1,46 @@
+describe("API ํ
์คํธ", () => {
+ it("์ํ ๋ชฉ๋ก API๋ฅผ ํธ์ถํ๋ฉด 20๊ฐ์ฉ ์ํ๋ฅผ ๋ฐ์์จ๋ค.", () => {
+ const baseUrl = "https://api.themoviedb.org/3/movie/popular";
+ const param = new URLSearchParams({
+ api_key: Cypress.env("TMDB_API_KEY"),
+ language: "ko-KR",
+ page: 1,
+ });
+
+ cy.request(`${b... | JavaScript | 40์ผ๋ก ๊ฒ์ฌํ๋ ์ด์ ๋ ์ด๊ธฐ ๋ฆฌ์คํธ 20 + ์ถ๊ฐ ๋๋ณด๊ธฐ 20์ผ๊น์? |
@@ -0,0 +1,34 @@
+import { ApiError } from "./apiError";
+
+export const apiClient = {
+ get: async (url, headers = {}) => {
+ return apiClient.request("GET", url, null, headers);
+ },
+
+ request: async (method, url, body = null, headers = {}) => {
+ const options = {
+ method,
+ headers: {
+ ... | JavaScript | `request()`๋ ๋งค๊ฐ๋ณ์๋ก ๋ฐ๋ method๋ฅผ ํตํด API ์์ฒญ์ ๋ณด๋ด๋ ํจ์์ด๊ณ , `get()`์ ํด๋น `request()` ํจ์์ `GET`์์ฒญ์ ๋ณด๋ด๋ ํจ์์
๋๋ค.
์ด๋ฒ ๊ณผ์ ์์ GET ์์ฒญ๋ง ์กด์ฌํ์ฌ ์ถ๊ฐํ์ง ์์์ง๋ง ์ถํ์ ๋ค๋ฅธ ๋ฉ์๋ ์์ฒญ์ ์ถ๊ฐํ ์ ์๊ฒ ์์ฑํ์์ต๋๋ค! |
@@ -0,0 +1,46 @@
+describe("API ํ
์คํธ", () => {
+ it("์ํ ๋ชฉ๋ก API๋ฅผ ํธ์ถํ๋ฉด 20๊ฐ์ฉ ์ํ๋ฅผ ๋ฐ์์จ๋ค.", () => {
+ const baseUrl = "https://api.themoviedb.org/3/movie/popular";
+ const param = new URLSearchParams({
+ api_key: Cypress.env("TMDB_API_KEY"),
+ language: "ko-KR",
+ page: 1,
+ });
+
+ cy.request(`${b... | JavaScript | ์์ฑ๋ `movieCard`์๋ ์ธ๋ค์ผ, ๋ณ์ , ์ ๋ชฉ element๊ฐ `์กด์ฌ`ํ๋ค๋ ์๋ฏธ์์ ์ฌ์ฉํ ๊ฒ ๊ฐ์ต๋๋ค!
๋ค์ ์๊ฐํด๋ณด๋, ํด๋น element๊ฐ ์กด์ฌํ์ง๋ง ๋ณด์ฌ์ง์ง ์๊ฑฐ๋ ์ด๋ค css issue๊ฐ ์๊ธธ ์๋ ์๋ค๋ ์๊ฐ์ `be.visible`๋ก ๋์ฒดํ์์ต๋๋ค. |
@@ -0,0 +1,46 @@
+describe("API ํ
์คํธ", () => {
+ it("์ํ ๋ชฉ๋ก API๋ฅผ ํธ์ถํ๋ฉด 20๊ฐ์ฉ ์ํ๋ฅผ ๋ฐ์์จ๋ค.", () => {
+ const baseUrl = "https://api.themoviedb.org/3/movie/popular";
+ const param = new URLSearchParams({
+ api_key: Cypress.env("TMDB_API_KEY"),
+ language: "ko-KR",
+ page: 1,
+ });
+
+ cy.request(`${b... | JavaScript | ๋ค ๋ง์ต๋๋ค! ์ด์ ํ
์คํธ์์ 20๊ฐ๊ฐ ๋ ๋๋ง์ด ๋์๊ณ ๋ฒํผ์ ํด๋ฆญํ ํ์, 20๊ฐ๊ฐ ๋ ์ถ๊ฐ๋์ด 40๊ฐ๋ฅผ ๊ฒ์ฌํ๊ฒ ํ์์ต๋๋ค.
์๋กญ๊ฒ ๋ ๋๋ง๋ 20๊ฐ์ ๋ํด์ ํ
์คํธ๋ฅผ ์งํํ๋ ๊ฒ์ด ๋ ์ฌ๋ฐ๋ฅธ ๊ฒ์ฌ์ผ๊น์?
+) ์ถ๊ฐ๋ก, ๋จ์ํ
์คํธ์์๋ ์ํ ๊ฐ์ ํตํด ๋์ถ๋๋ ๊ฐ์ ๊ฒ์ฌํ๋ ๊ณผ์ ์ด ํ
์คํธ์ ํต์ฌ์ด์๋ค๊ณ ์๊ฐ๋๋๋ฐ,
์ด๋ฒ์ e2e์์๋ ๊ฐ์ ์ด์ฉํ์ฌ ๊ฒ์ฌํ๋ ๋ฐฉํฅ๋ณด๋ค ๋ ๋๋ง๋๋ ์์์ ๊ฐ์๋ ์์ฑ ์ฌ๋ถ๋ฅผ ์ค์ฌ์ ์ผ๋ก ์ฝ๋๋ฅผ ์์ฑํ ๊ฒ ๊ฐ์ต๋๋ค.
๊ทธ๋ฐ ๊ณผ์ ์์ ๋จ์ ํ
์คํธ๋ ๊ฐ ์ค์ฌ, e2e๋ ์ ์ฒด์ ์ธ DOM ๋ ๋๋ง ์ค์ฌ ์ด๋ ๊ฒ ์์ฐ์ค๋ ์๊ฐ์ด ์ด์ด... |
@@ -1,11 +1,29 @@
import { useState } from "react";
+import Header from "./components/Header/Header";
+import Product from "./pages/Product";
+import GlobalStyles from "./styles/Global.style";
+import Toast from "./components/common/Toast/Toast";
+import { QuantityContext } from "./store/QuantityContext";
+import { cr... | Unknown | ์ฌ๊ธฐ ์ด `showToast` ์ํ๋ฅผ ํ ์คํธ ์ปดํฌ๋ํธ๊ฐ ์ฑ
์์ ๊ฐ์ง ์ ์์ง ์์๊น ์ถ์๋๋ฐ, ๊ทธ๋ ๋ค๋ฉด createPortal์ ์ฌ์ฉํ ์ ์๊ฒ ๋๋์..? createPortal์ ์ฌ์ฉํด๋ณด์ง ์์์ ์ ๋ชจ๋ฅด๊ฒ ์ง๋ง, ๋ฏธ๋ฆฌ ์ด์ด๋ ์ ์๋ค๋ฉด ๊ทธ์ชฝ์ผ๋ก ์ํ๋ฅผ ์ฎ๊ฒจ๋ด๋ ์ข์ ๊ฒ ๊ฐ์์! |
@@ -0,0 +1,52 @@
+import { generateBasicToken } from "../util/auth";
+import { CART_ITEMS_ENDPOINT } from "./config";
+
+const USER_PASSWORD = import.meta.env.VITE_USER_PASSWORD;
+const USER_ID = import.meta.env.VITE_USER_ID;
+const token = generateBasicToken(USER_ID, USER_PASSWORD);
+
+export async function requestFet... | TypeScript | ํ์๋ ์๋์ง๋ง ๋ฐ๋ณต๋๋ fetch ๋ก์ง๋ค์ ์ถ์ํํด๋ณด์
๋ ์ข์ ๊ฒ ๊ฐ์์!ใ
ใ
|
@@ -0,0 +1,52 @@
+import { generateBasicToken } from "../util/auth";
+import { CART_ITEMS_ENDPOINT } from "./config";
+
+const USER_PASSWORD = import.meta.env.VITE_USER_PASSWORD;
+const USER_ID = import.meta.env.VITE_USER_ID;
+const token = generateBasicToken(USER_ID, USER_PASSWORD);
+
+export async function requestFet... | TypeScript | chat GPTํํ
'์ด ์ฝ๋ ์ถ์ํ ํด๋ด'ํ๋ฉด ๊ธฐ๊ฐ๋งํ๊ฒ ํด์ฃผ๋๋ผ๊ตฌ์ |
@@ -0,0 +1,10 @@
+import { generateBasicToken } from "../util/auth";
+
+const API_URL = import.meta.env.VITE_API_URL;
+
+export const PRODUCTS_ENDPOINT = `${API_URL}/products`;
+export const CART_ITEMS_ENDPOINT = `${API_URL}/cart-items`;
+
+export const USER_PASSWORD = import.meta.env.VITE_USER_PASSWORD;
+export const ... | TypeScript | api์์ฒญ์ ํ์ํ ๋ณ์๋ค์ด ์ ๋ชจ์ฌ์์ด ๊ด๋ฆฌํ๊ธฐ ํธํ ๊ฒ ๊ฐ๋ค์! ๐ |
@@ -0,0 +1,87 @@
+import { useContext, useEffect, useRef } from "react";
+import { QuantityContext } from "../../store/QuantityContext";
+import useProductList from "../../hooks/useProductList";
+import useCartItemList from "../../hooks/useCartItemList";
+import ProductItem from "../ProductItem/ProductItem";
+import * ... | Unknown | ํ์ด์ง๋ค์ด์
๊ด๋ จ ๋ก์ง๋ ์ปค์คํ
ํ
์ผ๋ก ๋ถ๋ฆฌํ๋ฉด ์ข์ ๊ฒ ๊ฐ์์! |
@@ -0,0 +1,87 @@
+import { useContext, useEffect, useRef } from "react";
+import { QuantityContext } from "../../store/QuantityContext";
+import useProductList from "../../hooks/useProductList";
+import useCartItemList from "../../hooks/useCartItemList";
+import ProductItem from "../ProductItem/ProductItem";
+import * ... | Unknown | ์๋ฌด๋๋ ์ด๋ฒ ๋ฏธ์
์์ ๊ฐ์ฅ ๋ฉ์ธ์ด ๋๋(?) ์ปดํฌ๋ํธ์ธ ๊ฒ ๊ฐ์์. ๋น์ฆ๋์ค ๋ก์ง๊ณผ UI ๋ก์ง์ด ์ข ๋ ์ ๋ถ๋ฆฌ๋๋ฉด ๋์ฑ ์ฝ๊ธฐ ์ข์ ๊ฒ ๊ฐ์ต๋๋ค! |
@@ -1,4 +1,4 @@
-<!DOCTYPE html>
+<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
@@ -7,6 +7,7 @@
<title>react-shopping-products</title>
</head>
<body>
+ <div id="toast"></div>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body> | Unknown | ์๊ฒ๋ fileChanged์ ์ฌ๋ผ์์ ์ ๊ธฐํด์ ๋จ๊ฒจ๋ด ใ
ใ
|
@@ -0,0 +1,96 @@
+import objectToQueryString, { ObjectQueryParams } from '@/utils/objectToQueryString';
+import { generateBasicToken } from '../utils/auth';
+
+type Method = 'GET' | 'POST' | 'PATCH' | 'DELETE';
+
+type Body = ReadableStream | XMLHttpRequestBodyInit;
+type HeadersType = [string, string][] | Record<strin... | TypeScript | ์ด ํ์ผ์์ ๊ฐ request๋ฅผ ์ถ์ํํด์ค๊ฒ ์์ฃผ ์ธ์๊น์์ต๋๋ค!!!
๋ฐฐ์๊ฐ ์ด์ด์ด,, |
@@ -0,0 +1,96 @@
+import objectToQueryString, { ObjectQueryParams } from '@/utils/objectToQueryString';
+import { generateBasicToken } from '../utils/auth';
+
+type Method = 'GET' | 'POST' | 'PATCH' | 'DELETE';
+
+type Body = ReadableStream | XMLHttpRequestBodyInit;
+type HeadersType = [string, string][] | Record<strin... | TypeScript | ์ด๊ฑฐ ์ ์ํจ ใ
ใ
ใ
|
@@ -0,0 +1,96 @@
+import objectToQueryString, { ObjectQueryParams } from '@/utils/objectToQueryString';
+import { generateBasicToken } from '../utils/auth';
+
+type Method = 'GET' | 'POST' | 'PATCH' | 'DELETE';
+
+type Body = ReadableStream | XMLHttpRequestBodyInit;
+type HeadersType = [string, string][] | Record<strin... | TypeScript | ์ฌ๊ธฐ์ ๋์ง๋ ์ค๋ฅ ๋ฉ์์ง๊ฐ showToast์์ ๋ณด์ด๋ ๋ฉ์์ง์์๋ ํ์ฉ์ ์ํ๊ณ ์๋ ๊ฒ ๊ฐ์์
ํต์ผ์ํค๋ ๋ฐฉ์์ด๋ ์ฌ์ฉ์์๊ฒ ๋ณด์ด๋ ์ค๋ฅ ๋ฉ์์ง๋ฅผ ์ด๋ป๊ฒ ๊ด๋ฆฌํ ์ง๋ ๊ณ ๋ฏผํด๋ณด๋ฉด ์ข์ ๋ฏ์!
(๋๋ ํด์ผํจ ใ
) |
@@ -0,0 +1,75 @@
+import { CartItem } from '@/types/cartItem.type';
+import { BASE_URL } from '../baseUrl';
+import { requestGet, requestPost, requestDelete } from '../fetcher';
+import { ENDPOINT } from '../endpoints';
+
+type ResponseCartItemList = {
+ content: CartItem[];
+ pageable: {
+ sort: {
+ sorted: ... | TypeScript | ์ฌ์ํ ์๊ฒฌ์ธ๋ฐ, ์ ๋ api ์๋ต์ด ์ธ์ ๋ ๋ฐ๋ ์ ์๋ค๊ณ ์๊ฐํด์ ์๋ฐ ํ์
์ type๋ณด๋ค interface๋ก ์ ์ธํ๋ ค๋ ํธ์ด๊ธด ํจ๋ค
๊ทธ๋ฌ๋ฉด pageable ๊ฐ์ด ์์ฐ๊ณ ๋ญ๊ฐ ๋ค๋ฅธ ์ ๋ณด๋ ์ค๋ณต๋๋ ์น๊ตฌ๋ค์ ์์จ์ค ์๋ ์์ด์ ์คํ๋ ค ๋ฆฌ๋ทฐ์ด์๊ฒ ์ธ ์น๊ตฌ๋ค๋ง interface์ ์ ์ธํด์ค ์ ์๋ค๋ ์ฅ์ ๋ ์๋ค๊ณ ์๊ฐํ์ด๋ค.
(interface์ ๋จ์ ์ ์์๊น ์๊ฐ๋ ๋๋๋ฐ ํจ ์ฐพ์๋ด์ผ๊ฒ ๋ค) |
@@ -0,0 +1,29 @@
+.container {
+ position: relative;
+}
+
+.cartIcon {
+ cursor: pointer;
+}
+
+.amountContainer {
+ position: absolute;
+ bottom: 0;
+ right: 0;
+ width: 19px;
+ height: 19px;
+ background: #fff;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ border-radius: 50%;
+}
+
+... | Unknown | ์ด๊ฑฐ ๊ฐ ์ ์ธ ๊ถ๊ธ์ฆ์ธ๋ฐ ์ด๊ฑฐ ๋๊ฐ ํ์ํจ?! |
@@ -1,4 +1,4 @@
-<!DOCTYPE html>
+<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
@@ -7,6 +7,7 @@
<title>react-shopping-products</title>
</head>
<body>
+ <div id="toast"></div>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body> | Unknown | ์ ๋ ์ด๊ฒ ์ ๋์ง ๋ชจ๋ฅด๊ฒ ๋ค์.... ใ
.ใ
|
@@ -0,0 +1,96 @@
+import objectToQueryString, { ObjectQueryParams } from '@/utils/objectToQueryString';
+import { generateBasicToken } from '../utils/auth';
+
+type Method = 'GET' | 'POST' | 'PATCH' | 'DELETE';
+
+type Body = ReadableStream | XMLHttpRequestBodyInit;
+type HeadersType = [string, string][] | Record<strin... | TypeScript | ๋ง์์. ์ฌ์ค ์ด๋์ ๋์ง ์ค๋ฅ๊ฐ ์บ์น๋๊ณ ๊ทธ๋ฐ๊ฑธ ํ์ธ์ ์ํด์ ์๋ฌ ๋ฐ์ด๋๋ฆฌ์ ๋น์ทํ ์ค๊ณ๋ก ์ด๋ฅผ ํด๊ฒฐํ ์ ์์ง ์์๊น ์ถ์ต๋๋ค. ํ๋ฒ ์๋ํด๋ณผ๊ฒ์! |
@@ -0,0 +1,29 @@
+.container {
+ position: relative;
+}
+
+.cartIcon {
+ cursor: pointer;
+}
+
+.amountContainer {
+ position: absolute;
+ bottom: 0;
+ right: 0;
+ width: 19px;
+ height: 19px;
+ background: #fff;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ border-radius: 50%;
+}
+
+... | Unknown | ๊ธ์ด์จ ๊ฒ ๊ฐ๋ค์. ํ์ ์์๋ฏ...! |
@@ -1,14 +1,40 @@
-import React from "react";
-import "./PostList.scss";
+import React, { useEffect, useState } from 'react';
+import { useNavigate } from 'react-router-dom';
+import Posts from './components/Posts';
+import './PostList.scss';
const PostList = () => {
+ const [postData, setPostData] = useState([]);
... | JavaScript | import ์์์๋ ์ ์ง๋ณด์ ๋ฐ ๊ฐ๋
์ฑ์ ์ํ ์ปจ๋ฒค์
์ด ์์ต๋๋ค.
์์ฝ๋์ ์ปจ๋ฒค์
์ ๊ฐ๋ตํ๊ฒ ์๋์ ๊ฐ๊ณ , ์ฐธ๊ณ ํด์ ์์ ํด ์ฃผ์ธ์!
- ๋ผ์ด๋ธ๋ฌ๋ฆฌ
- React ๊ด๋ จ ํจํค์ง
- ์ธ๋ถ ๋ผ์ด๋ธ๋ฌ๋ฆฌ
- ์ปดํฌ๋ํธ
- ๊ณตํต ์ปดํฌ๋ํธ โ ๋จผ ์ปดํฌ๋ํธ โ ๊ฐ๊น์ด ์ปดํฌ๋ํธ
- ํจ์, ๋ณ์ ๋ฐ ์ค์ ํ์ผ
- ์ฌ์ง ๋ฑ ๋ฏธ๋์ด ํ์ผ(`.png`)
- css ํ์ผ (.`scss`) |
@@ -0,0 +1,63 @@
+.postList {
+ margin: 0 auto;
+ display: flex;
+ width: 576px;
+ height: 80vh;
+ padding: 40px 24px;
+ flex-direction: column;
+ align-items: center;
+ border-radius: 16px;
+ border: 1px solid #e5e5e5;
+ background: white;
+
+ .posts {
+ width: 100%;
+ overflow-y: scroll;
+ flex: 1... | Unknown | ๋ถ๋ชจ ์ ํ์(`&`)๋ฅผ ์ฌ์ฉํด์ ํด๋น ์์์๋ง ์ ์ฉ๋๋ ์คํ์ผ์์ ์ข ๋ ๊น๋ํ๊ฒ ๋ช
์ํ ์ ์์ต๋๋ค!
```suggestion
.posts {
overflow-y: scroll;
flex: 1;
&::-webkit-scrollbar {
display: none;
}
}
``` |
@@ -1,7 +1,18 @@
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@100;300;400;500;700;900&display=swap');
-
* {
box-sizing: border-box;
font-family: 'Noto Sans KR', sans-serif;
-}
\ No newline at end of file
+}
+
+body {
+ width: 100vw;
+ height: 100vh;
+ display: flex;
+ align-item... | Unknown | ๊ณต์ฉ ํ์ผ์ ์์ ํด์ ์ฌ๋ ค์ฃผ์
จ๋๋ฐ, ๊ณต์ฉ ํ์ผ์ ์์ ์
1. ํ์๊ณผ์ ์ถฉ๋ถํ ์์ ํ์
2. ํด๋น ํ์ผ๋ง ์์ ํ๋ ๋ด์ฉ์ PR
์ ์ฌ๋ ค์ฃผ์
์ผ ํฉ๋๋ค! |
@@ -0,0 +1,13 @@
+package msa.customer.exception;
+
+public class DeliveryCustomerException extends RuntimeException {
+
+ public DeliveryCustomerException(String message) {
+ super(message);
+ }
+
+ public DeliveryCustomerException(String message, Throwable cause) {
+ super(message, cause);
+ ... | Java | (C) Exception์ ์๋น์ค์ `์ ์ฑ
์๋ฐ`์ ๋ํ๋ด๋ documentation์ ์ญํ ์ ํ๊ธฐ๋ ํฉ๋๋ค.
๋ฐ๋ผ์ Exception์ ํตํด ์๋น์ค ์ ์ฑ
์ ์๋ฐํ๋ ๊ฒฝ์ฐ, ์ ์ฑ
์ ๋ช
ํํ๊ฒ ๋ํ๋ผ ์ ์๋ ์์ฒด exception์ ์ ์ํ๊ณค ํ๋๋ฐ delivery application์ ์ ์ฉํด๋ณผ๋งํ exception ๋ช ๊ฐ๋ฅผ ๊ฐ๋ตํ๊ฒ ๊ตฌ์ฑํด๋ดค์ผ๋ ์ฐธ๊ณ ํด๋ณด์๊ณ Exception๋ค์ ์ ์ ์ํด์ฃผ์๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค :) |
@@ -3,6 +3,7 @@
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import msa.customer.entity.store.Store;
+import msa.customer.exception.store.StoreEmptyException;
import msa.customer.service.store.StoreService;
import org.springframework.web.servlet.HandlerIntercepto... | Java | (C) optional์ ๋ฒ๊ฒจ์ง ์ํ๋ก ์ค๋๊ฒ ์ข๊ฒ ์ง๋ง, ์ผ๋จ ํ์ฌ ์ํ๋ฅผ ๊ฐ์ ํ๊ณ custom exception์ throw ํ์ต๋๋ค |
@@ -6,6 +6,7 @@
import msa.restaurant.dto.store.StoreResponseDto;
import msa.restaurant.entity.store.Store;
import msa.restaurant.dto.store.StoreSqsDto;
+import msa.restaurant.exception.store.StoreCreationFailedException;
import msa.restaurant.service.member.MemberService;
import msa.restaurant.sqs.SendingMessageC... | Java | (C) ์ฌ๊ธฐ๋ StoreCreationFailedException์ ๋์ง์ง๋ง, storeService.createStore ๋ด๋ถ์์ exception ์ฒ๋ฆฌ๋ฅผ ํ๊ณ ๋์ค๋ ๊ฒ์ด ๋ ๋ฐ๋์งํด๋ณด์
๋๋ค. |
@@ -18,39 +18,30 @@ public OrderService(OrderRepository orderRepository) {
this.orderRepository = orderRepository;
}
- public void createOrder(Order order){
+ public void createOrder(Order order) {
orderRepository.createOrder(order);
}
- public List<Order> getOrderList(String st... | Java | (C) changeOrderStatusTo~ ๋ฉ์๋์ ๋ด์ฉ์ด ๋๋ถ๋ถ ์ค๋ณต๋์ด์, ํด๋น ๋ฉ์๋๋ค์ changeOrderStatus๋ผ๋ ๋ฉ์๋๋ก ํตํฉํ์์ต๋๋ค.
์ฌ๊ธฐ์ ์๋ก์ด ํด๋์ค์ธ OrderStatusUpdatePolicy๊ฐ ๋ง๋ค์ด์ก๋๋ฐ, ~Policy๋ผ๋ ๋ช
์นญ์ ์๋น์ค ์ ์ฑ
์ ํํํ๊ธฐ ์ํด ๋ฒ์ฉ์ ์ผ๋ก ์ฌ์ฉํ๋ ํด๋์ค ๋ค์ด๋ฐ ์ค ํ๋์
๋๋ค.
delivery-application์๋ ์๋น์ค ์ด์์ ํ์ํ ์ฌ๋ฌ๊ฐ์ง ์ ์ฑ
๋ค์ ๊ฐ๊ณ ์์ํ
๋ฐ์, ์ด๋ฐ ์ ์ฑ
๋ค์ ํด๋์ค๋ก ๋๋ฌ๋ด์ง ์๊ณ ๋ฉ์๋๋ ๋ก์ง์ผ๋ก๋ง ๋ํ๋ด๋ฉด ์ ์ฑ
๋ค์ด ๋ถ์ฐ๋๊ณ , ์์์ ์ผ๋ก ํํ๋์ด์ ์ฐ๋ฆฌ ์๋น์ค๊ฐ... |
@@ -0,0 +1,13 @@
+package msa.customer.exception;
+
+public class DeliveryCustomerException extends RuntimeException {
+
+ public DeliveryCustomerException(String message) {
+ super(message);
+ }
+
+ public DeliveryCustomerException(String message, Throwable cause) {
+ super(message, cause);
+ ... | Java | ์ฐธ๊ณ ํ๊ฒ ์ต๋๋ค. |
@@ -0,0 +1,152 @@
+package nextstep.subway.acceptance;
+
+import static nextstep.subway.acceptance.FavoritesSteps.์ฆ๊ฒจ์ฐพ๊ธฐ_๊ถํ์ด_์์;
+import static nextstep.subway.acceptance.FavoritesSteps.์ฆ๊ฒจ์ฐพ๊ธฐ_๋ชฉ๋ก_์กฐํ_์์ฒญ;
+import static nextstep.subway.acceptance.FavoritesSteps.์ฆ๊ฒจ์ฐพ๊ธฐ_์ญ์ _์์ฒญ;
+import static nextstep.subway.acceptance.FavoritesS... | Java | `์ฆ๊ฒจ์ฐพ๊ธฐ ๋ชฉ๋ก์ ๊ด๋ฆฌํ๋ค` ์์ ์๋๋ฆฌ์ค ํ์์ผ๋ก ์ ์์ฑํด์ฃผ์
์
ํด๋น ํ
์คํธ๋ค์ ์์ฑํด์ฃผ์ง ์์๋ ๊ด์ฐฎ์ ๊ฒ ๊ฐ์์ ๐ |
@@ -0,0 +1,50 @@
+package nextstep.subway.applicaion;
+
+import java.util.List;
+import java.util.stream.Collectors;
+import nextstep.member.application.MemberService;
+import nextstep.member.domain.LoginMember;
+import nextstep.member.domain.MemberRepository;
+import nextstep.subway.applicaion.dto.FavoriteRequest;
+im... | Java | memberRepository ๋ฅผ ์ฌ์ฉํ๊ณ ์์ง ์๋๋ฐ์,
์ฆ๊ฒจ์ฐพ๊ธฐ ์์ฑ, ์กฐํ, ์ญ์ ์ ์ ์ํ memberId ์ธ์ง ํ์ธํ์ง ์์๋ ๋ ๊น์? ๐ |
@@ -22,10 +22,14 @@ public PathService(LineService lineService, StationService stationService) {
public PathResponse findPath(Long source, Long target) {
Station upStation = stationService.findById(source);
Station downStation = stationService.findById(target);
- List<Line> lines = lineSer... | Java | ์ ๊ทผ์ ์ด์๋ฅผ ์๋ตํ์ ์ด์ ๊ฐ ์์ผ์ ๊ฐ์? ๐ |
@@ -0,0 +1,39 @@
+package nextstep.subway.applicaion.dto;
+
+import nextstep.subway.domain.Favorite;
+
+public class FavoriteResponse {
+ private Long id;
+ private Long memberId;
+ private StationResponse source;
+ private StationResponse target;
+
+ private FavoriteResponse(Long id, Long memberId,
+ ... | Java | ์๊ตฌ์ฌํญ์ memberId ๋ ์๋ค์!
์๊ตฌ์ฌํญ์ ํ์ธํด์ฃผ์ธ์ ๐ |
@@ -0,0 +1,49 @@
+package nextstep.subway.ui;
+
+import java.net.URI;
+import java.util.List;
+import nextstep.auth.authorization.AuthenticationPrincipal;
+import nextstep.member.domain.LoginMember;
+import nextstep.subway.applicaion.FavoriteService;
+import nextstep.subway.applicaion.dto.FavoriteRequest;
+import nexts... | Java | ์ฆ๊ฒจ์ฐพ๊ธฐ ์์ฑ ํ ๋ฐํ๊ฐ์ ๋ํ ์๊ตฌ์ฌํญ์ ํ์ธํด์ฃผ์ธ์! ๐
 |
@@ -1,5 +1,6 @@
package nextstep.subway.domain;
+import java.util.Optional;
import org.jgrapht.GraphPath;
import org.jgrapht.alg.shortestpath.DijkstraShortestPath;
import org.jgrapht.graph.SimpleDirectedWeightedGraph;
@@ -22,6 +23,11 @@ public Path findPath(Station source, Station target) {
DijkstraShort... | Java | Optional ์ ์ฌ์ฉํ์ ์ด์ ๊ฐ ์์ผ์ ๊ฐ์?
์ด๋ ํ ์ด์ ์ด ์๋์? ๐
```suggestion
if (Objects.isNull(result)) {
throw new IllegalArgumentException("์ถ๋ฐ์ญ๊ณผ ๋์ฐฉ์ญ์ด ์ฐ๊ฒฐ๋์ด ์์ง ์์ต๋๋ค.");
}
``` |
@@ -0,0 +1,99 @@
+## ์ฐ์ํ ํ
ํฌ์ฝ์ค ํ๋ฆฌ์ฝ์ค ํฌ๋ฆฌ์ค๋ง์ค ํ๋ก๋ชจ์
+
+### ์งํ๋ฐฉ์
+- ์์ ๋ฉ์์ง ์ถ๋ ฅ
+- ๋ฐฉ๋ฌธ ๋ ์ง ์
๋ ฅ
+- ์ฃผ๋ฌธ ๋ฉ๋ด์ ๊ฐ์ ์
๋ ฅ
+- ์
๋ ฅ ์์ผ ์ด๋ฒคํธ ๋ฉ์์ง ์ถ๋ ฅ
+- ์ด๋ฒคํธ ํํ ์ถ๋ ฅ
+ - ์ฃผ๋ฌธ ๋ฉ๋ด
+ - ํ ์ธ ์ ์ด ์ฃผ๋ฌธ ๊ธ์ก
+ - ์ฆ์ ๋ฉ๋ด ์ฌ๋ถ
+ - ํํ ๋ด์ญ ์ฌ๋ถ
+ - ํ ์ธ ํ ์์ ๊ฒฐ์ ๊ธ์ก
+ - 12์ ์ด๋ฒคํธ ๋ฐฐ์ง ์ฌ๋ถ
+
+### ์ฃผ์ ๊ตฌํ ์ฌํญ
+- [x] ์
๋ ฅ ๋ทฐ ๊ตฌํ
+- [x] ์ถ๋ ฅ ๋ทฐ ๊ตฌํ
+
+- [x] ๋ ์ง ์
๋ ฅ ๋ฐ ์ ์ฅ ๊ฐ์ฒด ๊ตฌํ
+- [x] ๋ ์ง ์
๋ ฅ ์ ๋ ์ง๊ด๋ จ ํด... | Unknown | README์ ํด๋์ค์ด๋ฆ์ ์์ฑํ๊ธฐ๋ณด๋ค ์ด๋ค ์ญํ ์ ํด๋์ค์ธ์ง ์ ๋๋ง ์์ฑํ์๋๊ฒ ๋ ์ข์ ๊ฒ ๊ฐ์ต๋๋ค! ์๋ฌด๋๋ ํด๋์ค์ด๋ฆ์ด๋ ๋ฉ์๋ ์ด๋ฆ์ ๊ฐ๋ณ์ฑ์ด ๋๋ค๋ณด๋ README๋ ์ฃผ๊ธฐ์ ์ผ๋ก ์
๋ฐ์ดํธํด์ผํด์ ๋ฒ๊ฑฐ๋ก์์ด ํฌ๊ฑฐ๋ ์ |
@@ -0,0 +1,20 @@
+package christmas.exception;
+
+public enum ExceptionMessage {
+ INVALID_INPUT_DATE("์ ํจํ์ง ์์ ๋ ์ง์
๋๋ค. ๋ค์ ์
๋ ฅํด ์ฃผ์ธ์."),
+ INVALID_INPUT_ORDER("์ ํจํ์ง ์์ ์ฃผ๋ฌธ์
๋๋ค. ๋ค์ ์
๋ ฅํด ์ฃผ์ธ์."),
+ INVALID_MENU_ITEM("ํด๋น ๋ฉ๋ด๊ฐ ์กด์ฌํ์ง ์์ต๋๋ค."),
+ INVALID_WEEK_DISCOUNT_TYPE("์๋ชป๋ ์ฃผ๊ฐ ํ ์ธ ํ์
์
๋๋ค."),
+ ;
+
+ private static f... | Java | ์ถ๊ฐ๋ enum์ ๊ณ ๋ คํ์
์ ์ด๋ ๊ฒ ์์ฑํ ์๋๋ผ๊ณ ์๊ฐ์ ๋์ง๋ง, ๊ผผ๊ผผํ๊ณ ํ๊ณ ๋ค์๋ฉด ,;๋ณด๋ค ;๋ก ๋๋ด๋๊ฒ ๋ ์ข์ง ์์๊น์?? ๊ฐ์ธ์ ์ธ ์๊ฐ์
๋๋ค ใ
ใ
ใ
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.