code stringlengths 41 34.3k | lang stringclasses 8
values | review stringlengths 1 4.74k |
|---|---|---|
@@ -0,0 +1,75 @@
+import pandas as pd
+import numpy as np
+
+#์ ์ถ์ ๋ฆฌ์คํธ(์๊ธฐ ์
๋ ฅ)
+videos = ['์กฐ์ฉ์', '์ ํํธ', '์ ์ฐ๋ฏผ', '์ฅ์งํฌ', '์์ฑ์', '์ด์น์', '์ด๋จ์ค', '์ค๋ค์', '์ค์ ๋ฆฌ๋', '์ ์์', '๋ฐฑ์กํ', '๋ฐ์๋น', '๊นํ์ฐ', '๊นํ์', '๊นํํธ', '๊นํ์ฐ', '๊น์์', '๊น์์ฐ', '๊น์ธํ', '๊ฐ์งํธ', '๊ฐ์ํ']
+#Urclass ์๊ฐ์ ํํฉ csv ๋ถ๋ฌ์ค๊ธฐ
+df = pd.read_csv('1012.csv')
+
+def group_maker(random_se... | Python | read_csv ๋ฅผ ์ด์ฉํด์ list ๋ก ์ฝ๊ธฐ ์ํจ์ด๋ผ๋ฉด, csv reader ๋ฅผ ์ฌ์ฉํ์๋๊ฑด ์ด๋จ๊น์?
`import pandas` ๋ฅผ ํ๋ ค๋ฉด 45MB ์ ๋์ pandas ๊ฐ ํ์ํ๋์ csv ๋ฅผ ์ฌ์ฉํ๋ฉด 16KB ๋ง์ ํด๊ฒฐํ ์ ์์ต๋๋ค! |
@@ -0,0 +1,75 @@
+import pandas as pd
+import numpy as np
+
+#์ ์ถ์ ๋ฆฌ์คํธ(์๊ธฐ ์
๋ ฅ)
+videos = ['์กฐ์ฉ์', '์ ํํธ', '์ ์ฐ๋ฏผ', '์ฅ์งํฌ', '์์ฑ์', '์ด์น์', '์ด๋จ์ค', '์ค๋ค์', '์ค์ ๋ฆฌ๋', '์ ์์', '๋ฐฑ์กํ', '๋ฐ์๋น', '๊นํ์ฐ', '๊นํ์', '๊นํํธ', '๊นํ์ฐ', '๊น์์', '๊น์์ฐ', '๊น์ธํ', '๊ฐ์งํธ', '๊ฐ์ํ']
+#Urclass ์๊ฐ์ ํํฉ csv ๋ถ๋ฌ์ค๊ธฐ
+df = pd.read_csv('1012.csv')
+
+def group_maker(random_se... | Python | numpy ๋ 23 MB ์
๋๋ค. python ์ ๊ธฐ๋ณธ์ผ๋ก ๋ค์ด๊ฐ์๋ random ๋ชจ๋์ ์ฌ์ฉํ์๋๊ฑด ์ด๋จ๊น์? |
@@ -0,0 +1,75 @@
+import pandas as pd
+import numpy as np
+
+#์ ์ถ์ ๋ฆฌ์คํธ(์๊ธฐ ์
๋ ฅ)
+videos = ['์กฐ์ฉ์', '์ ํํธ', '์ ์ฐ๋ฏผ', '์ฅ์งํฌ', '์์ฑ์', '์ด์น์', '์ด๋จ์ค', '์ค๋ค์', '์ค์ ๋ฆฌ๋', '์ ์์', '๋ฐฑ์กํ', '๋ฐ์๋น', '๊นํ์ฐ', '๊นํ์', '๊นํํธ', '๊นํ์ฐ', '๊น์์', '๊น์์ฐ', '๊น์ธํ', '๊ฐ์งํธ', '๊ฐ์ํ']
+#Urclass ์๊ฐ์ ํํฉ csv ๋ถ๋ฌ์ค๊ธฐ
+df = pd.read_csv('1012.csv')
+
+def group_maker(random_se... | Python | csv ํ์ผ์ ์ฝ๋ ๋ถ๋ถ์ ํจ์๋ก ๋ง๋ค๋ฉด ์ฌ์ฌ์ฉํ๊ธฐ ๋ ํธ๋ฆฌํ ๋ฏํฉ๋๋ค. |
@@ -0,0 +1,75 @@
+import pandas as pd
+import numpy as np
+
+#์ ์ถ์ ๋ฆฌ์คํธ(์๊ธฐ ์
๋ ฅ)
+videos = ['์กฐ์ฉ์', '์ ํํธ', '์ ์ฐ๋ฏผ', '์ฅ์งํฌ', '์์ฑ์', '์ด์น์', '์ด๋จ์ค', '์ค๋ค์', '์ค์ ๋ฆฌ๋', '์ ์์', '๋ฐฑ์กํ', '๋ฐ์๋น', '๊นํ์ฐ', '๊นํ์', '๊นํํธ', '๊นํ์ฐ', '๊น์์', '๊น์์ฐ', '๊น์ธํ', '๊ฐ์งํธ', '๊ฐ์ํ']
+#Urclass ์๊ฐ์ ํํฉ csv ๋ถ๋ฌ์ค๊ธฐ
+df = pd.read_csv('1012.csv')
+
+def group_maker(random_se... | Python | ํ๋์ ํจ์์๋ ํ๋์ ๋ก์ง์ด ๋ค์ด๊ฐ ์ ์๋๋ก ๋ณ๊ฒฝํด๋ณด๋๊ฑด ์ด๋จ๊น์? |
@@ -0,0 +1,75 @@
+import pandas as pd
+import numpy as np
+
+#์ ์ถ์ ๋ฆฌ์คํธ(์๊ธฐ ์
๋ ฅ)
+videos = ['์กฐ์ฉ์', '์ ํํธ', '์ ์ฐ๋ฏผ', '์ฅ์งํฌ', '์์ฑ์', '์ด์น์', '์ด๋จ์ค', '์ค๋ค์', '์ค์ ๋ฆฌ๋', '์ ์์', '๋ฐฑ์กํ', '๋ฐ์๋น', '๊นํ์ฐ', '๊นํ์', '๊นํํธ', '๊นํ์ฐ', '๊น์์', '๊น์์ฐ', '๊น์ธํ', '๊ฐ์งํธ', '๊ฐ์ํ']
+#Urclass ์๊ฐ์ ํํฉ csv ๋ถ๋ฌ์ค๊ธฐ
+df = pd.read_csv('1012.csv')
+
+def group_maker(random_se... | Python | ์ด๋ค ์๋ฌ๊ฐ ๋ฐ์ํ์๊น์? ์๋ฌ๋ฅผ ํ์ธํด๋ณด๊ณ `except {??Exception}` ์ผ๋ก ๊ด๋ฆฌํด์ฃผ์ ๋ค๋ฉด ์๋ฌ๊ด๋ฆฌํ๊ธฐ ๋ ์์ํ ๊ฒ์ผ๋ก ๋ณด์
๋๋ค ! |
@@ -0,0 +1,75 @@
+import pandas as pd
+import numpy as np
+
+#์ ์ถ์ ๋ฆฌ์คํธ(์๊ธฐ ์
๋ ฅ)
+videos = ['์กฐ์ฉ์', '์ ํํธ', '์ ์ฐ๋ฏผ', '์ฅ์งํฌ', '์์ฑ์', '์ด์น์', '์ด๋จ์ค', '์ค๋ค์', '์ค์ ๋ฆฌ๋', '์ ์์', '๋ฐฑ์กํ', '๋ฐ์๋น', '๊นํ์ฐ', '๊นํ์', '๊นํํธ', '๊นํ์ฐ', '๊น์์', '๊น์์ฐ', '๊น์ธํ', '๊ฐ์งํธ', '๊ฐ์ํ']
+#Urclass ์๊ฐ์ ํํฉ csv ๋ถ๋ฌ์ค๊ธฐ
+df = pd.read_csv('1012.csv')
+
+def group_maker(random_se... | Python | ์ด๋ค ์๋ฌ๊ฐ ๋ฐ์ํ๋์ง ์ถ๊ฐํด์ฃผ์๋ฉด ์ข์๋ฏํฉ๋๋ค. |
@@ -0,0 +1,75 @@
+import pandas as pd
+import numpy as np
+
+#์ ์ถ์ ๋ฆฌ์คํธ(์๊ธฐ ์
๋ ฅ)
+videos = ['์กฐ์ฉ์', '์ ํํธ', '์ ์ฐ๋ฏผ', '์ฅ์งํฌ', '์์ฑ์', '์ด์น์', '์ด๋จ์ค', '์ค๋ค์', '์ค์ ๋ฆฌ๋', '์ ์์', '๋ฐฑ์กํ', '๋ฐ์๋น', '๊นํ์ฐ', '๊นํ์', '๊นํํธ', '๊นํ์ฐ', '๊น์์', '๊น์์ฐ', '๊น์ธํ', '๊ฐ์งํธ', '๊ฐ์ํ']
+#Urclass ์๊ฐ์ ํํฉ csv ๋ถ๋ฌ์ค๊ธฐ
+df = pd.read_csv('1012.csv')
+
+def group_maker(random_se... | Python | ์ด ๋ถ๋ถ๋ ํจ์ํ๋ฅผ ํ ์ ์๋๋ถ๋ถ์ด์ง ์์๊น ์ถ์ต๋๋ค ! |
@@ -0,0 +1,75 @@
+import pandas as pd
+import numpy as np
+
+#์ ์ถ์ ๋ฆฌ์คํธ(์๊ธฐ ์
๋ ฅ)
+videos = ['์กฐ์ฉ์', '์ ํํธ', '์ ์ฐ๋ฏผ', '์ฅ์งํฌ', '์์ฑ์', '์ด์น์', '์ด๋จ์ค', '์ค๋ค์', '์ค์ ๋ฆฌ๋', '์ ์์', '๋ฐฑ์กํ', '๋ฐ์๋น', '๊นํ์ฐ', '๊นํ์', '๊นํํธ', '๊นํ์ฐ', '๊น์์', '๊น์์ฐ', '๊น์ธํ', '๊ฐ์งํธ', '๊ฐ์ํ']
+#Urclass ์๊ฐ์ ํํฉ csv ๋ถ๋ฌ์ค๊ธฐ
+df = pd.read_csv('1012.csv')
+
+def group_maker(random_se... | Python | ํ
์คํธ ์ผ์ด์ค๊ฐ ์๋๋ผ๋ฉด if ๋ฌธ์ ์ฐ๋๊ฒ ์ด๋จ๊น์?! |
@@ -0,0 +1,75 @@
+import pandas as pd
+import numpy as np
+
+#์ ์ถ์ ๋ฆฌ์คํธ(์๊ธฐ ์
๋ ฅ)
+videos = ['์กฐ์ฉ์', '์ ํํธ', '์ ์ฐ๋ฏผ', '์ฅ์งํฌ', '์์ฑ์', '์ด์น์', '์ด๋จ์ค', '์ค๋ค์', '์ค์ ๋ฆฌ๋', '์ ์์', '๋ฐฑ์กํ', '๋ฐ์๋น', '๊นํ์ฐ', '๊นํ์', '๊นํํธ', '๊นํ์ฐ', '๊น์์', '๊น์์ฐ', '๊น์ธํ', '๊ฐ์งํธ', '๊ฐ์ํ']
+#Urclass ์๊ฐ์ ํํฉ csv ๋ถ๋ฌ์ค๊ธฐ
+df = pd.read_csv('1012.csv')
+
+def group_maker(random_se... | Python | ํ
์คํธ ์ผ์ด์ค๊ฐ ์๋๋ผ๋ฉด if ๋ฌธ์ ์ฐ๋๊ฒ ์ด๋จ๊น์?! |
@@ -0,0 +1,75 @@
+import pandas as pd
+import numpy as np
+
+#์ ์ถ์ ๋ฆฌ์คํธ(์๊ธฐ ์
๋ ฅ)
+videos = ['์กฐ์ฉ์', '์ ํํธ', '์ ์ฐ๋ฏผ', '์ฅ์งํฌ', '์์ฑ์', '์ด์น์', '์ด๋จ์ค', '์ค๋ค์', '์ค์ ๋ฆฌ๋', '์ ์์', '๋ฐฑ์กํ', '๋ฐ์๋น', '๊นํ์ฐ', '๊นํ์', '๊นํํธ', '๊นํ์ฐ', '๊น์์', '๊น์์ฐ', '๊น์ธํ', '๊ฐ์งํธ', '๊ฐ์ํ']
+#Urclass ์๊ฐ์ ํํฉ csv ๋ถ๋ฌ์ค๊ธฐ
+df = pd.read_csv('1012.csv')
+
+def group_maker(random_se... | Python | try except๋ฅผ ์ฌ์ฉํ๋ ๊ฒ๋ณด๋ค ํ์ธ์ฉ์ด๋ผ๋ฉด assert ๋ฌธ์ ํ์ฉํ์
๋ ์ข์๋ฏํฉ๋๋ค. |
@@ -0,0 +1,75 @@
+import pandas as pd
+import numpy as np
+
+#์ ์ถ์ ๋ฆฌ์คํธ(์๊ธฐ ์
๋ ฅ)
+videos = ['์กฐ์ฉ์', '์ ํํธ', '์ ์ฐ๋ฏผ', '์ฅ์งํฌ', '์์ฑ์', '์ด์น์', '์ด๋จ์ค', '์ค๋ค์', '์ค์ ๋ฆฌ๋', '์ ์์', '๋ฐฑ์กํ', '๋ฐ์๋น', '๊นํ์ฐ', '๊นํ์', '๊นํํธ', '๊นํ์ฐ', '๊น์์', '๊น์์ฐ', '๊น์ธํ', '๊ฐ์งํธ', '๊ฐ์ํ']
+#Urclass ์๊ฐ์ ํํฉ csv ๋ถ๋ฌ์ค๊ธฐ
+df = pd.read_csv('1012.csv')
+
+def group_maker(random_se... | Python | `def group_maker(random_seed, video=len(videos), videos=videos, ur_list=df, group_num=7): `
# ํจ์๊ฐ ์ ์ธ๋๋ ๋ถ๋ถ์๋ `video=len(videos)`์ฒ๋ผ ๋ด์ฅํจ์๊ฐ ์๋ ๊ฒ์ด ์ข์ต๋๋ค.
# ์ด๋ฌํ ๊ฒฝ์ฐ ํจ์ ๋ด๋ถ์ `video` ๋ณ์๊ฐ์ ๋ฐ์์ค๋ ๊ณ์ฐ์์ ๋ง๋๋ ๊ฒ์ด ์ข์ต๋๋ค.
# ์๋ํ๋ฉด ํจ์์ ์ธ๋ถ์ ๊ณ์ฐ์์ด๋ ๋ด์ฅํจ์๊ฐ ํธ์ถ๋๋ฉด `project_group.py์ฝ๋`๊ฐ ํธ์ถ๋๊ฑฐ๋ `group_makerํจ์`๊ฐ ํธ์ถ๋ ๋๋ง๋ค ์ถ๊ฐ์ ์ผ๋ก ๋ฉ๋ชจ๋ฆฌ๊ฐ ์๋น๋ ์ ์์ต๋๋ค... |
@@ -0,0 +1,75 @@
+import pandas as pd
+import numpy as np
+
+#์ ์ถ์ ๋ฆฌ์คํธ(์๊ธฐ ์
๋ ฅ)
+videos = ['์กฐ์ฉ์', '์ ํํธ', '์ ์ฐ๋ฏผ', '์ฅ์งํฌ', '์์ฑ์', '์ด์น์', '์ด๋จ์ค', '์ค๋ค์', '์ค์ ๋ฆฌ๋', '์ ์์', '๋ฐฑ์กํ', '๋ฐ์๋น', '๊นํ์ฐ', '๊นํ์', '๊นํํธ', '๊นํ์ฐ', '๊น์์', '๊น์์ฐ', '๊น์ธํ', '๊ฐ์งํธ', '๊ฐ์ํ']
+#Urclass ์๊ฐ์ ํํฉ csv ๋ถ๋ฌ์ค๊ธฐ
+df = pd.read_csv('1012.csv')
+
+def group_maker(random_se... | Python | โ๏ธ ์์ `ํ
์คํธ ์ผ์ด์ค๊ฐ ์๋๋ผ๋ฉด if ๋ฌธ์ ์ฐ๋๊ฒ ์ด๋จ๊น์?!` ๋ผ๊ณ ๋จ๊ฒผ๋๋ฐ, ๋ ์ฐพ์๋ณด๋ ์ด๋ค ์ํฉ์ ๊ฐ์ ํ๊ณ , ๊ทธ ์ํฉ์ด `AssertError` ๋ก ๊ด๋ฆฌ๋์ด์ผํ๋ค๋ฉด if ๋ณด๋ค assert ๋ฅผ ์ฌ์ฉํ๋๊ฒ ๋ ๊ฐ๊ฒฐํ๊ณ , ๋ช
ํํ๊ฒ ํํ๋ ์ ์๊ฒ ๋ค์ ใ
0ใ
์ ์ฝ๋ฉํธ๋ ๋ฌด์ํ์
๋ ์ข์ต๋๋ค |
@@ -0,0 +1,55 @@
+package christmas.controller;
+
+import christmas.domain.date.Date;
+import christmas.domain.badge.Badge;
+import christmas.domain.reward.Reward;
+import christmas.domain.order.Bill;
+import christmas.dto.RewardDto;
+import christmas.factory.ControllerFactory;
+import christmas.view.OutputView;
+
+pub... | Java | ์ทจํฅ ์ฐจ์ด ๋ผ๊ณ ์๊ฐํ๊ธด ํ์ง๋ง, ๊ฐ์ฒด๋ฅผ ์์ฑํด์ฃผ๋ ๋ผ์ธ๋ค์ ํ๋๋ก ๋ชจ์ผ๊ณ ์ถ๋ ฅprint๋ฉ์๋๋ค์ ์ ๋ถ ๋ชจ์์ฃผ๋๊ฒ๋ ํ๋์ ๋ฐฉ๋ฒ์ผ ๊ฒ ๊ฐ์์
printWelcomeMessage();
Date date = dateController.acceptVisitDate();
Bill bill = orderController.acceptOrder();
Reward reward = eventController.confirmReward(date, bill);
RewardDto rewardDto =... |
@@ -0,0 +1,26 @@
+package christmas.domain.category;
+
+import christmas.domain.menu.Menu;
+import christmas.domain.menu.MenuItem;
+
+public enum Appetizer implements MenuItem {
+ MUSHROOM_SOUP("์์ก์ด์ํ", 6000),
+ TAPAS("ํํ์ค", 5500),
+ CAESAR_SALAD("์์ ์๋ฌ๋", 8000);
+
+ private Menu menu;
+
+ Appetizer(Strin... | Java | ์ธํฐํ์ด์ค๋ฅผ ์ฌ์ฉํ์
จ๊ตฐ์!! ์ด๋ ๊ฒ ๋๋ฉด ์ ์ง ๋ณด์์ ๋ ์ข์๊ฑฐ๋ผ๋ ์๊ฐ์ด ๋๋ค์ ๋ฉ์ ธ์ |
@@ -0,0 +1,32 @@
+package christmas.domain.date;
+
+import christmas.exception.DateException;
+import christmas.exception.message.DateExceptionMessage;
+import christmas.util.Calendar;
+
+import static christmas.constant.DateConstant.START_DAY;
+import static christmas.constant.DateConstant.END_DAY;
+
+public record Da... | Java | ์ ๋ ๋ฆฌ๋ทฐํ๋ค๊ฐ ๋ฐฐ์ด ๋ด์ฉ์ธ๋ฐ localDate.of() ๋ฅผ ์ฌ์ฉํ๋ ๋ฐฉ๋ฒ๋ ์์ด์ ์ถ์ฒ ๋๋ ค์!! |
@@ -0,0 +1,37 @@
+package christmas.domain.event.discount;
+
+import christmas.domain.date.Date;
+import christmas.domain.reward.DiscountEventReward;
+import christmas.lib.event.DiscountEvent;
+
+import static christmas.constant.EventConstant.CHRISTMAS_DAY;
+import static christmas.constant.EventConstant.D_DAY_DISCOUNT... | Java | static import๋ฌธ๋ค์ด ์์ ์์นํ๋ ๊ฒ์ด ์๋ฐ ์ปจ๋ฒค์
์ ๋ถํฉํ๋ ๊ฒ์ผ๋ก ์๊ณ ์์ด์ |
@@ -0,0 +1,14 @@
+package christmas.controller;
+
+import christmas.domain.date.Date;
+import christmas.domain.reward.Reward;
+import christmas.domain.order.Bill;
+import christmas.factory.ServiceFactory;
+import christmas.service.EventService;
+
+public class EventController {
+ private final EventService eventServ... | Java | ํ์ค ๊ณต๋ฐฑ ์ฝ์
์ด ๋น ์ง ๊ฒ ๊ฐ์์ |
@@ -0,0 +1,28 @@
+package christmas.domain.event.discount;
+
+import java.util.List;
+
+import christmas.domain.date.Date;
+import christmas.domain.reward.DiscountEventReward;
+import christmas.lib.event.DiscountEvent;
+
+import static christmas.constant.EventConstant.SPECIAL_DAY_MESSAGE;
+import static christmas.const... | Java | ํน๋ณ ํ ์ธ์ด ์ ์ฉ๋๋ ๋ ์ด ๋งค์ฃผ ์ผ์์ผ, ํฌ๋ฆฌ์ค๋ง์ค ๋ ์ด๋ผ๋ ์ ์ DayOfWeek๋ฅผ ํ์ฉํด์ ํํํ๋ ๊ฒ๋ ์ข์ ๋ฐฉ๋ฒ์ผ๊ฑฐ ๊ฐ์์! |
@@ -0,0 +1,96 @@
+package christmas.domain.order;
+
+import java.util.ArrayList;
+import java.util.EnumMap;
+import java.util.List;
+
+import christmas.domain.menu.Category;
+import christmas.exception.OrderException;
+import christmas.exception.message.OrderExceptionMessage;
+
+import static christmas.constant.OrderCo... | Java | record๋ฅผ ํ์ฉํด์ผ๊ฒ ๋ค๊ณ ์๊ฐํ ์ด์ ๊ฐ ์์๊น์? |
@@ -0,0 +1,27 @@
+package christmas.domain.category;
+
+import christmas.domain.menu.Menu;
+import christmas.domain.menu.MenuItem;
+
+public enum Dessert implements MenuItem {
+ CHOCO_CAKE("์ด์ฝ์ผ์ดํฌ", 15000),
+ ICE_CREAM("์์ด์คํฌ๋ฆผ", 5000);
+
+ private Menu menu;
+
+ Dessert(String name, int price) {
+ this... | Java | ๋ฉ๋ด ์นดํ
๊ณ ๋ฆฌ๋ง๋ค enum ํด๋์ค๋ฅผ ๋๋ ์๊ฐ์ ๋ชปํ๋๋ฐ ์ด๋ ๊ฒ ํ๋ฉด ์ ์ง๋ณด์๊ฐ ๋ ์ฝ๊ฒ ๋ค์!
์ข์ ์์ด๋์ด์ธ๊ฑฐ ๊ฐ์์! |
@@ -0,0 +1,6 @@
+package christmas.constant;
+
+public interface DateConstant {
+ public static int START_DAY = 1;
+ public static int END_DAY = 31;
+} | Java | ์ด ๋ถ๋ถ๋ ์ ์๊ฐ ๋ฐ๋๋ค๋ฉด?
12์์์ 1์๋ก ๋ฐ๋ ๋, 2์๋ก ๋ฐ๋ ๋ ์ผ์์ ๋ํ ์ ์ฝ์กฐ๊ฑด์ ์๋์ผ๋ก ์์ ํด์ฃผ์ด์ผ ํ ๊ฒ์ผ๋ก ์๊ฒฌ๋ฉ๋๋ค.
์ ์ญ์์ ์ค์ ํ๋ ์ฐ/์ ์ค์ ์ ๋ฐํ์ผ๋ก StartDay์ EndDay๋ฅผ ๋์ ์ผ๋ก ํ๋จํ๋ฉด ์ข์ ๊ฒ ๊ฐ์์! |
@@ -0,0 +1,9 @@
+package christmas.constant;
+
+public interface OrderConstant {
+ public static final String ORDER_SEPARATOR = ",";
+ public static final String REQUEST_SEPARATOR = "-";
+
+ public static final int MIN_AMOUNT = 1;
+ public static final int MAX_TOTAL_ORDER_COUNT = 20;
+} | Java | ์ด ๋ถ๋ถ๋ ์ ์ฝ์กฐ๊ฑด์ผ๋ก ๋ถ๋ฆฌํด์ ์ค์ ํ ๋ถ๋ถ ๋๋ฌด ์ข์ต๋๋ค ๐ |
@@ -0,0 +1,26 @@
+package christmas.domain.category;
+
+import christmas.domain.menu.Menu;
+import christmas.domain.menu.MenuItem;
+
+public enum Drink implements MenuItem {
+ ZERO_COKE("์ ๋ก์ฝ๋ผ", 3000),
+ RED_WINE("๋ ๋์์ธ", 60000),
+ CHAMPAGNE("์ดํ์ธ", 25000);
+ private Menu menu;
+
+ Drink(String name, int pr... | Java | ์ด ๋ถ๋ถ๋ 25_000๊ณผ ๊ฐ์ด ์ผ๊ด์ ์ธ ํํ๋ก ์ฌ์ฉํ๋ฉด ์ข์ ๊ฒ ๊ฐ์์! |
@@ -0,0 +1,28 @@
+package christmas.domain.event.discount;
+
+import java.util.List;
+
+import christmas.domain.date.Date;
+import christmas.domain.reward.DiscountEventReward;
+import christmas.lib.event.DiscountEvent;
+
+import static christmas.constant.EventConstant.SPECIAL_DAY_MESSAGE;
+import static christmas.const... | Java | ์ ๋ ์ด ๋ถ๋ถ์ ๋ํด์๋ ๋ค๋ฅธ ์๊ฒฌ์
๋๋ค!
`๋ณ` ์ด ๋ฌ๋ ค์๋ ๋ ์ด ์ด๋ฒคํธ ๋ ๋ก ์ ์ฉํ๋ค๋ ์กฐ๊ฑด์ด์๊ธฐ ๋๋ฌธ์,
์ด ๋ถ๋ถ์ List๋ก ์ ์ ์ผ๋ก ํ ๋นํด์ฃผ๋๊ฒ ์คํ๋ ค ๋ ์ ์ ํ ์ค๊ณ์๋ค๊ณ ์๊ฐํด์! |
@@ -0,0 +1,96 @@
+package christmas.domain.order;
+
+import java.util.ArrayList;
+import java.util.EnumMap;
+import java.util.List;
+
+import christmas.domain.menu.Category;
+import christmas.exception.OrderException;
+import christmas.exception.message.OrderExceptionMessage;
+
+import static christmas.constant.OrderCo... | Java | ์ง์ญ๋ณ์ ์ฌํ ๋น์ ์๋ฐ๊ฐ ์ซ์ดํ๋ ๋ฌธ๋ฒ์ด๋ผ๊ณ ์๊ณ ์์ด์!
์คํธ๋ฆผ ๋ฌธ๋ฒ์ ํตํด ํํฐ๋งํด์ ๋ํ๋ ๋ก์ง์ ์ค๊ณํ๋ค๋ฉด,
๋ถํ์ํ ์ง์ญ๋ณ์ ์ฌํ ๋น์ ํผํ ์ ์์ ๊ฒ ๊ฐ์์! |
@@ -0,0 +1,96 @@
+package christmas.domain.order;
+
+import java.util.ArrayList;
+import java.util.EnumMap;
+import java.util.List;
+
+import christmas.domain.menu.Category;
+import christmas.exception.OrderException;
+import christmas.exception.message.OrderExceptionMessage;
+
+import static christmas.constant.OrderCo... | Java | calculateTotalPrice์ ๋ฆฌํดํ์ Integer์ธ๋ฐ, ๋ฐํ ๋ณ์๋ int๋ค์!
ํด๋น ๋ฉ์๋๋ฅผ Integer๋ก ๋ฐํํ๋๋ก ์ค๊ณํ์ ์ด์ ๊ฐ ์์๊น์? |
@@ -0,0 +1,9 @@
+package christmas.constant;
+
+public interface BadgeConstant {
+ public static final int SANTA_THRESHOLD = 20000;
+ public static final int TREE_THRESHOLD = 10000;
+ public static final int STAR_THRESHOLD = 5000;
+ public static final int NON_THRESHOLD = 0;
+
+} | Java | ํ์ฌ ๊ตฌํํ์ ์ฝ๋์์ `BadgeConstant` ๋ `Badge` enum ์์ ์์๋ก ๋ฐ์ ์ฌ์ฉ๋์ง ์์ ๊ฒ์ผ๋ก ์กฐ๊ธ ๋ถํ์ํ ์ธํฐํ์ด์ค์ง ์๋ ์๊ฐ์ด๋ญ๋๋ค. `Badge` enum ์์ ์ด ๋ถ๋ถ์ ํจ๊ป ๊ตฌํํ ์ ์๋ค๊ณ ์๊ฐํ๋๋ฐ ์ด๋ป๊ฒ ์๊ฐํ์๋์? |
@@ -0,0 +1,27 @@
+package christmas.constant;
+
+import christmas.domain.category.Drink;
+import christmas.domain.menu.Menu;
+
+public interface EventConstant {
+ public static final Integer EVENT_THRESHOLD_PRICE = 10000;
+
+ public static final Integer WEEKEND_DISCOUNT_PRICE = 2023;
+ public static final Stri... | Java | ์ด๋ฒคํธ ๊ด๋ จ ์์๋ฅผ ์ ๋ enum ์ผ๋ก ๊ตฌํํ์ต๋๋ค. ์ธํฐํ์ด์ค๋ก ์์๋ค์ ์ ์ํ์ ์ด์ ๊ฐ ๊ถ๊ธํฉ๋๋ค! |
@@ -0,0 +1,32 @@
+package christmas.domain.date;
+
+import christmas.exception.DateException;
+import christmas.exception.message.DateExceptionMessage;
+import christmas.util.Calendar;
+
+import static christmas.constant.DateConstant.START_DAY;
+import static christmas.constant.DateConstant.END_DAY;
+
+public record Da... | Java | ๋ ์ง ์ ๋ณด๋ฅผ ๋ด์ ๋ถ๋ณ๊ฐ์ฒด๋ฅผ ์ด์ฉํ์
จ๊ตฐ์ ๐ ๋ค๋ง ํ์ฌ `Date` ๊ฐ์ฒด๋ ๋ ์ง ์ ๋ณด์ ์์ผ ์ ๋ณด๋ง ๊ฐ์ง๊ณ ์๋๊ฒ์ผ๋ก ๋ณด์ด๋๋ฐ ๊ทธ๋ ๋ค๋ฉด ์ด๋ฏธ ์๋ฐ์์ ์ ๊ณตํ๋ `LocalDate` ๋ฅผ ์ฌ์ฉํ๋๊ฒ ์ด๋จ๊น ํ๋ ์๊ฐ์ด ๋ญ๋๋ค! 1์ฃผ์ฐจ ํผ๋๋ฐฑ์๋ ๋์ค๋ ๋ด์ฉ์ด๋๊น ๊ณ ๋ คํด๋ณด์๋ฉด ์ข์๊ฒ ๊ฐ์ต๋๋ค ๐ |
@@ -0,0 +1,25 @@
+package christmas.domain.event;
+
+import christmas.lib.event.DiscountEvent;
+import christmas.lib.event.Event;
+import christmas.lib.event.PresentEvent;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public record InProgressEventList(List<DiscountEvent> discountEventList,
+ ... | Java | ์ด ๋ถ๋ถ์ ์ฝ๊ฐ ๊ฐ์ ํ ์๋ ์์๊ฒ ๊ฐ์ต๋๋ค! ์ด ํด๋์ค์ `of` ๋ฉ์๋๋ `EventSercice` ์์ `EventFactory` ์ static ๋ณ์์ธ `EVENT_LIST` ๋ฅผ ํ๋ผ๋ฏธํฐ๋ก ๋ฃ์ด์ ์์ฑํ๋ ๋ถ๋ถ์์๋ง ์ฐ์ด๋๋ฐ `EVENT_LIST` ๋ ํญ์ ๊ฐ์ ๊ฐ์ ๊ฐ์ง๋ ๋ณ์๋ก ์์๋ฉ๋๋ค. ๊ทธ๋ ๋ค๋ฉด ์ฒ์๋ถํฐ ํ ์ธ ์ด๋ฒคํธ์ ์ฆ์ ์ด๋ฒคํธ๋ฅผ ๋ฐ๋ก ๊ด๋ฆฌํ๋ ๋ฐฉ๋ฒ์ ์ด๋จ๊น์? |
@@ -0,0 +1,45 @@
+package christmas.domain.event.discount;
+
+import java.util.List;
+
+import christmas.domain.date.Date;
+import christmas.domain.date.DayOfWeek;
+
+import christmas.domain.reward.DiscountEventReward;
+import christmas.domain.menu.Category;
+
+import christmas.domain.order.Bill;
+import christmas.doma... | Java | ์ด ๋ถ๋ถ์ stream ์ ์ฌ์ฉํด ์ด๋ ๊ฒ ๊ตฌํํ ์๋ ์์ต๋๋ค ๐
```java
public class WeekdayDiscountEvent extends DiscountEvent<Bill> {
//...
private int countOrderMenu(List<OrderInfo> orderInfos) {
return orderInfos.stream()
.mapToInt.(OrderInfo::amount)
.sum();
}
//...
}
``` |
@@ -0,0 +1,96 @@
+package christmas.domain.order;
+
+import java.util.ArrayList;
+import java.util.EnumMap;
+import java.util.List;
+
+import christmas.domain.menu.Category;
+import christmas.exception.OrderException;
+import christmas.exception.message.OrderExceptionMessage;
+
+import static christmas.constant.OrderCo... | Java | ์ ๋ ๊ฒ์ฆ๋ก์ง์ ๋ถ๋ฆฌํ๋๊ฒ์ ์ ํธํ๋๋ฐ ์ด ๋ถ๋ถ์ ๋ํด์ ์ด๋ป๊ฒ ์๊ฐํ์๋์ง ๊ถ๊ธํฉ๋๋ค! |
@@ -0,0 +1,55 @@
+package christmas.controller;
+
+import christmas.domain.date.Date;
+import christmas.domain.badge.Badge;
+import christmas.domain.reward.Reward;
+import christmas.domain.order.Bill;
+import christmas.dto.RewardDto;
+import christmas.factory.ControllerFactory;
+import christmas.view.OutputView;
+
+pub... | Java | ์๊ตฌ์ฌํญ์ ์๊ฐํด์ ,
์์ฑํ๊ณ ๊ฐ์ด ์ถ๋ ฅํ๋ ์์ผ๋ก ์๊ฐํ๋๋ฐ ,
์ด๋ ๊ฒ print ๊ตฌ๋ฌธ ๋ชจ์๋์๊ฑฐ๋ ๊ด์ฐฎ๋ค์!! |
@@ -0,0 +1,32 @@
+package christmas.domain.date;
+
+import christmas.exception.DateException;
+import christmas.exception.message.DateExceptionMessage;
+import christmas.util.Calendar;
+
+import static christmas.constant.DateConstant.START_DAY;
+import static christmas.constant.DateConstant.END_DAY;
+
+public record Da... | Java | ์ ๋ ๋ณด๊ณ ์ ๊ธฐํด์ ๋๋ฌ์ต๋๋ค.. |
@@ -0,0 +1,37 @@
+package christmas.domain.event.discount;
+
+import christmas.domain.date.Date;
+import christmas.domain.reward.DiscountEventReward;
+import christmas.lib.event.DiscountEvent;
+
+import static christmas.constant.EventConstant.CHRISTMAS_DAY;
+import static christmas.constant.EventConstant.D_DAY_DISCOUNT... | Java | ์๋ ์ ๋ ฌ์ด , ๋ฐ์ผ๋ก ๋ด๋ ค๊ฐ์ ๋ณ๊ฒฝํ๋ค๊ณ ์ ๊ฒฝ์ผ๋๋ฐ
ํด๋น ๋ถ๋ถ์ ๋์ณค๋ค์ ใ
ใ
|
@@ -0,0 +1,14 @@
+package christmas.controller;
+
+import christmas.domain.badge.Badge;
+import christmas.dto.RewardDto;
+import christmas.factory.ServiceFactory;
+import christmas.service.BadgeService;
+
+public class BadgeController {
+ private BadgeService badgeService = ServiceFactory.getBadgeService();
+
+ p... | Java | grantBadge! ํด๋์ค๋ช
์์ ์ผ์ค๊ฐ ๋์น๋ค์ ใ
ใ
๊ทธ๋ฐ๋ฐ ํน์ get ๋์ ์ grant๋ฅผ ๋ฉ์๋๋ช
์ผ๋ก ์ ์ธํ ์ด์ ๊ฐ ์์๊น์? |
@@ -0,0 +1,146 @@
+import { CartStoreState, User } from 'types/index';
+import { useDispatch, useSelector } from 'react-redux';
+
+import Link from 'components/@shared/Link';
+import Logo from 'components/Logo/Logo';
+import PATH from 'constants/path';
+import RightMenu from './RightMenu';
+import { isLogin } from 'uti... | Unknown | state.cart.cart๋ ์ด์ง ์์ฌ์ด ๋ค์ด๋ฐ์ธ๊ฒ ๊ฐ์์!
items ์ ๋๋ฉด ๊ด์ฐฎ์ ๋ค์ด๋ฐ์ด์ง ์์๊น ์๊ฐํด๋ด
๋๋ค ๐ |
@@ -0,0 +1,146 @@
+import { CartStoreState, User } from 'types/index';
+import { useDispatch, useSelector } from 'react-redux';
+
+import Link from 'components/@shared/Link';
+import Logo from 'components/Logo/Logo';
+import PATH from 'constants/path';
+import RightMenu from './RightMenu';
+import { isLogin } from 'uti... | Unknown | showUserToggle์ ์ด๋์์ ์ฌ์ฉ๋๊ณ ์๋ ๋ณ์์ธ๊ฐ์?
์ฐพ์๋ณด๊ณ ์๋๋ฐ ์ ์ ๋ณด์ด๋ค์ ๐ฅ |
@@ -0,0 +1,146 @@
+import { CartStoreState, User } from 'types/index';
+import { useDispatch, useSelector } from 'react-redux';
+
+import Link from 'components/@shared/Link';
+import Logo from 'components/Logo/Logo';
+import PATH from 'constants/path';
+import RightMenu from './RightMenu';
+import { isLogin } from 'uti... | Unknown | localStorage์ sessionStorage๋ฅผ ๋ชจ๋ ์ฌ์ฉํ ์ด์ ๊ฐ ์์๊น์? |
@@ -0,0 +1,143 @@
+import CheckBox from 'components/@shared/CheckBox';
+import Link from 'components/@shared/Link';
+import PATH from 'constants/path';
+import { USER_MESSAGE } from 'constants/message';
+import authAPI from 'apis/auth';
+import { createInputValueGetter } from 'utils/dom';
+import styled from 'styled-co... | Unknown | ์๊ฐ์ด ๋๋ค๋ฉด import ๋ฌธ๋ค์ ์์๋ฅผ ์ ๋ฆฌํด์ฃผ๋๊ฒ๋ ์ข์ ๊ฒ ๊ฐ์์!
hooks๋ ๋ณดํต ์ต์์์์ ๋ถ๋ฌ์์ฃผ๋๊ฒ์ผ๋ก ์๊ณ ์์ต๋๋ค! |
@@ -0,0 +1,37 @@
+import { ApolloServer } from 'apollo-server';
+
+import typeDefs from './typeDefs';
+import resolvers from './resolvers';
+
+import model from './database/models';
+import * as jwtManager from './util/jwt-manager';
+
+// Set GraphQL Apollo server
+const context = ({ req }) => {
+ const authorizatio... | JavaScript | `authorization`์ด ์์๋์ ์ฒ๋ฆฌ๊ฐ ์ข๋ค์~ |
@@ -0,0 +1,37 @@
+import { ApolloServer } from 'apollo-server';
+
+import typeDefs from './typeDefs';
+import resolvers from './resolvers';
+
+import model from './database/models';
+import * as jwtManager from './util/jwt-manager';
+
+// Set GraphQL Apollo server
+const context = ({ req }) => {
+ const authorizatio... | JavaScript | `token`, `user`์ ๋ง๋๋ ๊ตฌ๋ฌธ์ ์ด์ฐจํผ `authorization`์ด ์์ผ๋ฉด ๋ฌดํจํ ๋ก์ง์ผ๋ก ๋ณด์ด๋๋ฐ์
๋ณ๋์ ํ๋ฆ์ ๋ง๋ค๊ฑฐ๋ ๋ณ๋์ ํจ์๋ก ๋ถ๋ฆฌํ์ง ์์ ์ด์ ๊ฐ ์์๊น์?
๋ํ `[1]`์ผ๋ก ๋ฐฐ์ด์์ ์์ดํ
์ ํฝํด์ค๋ ๊ฒ์ ์์์ ์ผ๋ก ๋๊ปด์ง๋๋ฐ์.
๋ช
์์ ์ผ๋ก ๋ณ๊ฒฝํด๋ณด์๋๊ฑด ์ด๋จ๊น์? |
@@ -0,0 +1,38 @@
+// import dotenv from 'dotenv';
+const dotenv = require('dotenv');
+dotenv.config();
+
+const {
+ DB_DEV_USER,
+ DB_DEV_PASSWORD,
+ DB_DEV_DATABASE,
+ DB_DEV_HOST,
+ DB_PRODUCTION_USER,
+ DB_PRODUCTION_PASSWORD,
+ DB_PRODUCTION_DATABASE,
+ DB_PRODUCTION_HOST,
+} = process.env;
... | JavaScript | ๋ถํ์ํ ์ฃผ์์ผ๋ก ๋ณด์
๋๋ค~ |
@@ -0,0 +1,38 @@
+// import dotenv from 'dotenv';
+const dotenv = require('dotenv');
+dotenv.config();
+
+const {
+ DB_DEV_USER,
+ DB_DEV_PASSWORD,
+ DB_DEV_DATABASE,
+ DB_DEV_HOST,
+ DB_PRODUCTION_USER,
+ DB_PRODUCTION_PASSWORD,
+ DB_PRODUCTION_DATABASE,
+ DB_PRODUCTION_HOST,
+} = process.env;
... | JavaScript | ์ข์ ์ต๊ด์
๋๋ค ๐ |
@@ -0,0 +1,19 @@
+FROM node:11.11.0
+
+# ์ฑ ๋๋ ํฐ๋ฆฌ ์์ฑ
+WORKDIR /usr/src/app
+
+# ์ฑ ์์กด์ฑ ์ค์น
+# ๊ฐ๋ฅํ ๊ฒฝ์ฐ(npm@5+) package.json๊ณผ package-lock.json์ ๋ชจ๋ ๋ณต์ฌํ๊ธฐ ์ํด
+# ์์ผ๋์นด๋๋ฅผ ์ฌ์ฉ
+COPY package*.json ./
+
+RUN npm install
+# ํ๋ก๋์
์ ์ํ ์ฝ๋๋ฅผ ๋น๋ํ๋ ๊ฒฝ์ฐ
+# RUN npm ci --only=production
+
+# ์ฑ ์์ค ์ถ๊ฐ
+COPY . .
+
+EXPOSE 4000
+CMD [ "npm", "start" ... | Unknown | `RUN npm ci --only=production`๋ก ์นํํ๋๊ฒ ๋ ๋ฐ๋์งํด๋ณด์ด๋ค์ :) |
@@ -0,0 +1,38 @@
+// import dotenv from 'dotenv';
+const dotenv = require('dotenv');
+dotenv.config();
+
+const {
+ DB_DEV_USER,
+ DB_DEV_PASSWORD,
+ DB_DEV_DATABASE,
+ DB_DEV_HOST,
+ DB_PRODUCTION_USER,
+ DB_PRODUCTION_PASSWORD,
+ DB_PRODUCTION_DATABASE,
+ DB_PRODUCTION_HOST,
+} = process.env;
... | JavaScript | ํ๊ฒฝ๋ณ์๋ฅผ .envํ์ผ์ `DEV_`์ `PRODUCTION` ๊ตฌ๋ถ์ ๋์ด ์ ์ฅํ๋ ๊ฒ๋ณด๋ค
ํ๊ฒฝ๋ณ์๋ช
์ ์ผ์น์ํค๊ณ (=dev, prod ๊ตฌ๋ถ์์ด)
์ถ๊ฐ๋ก `.env.test`, `.env.dev` ์ ๊ฐ์ ํ์ผ์ ๋ง๋ค์ด ๊ด๋ฆฌํ๋๊ฑธ ์ถ์ฒ๋๋ฆฝ๋๋ค.
https://github.com/motdotla/dotenv#should-i-have-multiple-env-files |
@@ -0,0 +1,38 @@
+// import dotenv from 'dotenv';
+const dotenv = require('dotenv');
+dotenv.config();
+
+const {
+ DB_DEV_USER,
+ DB_DEV_PASSWORD,
+ DB_DEV_DATABASE,
+ DB_DEV_HOST,
+ DB_PRODUCTION_USER,
+ DB_PRODUCTION_PASSWORD,
+ DB_PRODUCTION_DATABASE,
+ DB_PRODUCTION_HOST,
+} = process.env;
... | JavaScript | ์ด ๋ผ์ธ์ด ๊ผญ ์ฃผ์์ฒ๋ฆฌ ๋์ด์ผํ๋์ง ํ์ธํด๋ณด์๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค |
@@ -0,0 +1,31 @@
+'use strict';
+module.exports = {
+ up: (queryInterface, Sequelize) => {
+ return queryInterface.createTable('room_options', {
+ bed: {
+ type: Sequelize.INTEGER,
+ },
+ bedroom: {
+ type: Sequelize.INTEGER,
+ },
+ ... | JavaScript | 'use strict'๋ฅผ ๊ผญ ์จ์ผํ๋์?
๋ง์ฝ ๊ผญ ํ์ํ๋ค๋ฉด, ์ด ๋ผ์ธ์ด ์๋ ํ์ผ๋ ์๋๋ฐ ์ฃผ์์ผ๋ก ์ค๋ช
์ ๋ฌ์๋์ผ๋ฉด ์ข์ ๊ฒ ๊ฐ๋ค์ :) |
@@ -0,0 +1,37 @@
+'use strict';
+
+module.exports = {
+ up: (queryInterface, Sequelize) => {
+ return queryInterface.bulkInsert(
+ 'users',
+ [
+ {
+ name: '์ผ์ง์',
+ email: 'init@init.com',
+ password: 'password',
+ ... | JavaScript | mock ๋ฐ์ดํฐ์ง๋ง ์๋ช
์ผ์ค ๐ |
@@ -0,0 +1,38 @@
+// import dotenv from 'dotenv';
+const dotenv = require('dotenv');
+dotenv.config();
+
+const {
+ DB_DEV_USER,
+ DB_DEV_PASSWORD,
+ DB_DEV_DATABASE,
+ DB_DEV_HOST,
+ DB_PRODUCTION_USER,
+ DB_PRODUCTION_PASSWORD,
+ DB_PRODUCTION_DATABASE,
+ DB_PRODUCTION_HOST,
+} = process.env;
... | JavaScript | ์ค๋ณต๋๋ ์ฝ๋๋ ๊ฐ๋ฅํ๋ฉด ์ค์ด๋ ๊ฒ์ด ์ข์ต๋๋ค. ์๋ํ๋ฉด ์ง๊ธ์ ์ฝ๋๊ฐ ๋ง์ง ์์์ ๋ฌธ์ ๊ฐ ์๋ค๊ณ ๋๋ ์๋ ์์ง๋ง, ์ดํ ๋ณต์ก๋๊ฐ ์ฆ๊ฐํ๋ฉด ์ฝ๋๋ฅผ ์์ ํ ๋ ์ ์ง๋ณด์์ ์ธก๋ฉด์์ ๋ฒ๊ทธ๊ฐ ๋ฐ์ํ ์ ์๋ ๊ฐ๋ฅ์ฑ์ด ๋์์ง๊ธฐ ๋๋ฌธ์
๋๋ค. `DRY(Don't Repeat Yourself)` ์์น์ ์ดํ๋ก๋ ํญ์ ๊ธฐ์ตํ๊ณ ์ฝ๋๋ฅผ ์์ฑํ๋ ๊ฒ์ด ๋ฐ๋์งํ ๊ฒ ๊ฐ์ต๋๋ค. |
@@ -0,0 +1,37 @@
+import fs from 'fs';
+import path from 'path';
+import Sequelize from 'sequelize';
+import configs from '../../config/database.js';
+
+const basename = path.basename(__filename);
+const env = process.env.NODE_ENV || 'development';
+const config = configs[env];
+
+const db = {};
+
+let sequelize;
+if (... | JavaScript | db ๊ฐ์ฒด์ ํ๋๊ฐ์ด ์ด๋ ๊ฒ ๋น์ทํ๋ฉด ์ดํ์ ํท๊ฐ๋ฆฌ๊ธฐ ์ฌ์ธ ๊ฒ ๊ฐ์ต๋๋ค. ๋ณ์ ๋ช
์ ์กฐ๊ธ ๋ ๋ช
ํํ๊ฒ ๊ตฌ๋ถ์ ํด ์ฃผ๋ ๊ฒ๋ ์ข์ ๊ฒ ๊ฐ์์. |
@@ -0,0 +1,28 @@
+'use strict';
+
+module.exports = {
+ up: (queryInterface, Sequelize) => {
+ return queryInterface.bulkInsert(
+ 'room_types',
+ [
+ {
+ name: '์ง ์ ์ฒด',
+ },
+ {
+ name: '๊ฐ์ธ์ค',
+ ... | JavaScript | ๊ฐ์ค์ ๋ถ์ฌ์ ์จ์ผ ํ๋๋ฐ ์คํ์ธ ๊ฒ ๊ฐ๋ค์ |
@@ -0,0 +1,13 @@
+NODE_ENV=
+
+DB_DEV_USER=
+DB_DEV_PASSWORD=
+DB_DEV_DATABASE=
+DB_DEV_HOST=
+
+DB_PRODUCTION_USER=
+DB_PRODUCTION_PASSWORD=
+DB_PRODUCTION_DATABASE=
+DB_PRODUCTION_HOST=
+
+TOKEN_SECRET_KEY=
\ No newline at end of file | Unknown | .env ํ์ผ์ ์ค์ ๋ก ์ฌ์ฉํ ๋๋ ๋ฏผ๊ฐํ ์ ๋ณด๋ค์ด ๋ง์ด ์์ ์ ์์ผ๋ .dev.env ํํ๋ก github์์ ๋ณด์ด์ง ์๊ฒ ํด์ฃผ๋ ๊ฒ๋ ๋ณด์์ ์ข์ ๊ฒ ๊ฐ์์. |
@@ -0,0 +1,37 @@
+import fs from 'fs';
+import path from 'path';
+import Sequelize from 'sequelize';
+import configs from '../../config/database.js';
+
+const basename = path.basename(__filename);
+const env = process.env.NODE_ENV || 'development';
+const config = configs[env];
+
+const db = {};
+
+let sequelize;
+if (... | JavaScript | ํ ์ค์ด๋ผ๋ ๋ง์ฝ ํ ๋์ ๋ณด๊ธฐ์ ์กฐ๊ธ ๋ณต์กํ๋ค๋ ๋๋์ด ๋ ๋ค๋ฉด ๋ณ๋์ ํจ์ ํํ๋ก ์ธ๋ถ์ ๋นผ๋ ๊ฒ๋ ์ข์ ๊ฒ ๊ฐ์์. ์ดํ์ ์กฐ๊ฑด์ด ๋ ๋ถ๋๋ค๋ฉด ๊ทธ๋ ๊ฒ ํ๋ ๊ฒ์ ๊ถ์ฅํฉ๋๋ค. ๋ค๋ฅธ ๊ฐ๋ฐ์๊ฐ ์ฝ๋๋ฅผ ์ดํดํ๋๋ฐ ํจ์ฌ ๋ ๋์์ด ๋ ๊ฒ์
๋๋ค. |
@@ -0,0 +1,11 @@
+import styled from 'styled-components';
+
+export const HeaderWrapper = styled.header`
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ width: 100%;
+ height: ${({ theme }) => theme.boxHeight};
+ padding: 0px 24px;
+ background: ${({ theme }) => theme.color.primary.ma... | Unknown | ์ด ๊ตฌํ๋ ์ ๋ง ์ข์๋ฐ์~
๋ง์ด ๋ด๋ ค๊ฐ ์ํ์์ ํค๋๋ฅผ ๋ค์ ๋ณด๋ ค๋ฉด ์๋ก ๋ง์ด ์ฌ๋ผ๊ฐ์ผํด์ ์ด๋ ค์ธ ๊ฒ ๊ฐ์์
๋ฌดํ ํ์ด์ง ํน์ฑ์ position:sticky ์ต์
์ ํ์ฉํ์ฌ
๋ค๋น๊ฒ์ด์
๋ฐ๊ฐ ๋ฌ๋ค๋ฉด UX๊ฒฝํ์ด ๋ ์ข์์ง ๊ฑฐ๊ฐ์์. |
@@ -0,0 +1,41 @@
+INSERT INTO board_entity (board_name)
+VALUES
+ ('์์ ๊ฒ์ํ'),
+ ('๊ฐ๋ฐ ๊ฒ์ํ'),
+ ('์ผ์ ๊ฒ์ํ'),
+ ('์ฌ๊ฑด์ฌ๊ณ ๊ฒ์ํ');
+
+INSERT INTO article_entity (title, content, password, board_id)
+VALUES
+ ('์๋์
๊ตฌ์ญ ๋ง์ง ์ถ์ฒ', '์๋์
๊ตฌ์ญ ๊ทผ์ฒ์ ์๋ ํํ๋จ์ ์๋น์ด ๋ง์์ด์!', '1234', 1),
+ ('์ฐ์ ํ๋ก๊ทธ๋จ์ ๋ณด๋ฉด์..', '๊ฐ๋ฐ์๋ค์ ์ํ ์๋ฅ ํ๋ก๊ทธ๋จ์ด ์์์ผ๋ฉด ์ข๊ฒ ๋ค.. ์ ๊ทผ๋ฐ ... | Unknown | yaml์ค์ create๋ผ ํ
์คํธ์ฉ ๋ฐ์ดํฐ ์ ๋ถ ์์ฑํด๋์ ์ฌ์ธํจ์ ๋๋์ต๋๋ค. |
@@ -0,0 +1,147 @@
+package com.subject.board.article;
+
+import com.subject.board.board.BoardService;
+import com.subject.board.comment.CommentService;
+import com.subject.board.entity.ArticleEntity;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Controller;
+import org.springframework.u... | Java | ์ ์ฒด ๊ฒ์๊ธ์์ ๊ฒ์๊ธ ์์ฑ์ ์๋ํ๋ ๊ฒ์๊ธ ์ฃผ์ ๋ฅผ ์ ํํ๋ ๋๋กญ๋ค์ด์ ์๋ฌด๊ฒ๋ ๋์ค์ง ์์ต๋๋ค.
๊ฒ์ํ์ ์ ๋ณด๋ฅผ model์ ๋ด์ ์ ๋ฌํ๋ ๊ณผ์ ์ด ๋น ์ง ๊ฒ ๊ฐ์์. |
@@ -0,0 +1,147 @@
+package com.subject.board.article;
+
+import com.subject.board.board.BoardService;
+import com.subject.board.comment.CommentService;
+import com.subject.board.entity.ArticleEntity;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Controller;
+import org.springframework.u... | Java | ์ ๊ฐ ๋ฑ ์ํ๋ ๊ธฐ๋ฅ์ด์๋๋ฐ ์ด๋ ๊ฒ ๊ตฌํํ๋ ๊ฒ์ด์๊ตฐ์! ์ ๋ฐฐ์๊ฐ๋๋ค. |
@@ -0,0 +1,21 @@
+package com.subject.board.entity;
+
+import jakarta.persistence.*;
+import lombok.Data;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+@Getter
+@Setter
+@Entity
+public class BoardEntity {
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private Long id;
+ ... | Java | entity์์ article์ id๋ฅผ ์ ๋ ฌํด ๋ถ๊ฐ์ ์ธ ์ฝ๋์ ์ถ๊ฐ ์์ด ๊ฐ๋จํ๊ฒ ๊ฒ์๊ธ์ ์ ๋ ฌํ ์ ์์๋ค์. ๋ฐฐ์ฐ๊ณ ๊ฐ๋๋ค. |
@@ -0,0 +1,58 @@
+package com.subject.board.comment;
+
+import com.subject.board.article.ArticleRepository;
+import com.subject.board.entity.ArticleEntity;
+import com.subject.board.entity.CommentEntity;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+i... | Java | password ์คํ์์ต๋๋ค.
return password.equals(inputPassword); ๋ก ์ค์ผ์ ์์๊ฒ ๊ฐ์ต๋๋ค. |
@@ -0,0 +1,41 @@
+INSERT INTO board_entity (board_name)
+VALUES
+ ('์์ ๊ฒ์ํ'),
+ ('๊ฐ๋ฐ ๊ฒ์ํ'),
+ ('์ผ์ ๊ฒ์ํ'),
+ ('์ฌ๊ฑด์ฌ๊ณ ๊ฒ์ํ');
+
+INSERT INTO article_entity (title, content, password, board_id)
+VALUES
+ ('์๋์
๊ตฌ์ญ ๋ง์ง ์ถ์ฒ', '์๋์
๊ตฌ์ญ ๊ทผ์ฒ์ ์๋ ํํ๋จ์ ์๋น์ด ๋ง์์ด์!', '1234', 1),
+ ('์ฐ์ ํ๋ก๊ทธ๋จ์ ๋ณด๋ฉด์..', '๊ฐ๋ฐ์๋ค์ ์ํ ์๋ฅ ํ๋ก๊ทธ๋จ์ด ์์์ผ๋ฉด ์ข๊ฒ ๋ค.. ์ ๊ทผ๋ฐ ... | Unknown | ๋ฐ์ดํฐ๊ฐ ๋ค์ด์์ด์ ํ
์คํธํ๊ธฐ ์ข์์ต๋๋ค. |
@@ -0,0 +1,147 @@
+package com.subject.board.article;
+
+import com.subject.board.board.BoardService;
+import com.subject.board.comment.CommentService;
+import com.subject.board.entity.ArticleEntity;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Controller;
+import org.springframework.u... | Java | ArticleEntity๊ฐ ์ด๋ฏธ Comment ๋ฆฌ์คํธ๋ฅผ ๊ฐ๊ณ ์๊ธฐ ๋๋ฌธ์ ๊ตณ์ด comments๋ฅผ ๋ชจ๋ธ๋ก ๋ฐ๋ก ๋๊ธฐ์ง ์์๋ ๋ ๊ฒ ๊ฐ์ต๋๋ค. |
@@ -0,0 +1,54 @@
+package christmas.constant;
+
+public final class CommentConstants {
+ public static final String EVENT_INFORMATION_MESSAGE = """
+ ์ฐํ
์ฝ ์๋น์ ์ต๋ ์ด๋ฒคํธ! 12์ ์ด๋ฒคํธ๋ฅผ ์์ํฉ๋๋ค!
+ ์ต๋ 3๋ฒ์ ์ค๋ณต ํ ์ธ๊ณผ ์ฐํ
์ฝ๊ฐ ์ค๋นํ ๋ ๊ฐ์ ๊น์ง ์ ๋ฌผ์ ๋ฐ์ ๊ฐ์ธ์!
+ * ๋ชจ๋ ์ด๋ฒคํธ๋ ํ ์ด๋ฒคํธ์ ์ค๋ณต ์ ์ฉ์ด ๊ฐ๋ฅํฉ๋๋ค.
+
+ ... | Java | ์ ์ด๊ฑด ํน์ ์ฌ์ฉ๋๋ ์๋ ๋ฉ์์ง์ผ๊น์!? |
@@ -0,0 +1,11 @@
+package christmas.domain.discount;
+
+import christmas.constant.DiscountPolicyName;
+import christmas.service.dto.OrderDto;
+
+public interface DiscountPolicy {
+
+ int discount(final OrderDto order);
+
+ DiscountPolicyName getDiscountPolicyName();
+}
\ No newline at end of file | Java | ์ธํฐํ์ด์ค๋ฅผ ์ ์ ํ๊ฒ ์ ์ฌ์ฉํ์ ๊ฑฐ ๊ฐ์์! ๊ฐ ํ ์ธ์ ๋ํด ํ์ฅ์ด๋ ๋ณ๊ฒฝ์ด ์ฌ์ธ ๊ฒ ๊ฐ์์! |
@@ -0,0 +1,52 @@
+package christmas.domain.menu;
+
+import java.util.Arrays;
+
+public enum Menu {
+
+ MUSHROOM_SOUP("์์ก์ด์ํ", 6_000, MenuCategory.APPETIZER),
+ TAPAS("ํํ์ค", 5_500, MenuCategory.APPETIZER),
+ CAESAR_SALAD("์์ ์๋ฌ๋", 8_000, MenuCategory.APPETIZER),
+
+ T_BONE_STEAK("ํฐ๋ณธ์คํ
์ดํฌ", 55_000, MenuCategory... | Java | ์ ์ฝ๋๋ ์ ๋ ๊ฑฐ์ ๋๊ฐ๋ค์ ใ
ใ
์ด๋ฆ๋ ๋๊ฐ์๋ฐ ์ ๊ธฐํ๋ค์ ใ
ใ
ใ
๋ฉ๋ด์ ๋ํ ์ถ๊ฐ์ ์ธ ๋ก์ง์ด ์์ด์ ์ด๋ ๊ฒ ๋ฉ๋ด๋ฅผ ๋ชจ์๋๋ ๊ฒ ๋ ๊ฐ๋
์ฑ์ด ์ข์ ๊ฒ ๊ฐ์์! |
@@ -0,0 +1,77 @@
+package christmas.domain.discount;
+
+import christmas.constant.DiscountConstants;
+import christmas.constant.DiscountPolicyName;
+import christmas.domain.menu.Menu;
+import christmas.domain.menu.MenuCategory;
+import christmas.service.dto.OrderDto;
+import java.time.DayOfWeek;
+import java.time.Local... | Java | DayOfWeek ์ฌ์ฉ๋ฒ ์ ๋ง ๋ชฐ๋๊ตฐ์.. ๋๊ฒ ์ข์ ๋ฐฉ๋ฒ์ธ ๊ฑฐ ๊ฐ์์! ๐๐ |
@@ -0,0 +1,74 @@
+package christmas.domain;
+
+import christmas.constant.DiscountConstants;
+import christmas.constant.DiscountPolicyName;
+import christmas.domain.discount.ChristmasDailyDiscountPolicy;
+import christmas.domain.discount.DiscountPolicy;
+import christmas.domain.discount.GiftEventPolicy;
+import christma... | Java | ์ฆ์ ๋ฉ๋ด์ ๋ํด์ ํ์ฅ์ฑ์ด ๋ณด์ฌ์ ์ข์ ๊ฑฐ ๊ฐ์์! ๐ |
@@ -0,0 +1,115 @@
+package christmas.controller;
+
+import static christmas.model.constant.DiscountConstant.GIFT_EVENT_THRESHOLD;
+
+import christmas.model.Date;
+import christmas.model.MenuCount;
+import christmas.model.constant.PromotionConstant;
+import christmas.model.strategy.BadgeStrategy;
+import christmas.model... | Java | ์ปจํธ๋กค๋ฌ๋ ํ๋ฆ์ ์ ์ดํ๋ ์ฑ
์์ ๊ฐ์ง๊ณ ์๋ ๊ฒ์ผ๋ก ๋ณด์
๋๋ค. ์ด๋ฒคํธ ์ ์ฉ ์ฌ๋ถ๋ฅผ ํ์ธํ๋ ์ฑ
์์ ๋ถ๋ฆฌํ๋ ๊ฒ์ ๋ํด์๋ ์ด๋ป๊ฒ ์๊ฐํ์๋์? |
@@ -0,0 +1,115 @@
+package christmas.controller;
+
+import static christmas.model.constant.DiscountConstant.GIFT_EVENT_THRESHOLD;
+
+import christmas.model.Date;
+import christmas.model.MenuCount;
+import christmas.model.constant.PromotionConstant;
+import christmas.model.strategy.BadgeStrategy;
+import christmas.model... | Java | `๋ ์ง๋ ๋ฉ๋ด๋ฅผ ์ป๋๋ค`๋ณด๋ค `์ ํจํ ๊ฐ์ ์ป์๋๊น์ง ๋ฐ๋ณตํด์ ์
๋ ฅ๋ฐ๋๋ค`๋ผ๋ ์ข ๋ ๋ช
ํํ ์ด๋ฆ์ ์ฌ์ฉํ๋ ๋ถ๋ถ์ ๋ํด์๋ ์ด๋ป๊ฒ ์๊ฐํ์๋์?
e.g.)`retryInputForValidVisitDate`, `returyInputForValidOrders` |
@@ -0,0 +1,70 @@
+package christmas.service;
+
+import static christmas.model.constant.DiscountConstant.MIN_DISCOUNT_SERVICE;
+import static christmas.model.constant.DiscountConstant.NO_DISCOUNT;
+import static christmas.model.constant.PromotionConstant.CHRISTMAS_DISCOUNT;
+import static christmas.model.constant.Promot... | Java | ์ด๋ฒคํธ๊ฐ ์ ๊ท๋ก ๋์
๋๊ฑฐ๋ ์ญ์ ๋๋ ๊ฒฝ์ฐ ์๋น์ค์ ์๋ ๊ณ์ฐ ๊ธฐ๋ฅ์ ์ํฅ์ ์ฃผ๋ ๊ฒ ๊ฐ์ต๋๋ค. ์์กด๋๋ฅผ ๋ฎ์ถ๋ ๊ฒ์ ๋ํด์๋ ์ด๋ป๊ฒ ์๊ฐํ์๋์? |
@@ -0,0 +1,15 @@
+package christmas.model.strategy;
+
+import christmas.model.constant.EventBadge;
+
+public class WootecoBadgeStrategy implements BadgeStrategy {
+ @Override
+ public EventBadge calculateBadgeGrade(int promotionAmount) {
+ for (EventBadge badge : EventBadge.values()){
+ if (prom... | Java | ํ์ฌ๋ EventBadge๊ฐ ๊ธฐ์ค ๊ธ์ก์ด ๋์ ์์๋๋ก ๊ตฌํ๋์ด ์์ง๋ง ๋ง์ผ ๋ค๋ฅธ ์ฌ๋์ด ์์๋ฅผ ๋ฌด์ํ๊ณ ๋ฑ์ง๋ฅผ ์ถ๊ฐํ๋ ๊ฒฝ์ฐ๋ ๊ณ ๋ คํ์๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค. |
@@ -0,0 +1,115 @@
+package christmas.controller;
+
+import static christmas.model.constant.DiscountConstant.GIFT_EVENT_THRESHOLD;
+
+import christmas.model.Date;
+import christmas.model.MenuCount;
+import christmas.model.constant.PromotionConstant;
+import christmas.model.strategy.BadgeStrategy;
+import christmas.model... | Java | ํจ์ํ ์ธํฐํ์ด์ค๋ฅผ ์ ํ์ฉํ์ ๊ฒ ๊ฐ์ต๋๋ค. ์ข์ ์ง์์ ๋ฐฐ์๊ฐ๋๋ค. |
@@ -0,0 +1,115 @@
+package christmas.controller;
+
+import static christmas.model.constant.DiscountConstant.GIFT_EVENT_THRESHOLD;
+
+import christmas.model.Date;
+import christmas.model.MenuCount;
+import christmas.model.constant.PromotionConstant;
+import christmas.model.strategy.BadgeStrategy;
+import christmas.model... | Java | ํ๋ ์ฃผ์
๋ณด๋ค, ์์ฑ์ ์ฃผ์
์ ํ์ฉํด๋ณด๋ฉด ๋ ์ ์ฐํ ์ฝ๋๋ฅผ ์์ฑํ ์ ์์ ๊ฒ ๊ฐ์ต๋๋ค |
@@ -0,0 +1,115 @@
+package christmas.controller;
+
+import static christmas.model.constant.DiscountConstant.GIFT_EVENT_THRESHOLD;
+
+import christmas.model.Date;
+import christmas.model.MenuCount;
+import christmas.model.constant.PromotionConstant;
+import christmas.model.strategy.BadgeStrategy;
+import christmas.model... | Java | ํด๋น ํด๋์ค๊ฐ static์ผ๋ก ์์ฑํ์ ์ด์ ๊ฐ ์์๊น์?
static์ด ์๋์ด๋ ๋ฌธ์ ๊ฐ ์์ ๊ฒ ๊ฐ์ต๋๋ค |
@@ -0,0 +1,29 @@
+package christmas.view;
+
+import camp.nextstep.edu.missionutils.Console;
+import christmas.util.Parser;
+import christmas.validator.MenuValidator;
+
+public class InputView {
+
+ public static void printGreetingMessage() {
+ System.out.println(ViewMessage.GREETING.getMessage());
+ }
+
+
... | Java | static ๋ฉ์๋๋ฐ์ ์๋ ์ ํธ๋ฆฌํฐ ํด๋์ค์ ๊ฒฝ์ฐ, ์ธ์คํด์คํ๊ฐ ํ์ ์๊ธฐ ๋๋ฌธ์ ์์ฑ์๋ฅผ private์ผ๋ก ํ์ฌ ์ธ์คํด์คํ๋ฅผ ๋ง์์ฃผ๋ฉด ๋ ์ข์ ๊ฒ ๊ฐ์ต๋๋ค
https://rules.sonarsource.com/java/RSPEC-1118/ |
@@ -0,0 +1,44 @@
+package christmas.model.constant;
+
+import java.time.DayOfWeek;
+import java.time.LocalDate;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+public enum DateConstant {
+ MIN_DATE(1),
+ MAX_DATE(31),
+ XMAS(25);
+
+ public static final Set<Integer> WEEKDAYS =... | Java | ```suggestion
public static final Set<Integer> SPECIAL_DAYS = Set.of(3, 10, 17, 24, 25, 31);
```
`Set.of` ๋ฅผ ํ์ฉํด์ ๋ ์ฝ๋๋ฅผ ๊ฐ๊ฒฐํ๊ฒ ๋ง๋ค ์ ์์ ๊ฒ ๊ฐ์์. |
@@ -0,0 +1,44 @@
+package christmas.model.constant;
+
+import java.time.DayOfWeek;
+import java.time.LocalDate;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+public enum DateConstant {
+ MIN_DATE(1),
+ MAX_DATE(31),
+ XMAS(25);
+
+ public static final Set<Integer> WEEKDAYS =... | Java | SPECIAL_DAYS๊ฐ public์ผ๋ก ์ด๋ ค์์ผ๋ฉด์ ๋ถ๋ณ์ด ์๋๋ฏ๋ก (HashMap) ์ธ๋ถ์์ ๊ฐ์ ์์ ํ๋ ํดํน์ด ๊ฐ๋ฅํ ๊ฒ์ผ๋ก ๋ณด์
๋๋ค!
์์์
๋๋ค
```java
DateConstant.SPECIAL_DAYS.add(-1);
``` |
@@ -0,0 +1,40 @@
+package christmas.exception;
+
+public class CustomException extends IllegalArgumentException {
+ private static final String MENU_ERROR_MESSAGE = "[ERROR] ์ ํจํ์ง ์์ ์ฃผ๋ฌธ์
๋๋ค. ๋ค์ ์
๋ ฅํด ์ฃผ์ธ์.";
+ private static final String DATE_ERROR_MESSAGE = "[ERROR] ์ ํจํ์ง ์์ ๋ ์ง์
๋๋ค. ๋ค์ ์
๋ ฅํด ์ฃผ์ธ์.";
+ public CustomExce... | Java | ์ปค์คํ
์ต์
์
์ด๋ผ๋ ์ด๋ฆ๋ณด๋ค, ์กฐ๊ธ ๋ ์์ธ์ ์ด์ ๋ฑ์ ์๋ฏธ๊ฐ ๋๋ฌ๋๋ ์ด๋ฆ์ด๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค |
@@ -0,0 +1,56 @@
+package christmas.model.constant;
+
+import java.util.Arrays;
+
+public enum Menu {
+ SOUP("์ ํผํ์ด์ ", "์์ก์ด์ํ", 6000),
+ TAPAS("์ ํผํ์ด์ ", "ํํ์ค", 5500),
+ SALAD("์ ํผํ์ด์ ", "์์ ์๋ฌ๋", 8000),
+ STEAK("๋ฉ์ธ", "ํฐ๋ณธ์คํ
์ดํฌ", 55000),
+ BBQ("๋ฉ์ธ", "๋ฐ๋นํ๋ฆฝ", 54000),
+ SEAFOOD_PASTA("๋ฉ์ธ", "ํด์ฐ๋ฌผํ์คํ", 35000),
+ ... | Java | String ๋ฆฌํฐ๋ด๋ก "๋ฉ์ธ"๊ณผ ๊ฐ์ด ์์ฑํ๋ ๊ฒ๋ณด๋ค ๋ฉ๋ด์ ์นดํ
๊ณ ๋ฆฌ๋ enum์ผ๋ก ๊ด๋ฆฌํ๋ฉด ์กฐ๊ธ ๋ ์ฉ์ดํ์ง ์์๊น์? |
@@ -0,0 +1,52 @@
+package christmas.model;
+
+import static christmas.exception.CustomException.DATE_RANGE_EXCEPTION;
+import static christmas.model.constant.DateConstant.SPECIAL_DAYS;
+import static christmas.model.constant.DateConstant.WEEKDAYS;
+import static christmas.model.constant.DateConstant.WEEKENDS;
+import s... | Java | ์๋ฐ์ ๋นํธ์ธ ๊ฐ์ฒด์ธ [Date](https://docs.oracle.com/javase/8/docs/api/java/util/Date.html)์ ํผ๋์ ์ฌ์ง๊ฐ ์์ ๊ฒ ๊ฐ์ต๋๋ค..!
(์ผ๋จ ์ ํท๊ฐ๋ ธ์ด์ ๐ญ) |
@@ -0,0 +1,22 @@
+package christmas.model.constant;
+
+public enum PromotionConstant {
+
+ CHRISTMAS_DISCOUNT("ํฌ๋ฆฌ์ค๋ง์ค ๋๋ฐ์ด ํ ์ธ"),
+ WEEKDAY_DISCOUNT("ํ์ผ ํ ์ธ"),
+ WEEKEND_DISCOUNT("์ฃผ๋ง ํ ์ธ"),
+ SPECIAL_DISCOUNT("ํน๋ณ ํ ์ธ"),
+ GIFT_EVENT("์ฆ์ ์ด๋ฒคํธ");
+
+ private String name;
+
+ PromotionConstant(String name) {... | Java | private final๋ก ๋ง๋ค ์ ์์ ๊ฒ ๊ฐ์์ |
@@ -0,0 +1,75 @@
+package christmas.model.strategy;
+
+import static christmas.model.constant.DiscountConstant.CHRISTMAS_START_DISCOUNT;
+import static christmas.model.constant.DiscountConstant.DISCOUNT_INCREMENT;
+import static christmas.model.constant.DiscountConstant.FIXED_DISCOUNT;
+import static christmas.model.co... | Java | ์ฌ๋ฌ ํ ์ธ ์ ๋ต์ ํ ํด๋์ค์ ๋ชฐ์๋ฃ๊ธฐ๋ณด๋ค๋ ๊ฐ๊ฐ ํด๋์ค๋ก ๋ถ๋ฅํ ์ ์์ ๊ฒ ๊ฐ์์
+ ๊ทธ๋ฆฌ๊ณ ๊ทธ๋ ๊ฒ ๋๋์ด์, ์ฐํ
์ฝ ํ ์ธ ์ ๋ต์ด๋ผ๋ ์ด๋ฆ๋ณด๋ค๋ ๋ฌด์จ ํ ์ธ ์ ๋ต์ธ์ง์ ๋ํ ์๋ฏธ๊ฐ ๋๋ฌ๋๋ ์ด๋ฆ์ด๋ฉด ์ข์ ๊ฒ ๊ฐ์์ |
@@ -0,0 +1,75 @@
+package christmas.model.strategy;
+
+import static christmas.model.constant.DiscountConstant.CHRISTMAS_START_DISCOUNT;
+import static christmas.model.constant.DiscountConstant.DISCOUNT_INCREMENT;
+import static christmas.model.constant.DiscountConstant.FIXED_DISCOUNT;
+import static christmas.model.co... | Java | ํฌ๋ฆฌ์ค๋ง์ค ํ ์ธ ์ ๋ต์์ ๋ณ๋์ด ์๊ธฐ๊ฒ ๋๋ค๋ฉด (์: ์์ํ ์ธ์ก์ด 1000์์์ 2000์์ผ๋ก ๋ณ๊ฒฝ), ํด๋น ๋ณ๊ฒฝ์ฌํญ์ ๋ํ ์ฌํ๊ฐ ํ ์ธ ์ ๋ต๋ง ์ฌํ๋ฅผ ๋ฏธ์ณ์ผ ํ ๊ฒ ๊ฐ์๋ฐ enum์ธ DiscountConstant์ ์ํฅ์ ๋ฏธ์น๊ฒ ๋ผ์.
๋ง์ฐฌ๊ฐ์ง๋ก ์ฃผ๋ง ํ ์ธ ์ ๋ต์๋ ๋ณ๋์ด ์๊ธด๋ค๋ฉด DiscountConstant์ด ๋ฐ๋์ด์ผ ํ๋๋ฐ, ์ด๋ `ํด๋์ค๊ฐ ๋ณ๊ฒฝ๋ ์ด์ ๋ ํ ๊ฐ์ง์ฌ์ผ ํ๋ค`๋ผ๋ SRP์์น์ ์๋ฐํ๋ ๊ฒ ๊ฐ์์ |
@@ -0,0 +1,75 @@
+package christmas.model.strategy;
+
+import static christmas.model.constant.DiscountConstant.CHRISTMAS_START_DISCOUNT;
+import static christmas.model.constant.DiscountConstant.DISCOUNT_INCREMENT;
+import static christmas.model.constant.DiscountConstant.FIXED_DISCOUNT;
+import static christmas.model.co... | Java | ๊ทธ๋ฐ ์ด์ ์์, CHRISTMAS_START_DISCOUNT๋ enum์ผ๋ก publicํ๊ฒ ์๋ฌด ํด๋์ค์์๋ ๊ณต๊ฐ๋ ํ์๊ฐ ์์ด, ํด๋น ํ ์ธ ์ ์ฑ
ํด๋์ค์์ `private static final`๊ณผ ๊ฐ์ด ๊ด๋ฆฌํ๋ฉด ๋ ์ข์ ๊ฒ ๊ฐ์์
(ํ ์ธ ์ ์ฑ
์ด ๋ฐ๋๋๋ผ๋ ํ ์ธ ์ ์ฑ
ํด๋์ค๋ง ์ํฅ์ ๋ฐ๊ฒ ๋๊ฒ ์ฃ ) |
@@ -0,0 +1,70 @@
+package christmas.service;
+
+import static christmas.model.constant.DiscountConstant.MIN_DISCOUNT_SERVICE;
+import static christmas.model.constant.DiscountConstant.NO_DISCOUNT;
+import static christmas.model.constant.PromotionConstant.CHRISTMAS_DISCOUNT;
+import static christmas.model.constant.Promot... | Java | early return์ ์ฌ์ฉํ๋ฉด ์กฐ๊ธ ๋ ์ฝ๋๊ฐ ๊น๋ํด์ง ๊ฒ ๊ฐ์์
```java
if(!canGetDiscount(menuCount) {
return Collections.EMPTY_MAP;
}
EnumMap<PromotionConstant, Integer> promotionStatus = new EnumMap<>(PromotionConstant.class);
promotionStatus.put(CHRISTMAS_DISCOUNT, discountStrategy.christmasDiscount(date));
promotionStatus.put... |
@@ -0,0 +1,52 @@
+package christmas.model;
+
+import static christmas.exception.CustomException.DATE_RANGE_EXCEPTION;
+import static christmas.model.constant.DateConstant.SPECIAL_DAYS;
+import static christmas.model.constant.DateConstant.WEEKDAYS;
+import static christmas.model.constant.DateConstant.WEEKENDS;
+import s... | Java | ์ฃผ๋ง์ธ์ง ํ์ผ์ธ์ง๋ฅผ ์ฒดํฌํ๋ ๋ก์ง์ `DateConstant`์ ๋ชฐ๊ธฐ๋ณด๋ค, Date ํด๋์ค์์ ์ฒ๋ฆฌํ๋ฉด ์ด๋จ๊น์?
์์ ํด๋์ค์ ๋ก์ง์ด ๋ค์ด์๋ ๊ฒ์ ์ด์ํ ๊ฒ ๊ฐ๋ค๋ ์๊ฐ์ด ๋ค์ด์ |
@@ -0,0 +1,44 @@
+package christmas.model.constant;
+
+import java.time.DayOfWeek;
+import java.time.LocalDate;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+public enum DateConstant {
+ MIN_DATE(1),
+ MAX_DATE(31),
+ XMAS(25);
+
+ public static final Set<Integer> WEEKDAYS =... | Java | ๋ฆฌํฐ๋ด ๊ฐ๋ ์ปจ๋ฒค์
์ ๋ง๊ฒ ์์ ์ฒ๋ฆฌ๋ฅผ ํ๋ฉด ๋ ๊ฒ ๊ฐ์ต๋๋ค |
@@ -0,0 +1,56 @@
+package christmas.model.constant;
+
+import java.util.Arrays;
+
+public enum Menu {
+ SOUP("์ ํผํ์ด์ ", "์์ก์ด์ํ", 6000),
+ TAPAS("์ ํผํ์ด์ ", "ํํ์ค", 5500),
+ SALAD("์ ํผํ์ด์ ", "์์ ์๋ฌ๋", 8000),
+ STEAK("๋ฉ์ธ", "ํฐ๋ณธ์คํ
์ดํฌ", 55000),
+ BBQ("๋ฉ์ธ", "๋ฐ๋นํ๋ฆฝ", 54000),
+ SEAFOOD_PASTA("๋ฉ์ธ", "ํด์ฐ๋ฌผํ์คํ", 35000),
+ ... | Java | ์์์ ์ข
๋ฅ๋ Enum์ผ๋ก ์ฒ๋ฆฌํ๋ฉด ํน์ ๋ฉ๋ด ์ข
๋ฅ์ ํด๋น๋๋ ์์์ธ์ง ํ์ธํ๋ ๋ก์ง์ ์งค ๋ ๋์์ด ๋ ์ ์์ ๊ฒ ๊ฐ์์:) |
@@ -0,0 +1,52 @@
+package christmas.model;
+
+import static christmas.exception.CustomException.DATE_RANGE_EXCEPTION;
+import static christmas.model.constant.DateConstant.SPECIAL_DAYS;
+import static christmas.model.constant.DateConstant.WEEKDAYS;
+import static christmas.model.constant.DateConstant.WEEKENDS;
+import s... | Java | ๋นํธ์ธ ๊ฐ์ฒด Date์ ํผ๋๋ ์ ์์ด์ ๋ค๋ฅธ ๋ค์ด๋ฐ์ ๋ฐ์ํ๋๊ฒ๋ ์ข์ ๊ฒ ๊ฐ์์ |
@@ -21,7 +21,9 @@
<body>
<div class="create-account">
<h1 class="heading xl3">Create <br />Account</h1>
- <input type="file" id="file_1" class="a11y-hidden" ><label for="file_1" class="input-file"></label>
+ <div class="file-wrapper">
+ <input type="file" id="file_1" class="a11y-hidden" ><label for=... | Unknown | ๊ฐ์ธ์ฐจ๊ฐ ์๊ฒ ์ง๋ง, ์ ๊ฐ์ธ์ ์ผ๋ก ์ด๋ฒคํธ๋ js์์ ๋ชจ๋ ์ฒ๋ฆฌํ๋ํธ์
๋๋ค..
react๋ฉด ์ปดํผ๋ํธ๋ก ๊ด๋ฆฌ๋๊ธฐ๋๋ฌธ์ ๋ฌด๊ดํ์ง๋ง.. html์์ ๋์ค์ ๋ชจ๋ ํ์ด์ง ์ฐพ์๊ฐ๋ฉด์ ํด๋น ํจ์๋ฅผ ์ ๊ฑฐ ๋๋ ์ถ๊ฐํด์ผ๋ ๊ฒฝ์ฐ๊ฐ ์๊ฑฐ๋ ์. |
@@ -21,7 +21,9 @@
<body>
<div class="create-account">
<h1 class="heading xl3">Create <br />Account</h1>
- <input type="file" id="file_1" class="a11y-hidden" ><label for="file_1" class="input-file"></label>
+ <div class="file-wrapper">
+ <input type="file" id="file_1" class="a11y-hidden" ><label for=... | Unknown | ๋ชจ๋ ์จ๋ผ์ธ์์์๋ title๋๋ label์ด ์์ด์ผ ํฉ๋๋ค. |
@@ -21,7 +21,9 @@
<body>
<div class="create-account">
<h1 class="heading xl3">Create <br />Account</h1>
- <input type="file" id="file_1" class="a11y-hidden" ><label for="file_1" class="input-file"></label>
+ <div class="file-wrapper">
+ <input type="file" id="file_1" class="a11y-hidden" ><label for=... | Unknown | ์คํฌ๋ฆฝํธ๋ ์ธ๋ถํ์ผ๋ก..
alert๋ณด๋จ dialog๋ฅผ ์ด์ฉํด์ ๊ฒฝ๊ณ ์ฐฝ์ ๊พธ๋ฉฐ๋ณด๋๊ฒ๋ ๋์๋ฉ๋๋ค.
๊ธฐ๋ฅ๋ณ๋ก ํจ์๋ก ๊ตฌํํ์
์ moduleํ ํ๋ก๊ทธ๋๋ฐ์ ์๋ํด๋ณด์ธ์~ |
@@ -1,7 +1,73 @@
package com.ll.nbe342team8.domain.book.book.controller;
-import org.springframework.web.bind.annotation.RestController;
+import com.ll.nbe342team8.domain.book.book.dto.BookPatchRequestDto;
+import com.ll.nbe342team8.domain.book.book.dto.BookResponseDto;
+import com.ll.nbe342team8.domain.book.book.en... | Java | - ์ ๋ฐ์ ์ผ๋ก ์
๋ ฅ ๋ฐ๋ Parameter์ ๋ํ ๊ฒ์ฆ์ด ์๋ค์. (์๋ฅผ ๋ค์ด, getAllBooks์ pageSize ๊ฐ์ผ๋ก -100์ ๋๊ธฐ๋ฉด ์ด๋ป๊ฒ ๋ ๊น์?) |
@@ -1,7 +1,73 @@
package com.ll.nbe342team8.domain.book.book.controller;
-import org.springframework.web.bind.annotation.RestController;
+import com.ll.nbe342team8.domain.book.book.dto.BookPatchRequestDto;
+import com.ll.nbe342team8.domain.book.book.dto.BookResponseDto;
+import com.ll.nbe342team8.domain.book.book.en... | Java | ์๋ง ์บ๋ฉ์ผ์ด์ค๋ฅผ ์ ์ฐ๋ ์ด์ ๊ฐ ์์๊น์?
์ด๊ฑฐ ๋๋ฌธ์ `@PathVariable` ์ด๋
ธํ
์ด์
๋ค์ ๋ถํ์ํ ์์ฑ๊ฐ์ด ๊ฐ์ด ๋ถ์ด๋ฒ๋ ธ๋ค์. |
@@ -1,7 +1,73 @@
package com.ll.nbe342team8.domain.book.book.controller;
-import org.springframework.web.bind.annotation.RestController;
+import com.ll.nbe342team8.domain.book.book.dto.BookPatchRequestDto;
+import com.ll.nbe342team8.domain.book.book.dto.BookResponseDto;
+import com.ll.nbe342team8.domain.book.book.en... | Java | ๊ทธ๋ฅ required=false ์ต์
์ ๋นผ๋ฉด ๊ตณ์ด ๋ถ๊ธฐ์ฒ๋ฆฌ๋ฅผ ์ํด๋ ๋์ง ์์๊น์? |
@@ -1,7 +1,73 @@
package com.ll.nbe342team8.domain.book.book.controller;
-import org.springframework.web.bind.annotation.RestController;
+import com.ll.nbe342team8.domain.book.book.dto.BookPatchRequestDto;
+import com.ll.nbe342team8.domain.book.book.dto.BookResponseDto;
+import com.ll.nbe342team8.domain.book.book.en... | Java | ์ ๋ฉ์๋์์๋ `long` ์ ์ฐ๊ณ , ์ฌ๊ธฐ์๋ `Long` ์ ์ฐ๋๋ฐ ํน์ ๋์ ๊ตฌ๋ถํ๋ ๋ด๋ถ์ ์ธ ์ปจ๋ฒค์
์ด ์กด์ฌํ๋๊ฑธ๊น์? |
@@ -0,0 +1,50 @@
+package com.ll.nbe342team8.domain.book.book.dto;
+
+import com.ll.nbe342team8.domain.book.category.entity.Category;
+import jakarta.validation.constraints.AssertTrue;
+import jakarta.validation.constraints.DecimalMin;
+import jakarta.validation.constraints.Min;
+import jakarta.validation.constraints.P... | Java | - Controller ์์ `@Valid` ๋ฅผ ์ ์ฐ๊ณ ์์ด์, Validation ์ด ์ํ๋์ง ์์ ๊ฒ์ผ๋ก ๋ณด์ฌ์.
- Dto๋ ๊ฐ๋ณ์ผ ํ์๊ฐ ์๊ณ , (์๋ง ์ด ํ
์คํธ๋ฅผ ๋ณด๊ณ ์ ๊ฐ ๋งํ๊ฒ ์ง๋ง) ๋ชจ๋ ์๋ฐ๋ก ๋์ด๊ฐ๋ฉด์ ๋ฐ์ดํฐ์ ๋ถ๋ณ์ฑ์ด ์์ฃผ ์ค์ํ ์ด์๋ก ๋ ์ค๋ฅธ ์ํฉ์ด์์.`@Data` ๋์ , Record๋ก ๋์ฒดํด ์ฃผ์ธ์. |
@@ -0,0 +1,50 @@
+package com.ll.nbe342team8.domain.book.book.dto;
+
+import com.ll.nbe342team8.domain.book.category.entity.Category;
+import jakarta.validation.constraints.AssertTrue;
+import jakarta.validation.constraints.DecimalMin;
+import jakarta.validation.constraints.Min;
+import jakarta.validation.constraints.P... | Java | Float์ ์ ํ๋ ๋ฌธ์ ๋ก ๊ถ์ฅ๋์ง ์์ต๋๋ค. Double๋ก ๋์ฒดํด ์ฃผ์ธ์. |
@@ -0,0 +1,50 @@
+package com.ll.nbe342team8.domain.book.book.dto;
+
+import com.ll.nbe342team8.domain.book.category.entity.Category;
+import jakarta.validation.constraints.AssertTrue;
+import jakarta.validation.constraints.DecimalMin;
+import jakarta.validation.constraints.Min;
+import jakarta.validation.constraints.P... | Java | status๋ฅผ ์ซ์๊ฐ ์๋ Enum ์ผ๋ก ๊ด๋ฆฌํ ์ ์์๊น์? |
@@ -0,0 +1,56 @@
+package com.ll.nbe342team8.domain.book.book.dto;
+
+import com.ll.nbe342team8.domain.book.book.entity.Book;
+import com.ll.nbe342team8.domain.book.category.entity.Category;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.... | Java | ์ด๋ค ๊ณณ์์๋ record๋ฅผ ์ฐ๊ณ , ์ด๋ค ๊ณณ์์๋ @Data ๋ฅผ ์ฐ๋๊ฑธ ๋ณด๋, ํ ๋ด ์ปจ๋ฒค์
์ด ์ ํํ๊ฒ ํ์ ๋์ง ์์ ๊ฒ ๊ฐ์์. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.