code stringlengths 41 34.3k | lang stringclasses 8
values | review stringlengths 1 4.74k |
|---|---|---|
@@ -0,0 +1,56 @@
+package store.domain;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import store.domain.exception.ProductErrorCode;
+import store.domain.exception.ProductException;
+
+public class BuyProducts {
+
+ private... | Java | ๋จ์ํ getProductsํ contains๋ฅผ ์ง์ ์ ์ผ๋ก ํ๊ธฐ๋ณด๋จ Products์ public ๋ฉ์๋๋ฅผ ๋ฐ๋ก ๋๋ ๊ฒ์ ์ด๋ค๊ฐ์? |
@@ -0,0 +1,79 @@
+package store.domain;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map.Entry;
+import store.domain.vo.MemberShip;
+import store.domain.vo.ProductQuantity;
+import store.view.dto.response.BuyProductResponse;
+import store.view.dto.response.Free... | Java | ์ํธ๋ฆฌ๋ฅผ ์ง์ ์ ์ผ๋ก ์ฌ์ฉํ๋ ๊ฒฝ์ฐ ์ฝ๋์ ๊ฐ๋
์ฑ์ด ๋จ์ด์ง๋ค๊ณ ์๊ฐํฉ๋๋ค. getKey(), getValue()๊ณผ ๊ฐ์ด ํค์ ๊ฐ์ผ๋ก ๋ํ๋ด๋ ๋ฉ์๋๋ ์ฝ๋๋ฅผ ์ฝ๋ ์ฌ๋์๊ฒ key๋ ๋ฌด์์ด์ง๋ถํฐ ์์ํ๊ฒ ๋์ด ๋ฐ๋ก ๋ง๋๋๊ฒ ์ข์๊ฒ๊ฐ์ต๋๋ค |
@@ -0,0 +1,169 @@
+# 1. ํต์ฌ ํ ์ค ์ ์
+
+์ฌ์ฉ์์ ์ฅ๋ฐ๊ตฌ๋ ์ํ ๋ชฉ๋ก ๋ฐ ์์ ๊ฒฐ์ ๊ธ์ก์ ํ์ธํ๊ณ , ๊ฒฐ์ ๋จ๊ณ๋ก ์ ํํ๋ค.
+
+# 2. ์ฌ์ฉ์ ๊ด์ ์์ ๊ธฐ๋ฅ ๋ฆฌ์คํ
(์ธ๋ถ ๊ธฐ๋ฅ ์ ์)
+
+- [ ] CartItem
+ - [ ] ์ฅ๋ฐ๊ตฌ๋ ์ํ ์ ๋ณด๋ฅผ ๋ณด์ฌ์ค๋ค
+ - [ ] ์ฅ๋ฐ๊ตฌ๋ ์ํ์ ์ ํ/ํด์ ํ๋ค.
+ - [ ] ์ฅ๋ฐ๊ตฌ๋ ์ํ์ ์ ๊ฑฐํ๋ค.
+ - [ ] ์ฅ๋ฐ๊ตฌ๋ ์ํ ์๋์ ๋ณ๊ฒฝํ๋ค.
+- [ ] CartItemList
+ - [ ] ์ฅ๋ฐ๊ตฌ๋ ์ํ ๋ชฉ๋ก์ ๋ณด์ฌ์ค๋ค.
+ - [ ] ์ ์ฒด ์ ํ
+- [ ] CartAmount... | Unknown | ํน์ ์ฒดํฌ๋ฆฌ์คํธ๋ ์ผ๋ถ๋ฌ ์ฒดํฌ ์ํ์ ๊ฑธ๊น์?! ๐ซ |
@@ -0,0 +1,10 @@
+์ผ๊ด์ฑ์ ์ ์งํ๊ธฐ ์ํ ๊ท์น
+
+### recoil
+
+1. ๋ฆฌ๋ ๋๋ฅผ ์ด๋ฐํ๋ ๋ฐ์ดํฐ์ ํด๋นํ๋ ๊ฒฝ์ฐ ์ด๋ฆ์ State๋ฅผ ๋ถ์ธ๋ค.
+ 1. atom์ ๋ฌด์กฐ๊ฑด State๋ฅผ ๋ถ์ธ๋ค.
+ 2. selector๋ ๋ด๋ถ์ ์ผ๋ก ํ๋ ์ด์์ atom์ ์ด์ฉํ๋ ๊ฒฝ์ฐ State๋ฅผ ๋ถ์ธ๋ค.
+2. selector์ ์ฉ๋๋ ์ธ ๊ฐ์ง์ด๋ค.
+ 1. atom ํ์ ์ํ
+ 2. ๋น๋๊ธฐ ๋ฐ์ดํฐ ํจ์นญ | Unknown | ๊ท์น๊น์ง ๋ํ
์ผ.. ๐ |
@@ -1,10 +1,24 @@
import "./App.css";
+import { RecoilRoot } from "recoil";
+import { BrowserRouter, Route, Routes } from "react-router-dom";
+
+import CartPage from "./pages/CartPage";
+import { PATH } from "./constants/path";
+import OrderSummaryPage from "./pages/OrderSummaryPage";
+import { ErrorBoundary } from "r... | Unknown | [crerateBrowserRouter](https://reactrouter.com/en/main/routers/create-browser-router)๋ ์ถํ์ ํ ๋ฒ ์จ๋ณด์๋๊ฑฐ ์ถ์ฒ๋๋ฆฝ๋๋ค :) ๐ซ |
@@ -0,0 +1,31 @@
+import styled from "styled-components";
+
+export interface IButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
+ disabled?: boolean;
+}
+
+export default function Button({ children, ...attributes }: IButtonProps) {
+ return <S.Button {...attributes}>{children}</S.Button>;
+}
+
+const S =... | Unknown | ์คํ์ผ์ ์ํ ๋ฒํผ ์ปดํฌ๋ํธ๋ก ํ์ธ๋๋๋ฐ, ์ด๋ฅผ ํด๋๋ก ๊ตฌ์กฐํ์ํค๋ฉด ๋ฒํผ์ ์ญํ ์ ํ์
ํ๋๋ฐ ๋์ฑ ์ข์ ๊ฒ ๊ฐ์์! ๐ซ |
@@ -0,0 +1,91 @@
+import { useRecoilValue } from "recoil";
+import styled from "styled-components";
+import { deliveryCostState, orderAmountState, totalOrderAmountState } from "../recoil/cartAmount";
+import { ReactComponent as InfoIcon } from "../assets/info-icon.svg";
+
+export interface ICartAmountProps {}
+
+export... | Unknown | ์ฌ์ฉ๋์ง ์๋ Props์ธ๊ฐ์?! ๐ |
@@ -0,0 +1,82 @@
+import { useSetRecoilState } from "recoil";
+import CartItemView from "./CartItemView";
+import styled from "styled-components";
+import { selectedCartItemIdsState } from "../recoil/selectedCartItemIds";
+import { CartItem } from "../types/cartItems";
+import { useCartItemControl } from "../hooks/useC... | Unknown | (๋จ์ ๊ถ๊ธ) cartItem.id๊ฐ ์๋๋ผ product.id๋ก ์ค์ ํด์ฃผ์ ์ด์ ๊ฐ ์์๊น์? |
@@ -0,0 +1,145 @@
+import { CartItem } from "../types/cartItems";
+import styled from "styled-components";
+import { UseCartItemsReturn } from "../hooks/useCartItemControl";
+
+export interface CartItemViewProps {
+ cartItem: CartItem;
+ cartItemControl: UseCartItemsReturn;
+}
+
+export default function CartItemView(... | Unknown | ์ฌ๊ธฐ์ Return interface๋ฅผ ๋ณ๋๋ก export ํด์ค๋ ์ข์ง๋ง,
[ReturnType](https://www.typescriptlang.org/ko/docs/handbook/utility-types.html#returntypetype)์ด๋ผ๋ ์ ํธํจ์๋ ์ฌ์ฉํด๋ณด์๋ฉด ์ข์ ๊ฒ ๊ฐ์์!
์ด๋ ๊ฒ ์ฌ์ฉํ๋ฉด ๋ณ๋์ interface๋ฅผ ๋ง๋ค ํ์ ์์ง ์์๊น ์๊ฐํฉ๋๋ค! :) |
@@ -0,0 +1,91 @@
+import { RecoilRoot, useRecoilState } from "recoil";
+
+import { act } from "react";
+import { renderHook } from "@testing-library/react";
+import { updateCartItemQuantity } from "../api/cartItems";
+import { useCartItemControl } from "./useCartItemControl";
+
+jest.mock("recoil", () => ({
+ ...jest.... | TypeScript | ์ฌ๊ธฐ ์ฃผ์์ ์ผ๋ถ๋ฌ ๋จ๊ฒจ๋์ ๊ฑธ๊น์?! ๐ซ |
@@ -0,0 +1,91 @@
+import { RecoilRoot, useRecoilState } from "recoil";
+
+import { act } from "react";
+import { renderHook } from "@testing-library/react";
+import { updateCartItemQuantity } from "../api/cartItems";
+import { useCartItemControl } from "./useCartItemControl";
+
+jest.mock("recoil", () => ({
+ ...jest.... | TypeScript | ๋ช
์ธ๊ฐ ์กฐ๊ธ ๋ ๋ช
ํํ์ผ๋ฉด ์ข๊ฒ ์ด์!
์ด๋ค patch api๋ฅผ ์์ฒญํ๊ณ ์ด๋ป๊ฒ ์ํ๊ฐ ๋ณ๊ฒฝ๋์๋์ง ๊ตฌ์ฒด์ ์ผ๋ก ๋ช
์ํ๋ฉด ๋ ์ข์ ๋ช
์ธ๊ฐ ๋ ๋ฏ ํฉ๋๋ค :) |
@@ -0,0 +1,22 @@
+import Header from "../components/Header";
+import styled from "styled-components";
+import CartContent from "../components/CartContent";
+import { Suspense } from "react";
+
+export default function CartPage() {
+ return (
+ <S.Container>
+ <Header hasBackButton={false} title="SHOP" />
+ ... | Unknown | Suspense ๊ตฌํํ์
จ๋ค์..! ๐
์ถ๊ฐ์ ์ผ๋ก ์ด๋ฏธ์ง๊ฐ ๋ก๋ฉ์ํ์ผ ๋, ํ๋ฉด์ด ์ ํ๋ค์..! ์คํ์ผ๋ ์ถ๊ฐ์ ์ผ๋ก ์ ์ฉํ๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค!
 |
@@ -0,0 +1,169 @@
+# 1. ํต์ฌ ํ ์ค ์ ์
+
+์ฌ์ฉ์์ ์ฅ๋ฐ๊ตฌ๋ ์ํ ๋ชฉ๋ก ๋ฐ ์์ ๊ฒฐ์ ๊ธ์ก์ ํ์ธํ๊ณ , ๊ฒฐ์ ๋จ๊ณ๋ก ์ ํํ๋ค.
+
+# 2. ์ฌ์ฉ์ ๊ด์ ์์ ๊ธฐ๋ฅ ๋ฆฌ์คํ
(์ธ๋ถ ๊ธฐ๋ฅ ์ ์)
+
+- [ ] CartItem
+ - [ ] ์ฅ๋ฐ๊ตฌ๋ ์ํ ์ ๋ณด๋ฅผ ๋ณด์ฌ์ค๋ค
+ - [ ] ์ฅ๋ฐ๊ตฌ๋ ์ํ์ ์ ํ/ํด์ ํ๋ค.
+ - [ ] ์ฅ๋ฐ๊ตฌ๋ ์ํ์ ์ ๊ฑฐํ๋ค.
+ - [ ] ์ฅ๋ฐ๊ตฌ๋ ์ํ ์๋์ ๋ณ๊ฒฝํ๋ค.
+- [ ] CartItemList
+ - [ ] ์ฅ๋ฐ๊ตฌ๋ ์ํ ๋ชฉ๋ก์ ๋ณด์ฌ์ค๋ค.
+ - [ ] ์ ์ฒด ์ ํ
+- [ ] CartAmount... | Unknown | ์๋๋๋ค...ใ
์ฒดํฌ๋ฆฌ์คํธ๋ฅผ ๋ชฉ๋ก์ฒ๋ผ ์ฌ์ฉํ๋ค์. ๋ช
๋ฐฑํ ๋๋ฝ์
๋๋คใ
ใ
ใ
|
@@ -1,10 +1,24 @@
import "./App.css";
+import { RecoilRoot } from "recoil";
+import { BrowserRouter, Route, Routes } from "react-router-dom";
+
+import CartPage from "./pages/CartPage";
+import { PATH } from "./constants/path";
+import OrderSummaryPage from "./pages/OrderSummaryPage";
+import { ErrorBoundary } from "r... | Unknown | BrowserRouter์ ๋น๊ตํด์ ๋ํ์ ์ธ ์ฐจ์ด๊ฐ ์ด๋ค ๊ฒ ์์๊น์???
๋ค์์ ํ ๋ฒ ์๋ํด ๋ณด๋๋ก ํด๋ณด๊ฒ ์ต๋๋ค! |
@@ -0,0 +1,31 @@
+import styled from "styled-components";
+
+export interface IButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
+ disabled?: boolean;
+}
+
+export default function Button({ children, ...attributes }: IButtonProps) {
+ return <S.Button {...attributes}>{children}</S.Button>;
+}
+
+const S =... | Unknown | ์ค... ๋๋ฌด ์ข์ ๊ฒ ๊ฐ๋ค์!!
ํน์ ํด๋๋ค์ด๋ฐ์ ๋ํ ์๊ฒฌ๋ ์์ผ์ค๊น์~? `components/styled` ..? |
@@ -0,0 +1,91 @@
+import { useRecoilValue } from "recoil";
+import styled from "styled-components";
+import { deliveryCostState, orderAmountState, totalOrderAmountState } from "../recoil/cartAmount";
+import { ReactComponent as InfoIcon } from "../assets/info-icon.svg";
+
+export interface ICartAmountProps {}
+
+export... | Unknown | ์ฒ์์ ๊ตฌ์กฐ๋ฅผ ์๋ ์์ฑํด์ฃผ๋ ๋ฌด์จ ๋จ์ถ ๋ช
๋ น์ด๊ฐ ์์๋๋ฐ, ๊ฑ๊ฐ ๋ง๋ค์ด์คฌ๊ณ ๊ทธ๊ฑธ ์ง์ฐ์ง ์์์ต๋๋ค... ๋ค๋ฅธ ๋ง์ ์ปดํฌ๋ํธ๊ฐ ๊ทธ๋ ๋ค์...ใ
|
@@ -0,0 +1,82 @@
+import { useSetRecoilState } from "recoil";
+import CartItemView from "./CartItemView";
+import styled from "styled-components";
+import { selectedCartItemIdsState } from "../recoil/selectedCartItemIds";
+import { CartItem } from "../types/cartItems";
+import { useCartItemControl } from "../hooks/useC... | Unknown | ์..ใ
ใ
ใ
ใ
ใ
ใ
ใ
ใ
ใ
ใ
ใ
ใ
์์ต๋๋ค.
์๊ฐ ์๋ฌ ๋ฐ ๊ฑฐ๋ผ ์๊ฐํ๊ณ ์์ฐํ๋ค์. ํ์ง๋ง, `cartItem.id`๊ฐ ๋ง๋ ํํ์ด๊ณ , ์ค์๋ก `product.id`๋ก ํ ๊ฒ ๊ฐ์ต๋๋ค. |
@@ -0,0 +1,145 @@
+import { CartItem } from "../types/cartItems";
+import styled from "styled-components";
+import { UseCartItemsReturn } from "../hooks/useCartItemControl";
+
+export interface CartItemViewProps {
+ cartItem: CartItem;
+ cartItemControl: UseCartItemsReturn;
+}
+
+export default function CartItemView(... | Unknown | ~~์ผ์... ์ด๋ค ์์ผ๋ก ์จ์ผ ์ข์์ง ๊ฐ์ด ์ค์ง ์๋ค์... ํธ์ฅ์ ์งค๋งํ ์์๋ฅผ ๋ค์ด์ฃผ์ค ์ ์์ผ์ค๊น์?~~
์คํธ~ ์ข๋ค์. ๊ฟ ํ ๊ฐ์ฌํฉ๋๋ค. ํ ๊ฐ์ง ์ด์ผ๊ธฐ ๋๋ ๋ณด๊ณ ์ถ์ ๋ถ๋ถ์ด ์์ต๋๋ค!
์ด๋ค ํจ์๋ฅผ ๋ง๋ค ๋ ์ธํฐํ์ด์ค๋ฅผ ๋ง๋ค์ด๋๋ฉด ๊ตฌ์กฐ๊ฐ ๋จธ๋ฆฌ์ ์ ๋ค์ด์ค๋ ๊ฒ ๊ฐ๋ค๊ณ ์๊ฐํด์. ์ด๋ฐ ์ธก๋ฉด์์ ๋ฐํ ํ์
์ ๋ณ๋๋ก ๋ง๋๋ ๊ฒ ์ข๋ค๊ณ ์๊ฐ์ ํ๋๋ฐ, ๋ํ์ ์๊ฒฌ์ ๋ค์ด๋ณด๊ณ ์ถ๋ค์!! |
@@ -0,0 +1,91 @@
+import { RecoilRoot, useRecoilState } from "recoil";
+
+import { act } from "react";
+import { renderHook } from "@testing-library/react";
+import { updateCartItemQuantity } from "../api/cartItems";
+import { useCartItemControl } from "./useCartItemControl";
+
+jest.mock("recoil", () => ({
+ ...jest.... | TypeScript | ํ
์คํธ ์ฝ๋ ์์ฑ ์ค ํฌ๊ธฐํ ์ฝ๋์
๋๋ค! ๋ชจํนํ setSelectedCartItemIds์ ๋ด๋ถ callback์์ ๋ฌธ์ ๊ฐ ๋ฐ์ํ๊ณ ์๋๋ฐ, ํด๊ฒฐ์ ๋ชปํด์ ์ฃผ์์ผ๋ก ์ฒ๋ฆฌํ์ด์. ์์ฌ์์ ์ง์ฐ์ง ์๊ณ ๋
๋์ต๋๋ค... |
@@ -0,0 +1,22 @@
+import Header from "../components/Header";
+import styled from "styled-components";
+import CartContent from "../components/CartContent";
+import { Suspense } from "react";
+
+export default function CartPage() {
+ return (
+ <S.Container>
+ <Header hasBackButton={false} title="SHOP" />
+ ... | Unknown | ์ ํํ ๊ฐ์ ๋ถ๋ถ์ ํผํฐ์๊ฒ ์ฝ๋ฉํธ๋ฅผ ๋ฐ์์ด์! ๋ํ ๋ ์นด๋ก์์ด ๊ฑฐ์ ๋ญ ํ์ง์๋ฐ์? ๐
"์ ์ฒด ๋ ์ด์์์ด ์ ์ง๋๋๋ก ์คํ์ผ๋ง์ ํด์ฃผ๋ฉด, CLS(Cumulative Layout Shift)๋ฅผ ๋ฐฉ์งํ ์ ์์ ๊ฒ"์ด๋ผ๋ ํผํฐ์ ์ฝ๋ฉํธ๋ฅผ ๊ณต์ ํด๋๋ฆฝ๋๋ค! |
@@ -0,0 +1,31 @@
+import styled from "styled-components";
+
+export interface IButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
+ disabled?: boolean;
+}
+
+export default function Button({ children, ...attributes }: IButtonProps) {
+ return <S.Button {...attributes}>{children}</S.Button>;
+}
+
+const S =... | Unknown | ps. ์ ๋ ๊ฐ์ธ์ ์ผ๋ก `common` ์ด๋ผ๋ ํด๋๋ฅผ ์ฌ์ฉํฉ๋๋ค...! |
@@ -0,0 +1,91 @@
+import { useRecoilValue } from "recoil";
+import styled from "styled-components";
+import { deliveryCostState, orderAmountState, totalOrderAmountState } from "../recoil/cartAmount";
+import { ReactComponent as InfoIcon } from "../assets/info-icon.svg";
+
+export interface ICartAmountProps {}
+
+export... | Unknown | S-dot ์ปจ๋ฒค์
์ข๋ค์๐ ๋ค์์ ์ ๋ ์จ๋ด์ผ๊ฒ ์ด์! |
@@ -0,0 +1,21 @@
+import { useNavigate } from "react-router-dom";
+import { PATH } from "../constants/path";
+import Button from "./Button";
+import { useRecoilValue } from "recoil";
+import { selectedCartItemIdsState } from "../recoil/selectedCartItemIds";
+
+export default function CartButton() {
+ const navigate = ... | Unknown | ๋ฒํผ ์ปดํฌ๋ํธ์์ disabled, onClick์ ๋ฐ์ ์ ์๊ฒ ํด์ค๋ ์ข์์ ๊ฒ ๊ฐ์์! ๊ทธ๋ผ `CartButton` ์ปดํฌ๋ํธ๋ฅผ ๋ณ๋๋ก ๋ง๋ค์ง ์๊ณ `Button` ์ปดํฌ๋ํธ๋ฅผ ๋ฐ๋ก ์ฌ์ฌ์ฉํ ์ ์์ ๊ฒ ๊ฐ์ต๋๋ค!ใ
ใ
(์๋๋ฉด ํน์ ๋ณ๋๋ก ์ด๋ ๊ฒ ๋ง๋ค์ด์ฃผ์ ์ฐ์ ๊ฐ ์์ผ์ค๊น์?) |
@@ -0,0 +1,50 @@
+import styled from "styled-components";
+import { cartItemsState } from "../recoil/cartItems";
+import { useRecoilValue } from "recoil";
+import CartTitle from "./CartTitle";
+import CartItemList from "./CartItemList";
+import CartAmount from "./CartAmount";
+import CartButton from "./CartButton";
+
+... | Unknown | ์ค! ํ๊ตญ์ด๋ก ๋ณ์๋ฅผ ์ ์ธํด์ฃผ์ ์ด์ ๊ฐ ์์ผ์ค๊น์? ๋ณดํต ๋ณ์๋ ์์ด๋ก ์ ์ธํ๋๋ฐ ์ฌ๊ธฐ ํ๊ตญ๋ง์ด๋ผ ์กฐ๊ธ ๋ฎ์ค๊ณ ์ ๊ธฐํ๋ค์! |
@@ -0,0 +1,49 @@
+import { useRecoilState, useSetRecoilState } from "recoil";
+import { removeCartItem, updateCartItemQuantity } from "../api/cartItems";
+import { CartItemId } from "../types/cartItems";
+import { rawCartItemsState } from "../recoil/rawCartItems";
+import { selectedCartItemIdsState } from "../recoil/se... | TypeScript | ๋ณ๋์ hook์ผ๋ก ๋ถ๋ฆฌํด์ฃผ์
จ๊ตฐ์! ์๊ฐํด๋ณด์ง ๋ชปํ๋ ๋ฐฉ๋ฒ์ธ๋ฐ, ์ด๋ ๊ฒ ๋ชจ์๋๋ ๊ต์ฅํ ๊ด์ฌ์ฌ ๋ถ๋ฆฌ๊ฐ ์ ์ด๋ฃจ์ด์ก๋ค๋ ์๊ฐ์ด ๋ค์์ด์๐๐๐ |
@@ -1,10 +1,24 @@
import "./App.css";
+import { RecoilRoot } from "recoil";
+import { BrowserRouter, Route, Routes } from "react-router-dom";
+
+import CartPage from "./pages/CartPage";
+import { PATH } from "./constants/path";
+import OrderSummaryPage from "./pages/OrderSummaryPage";
+import { ErrorBoundary } from "r... | Unknown | ์ ๊ฐ ์ ์๋ฏธํ ์ฐจ์ด์ ๋ํด์๋ ์์๋ณด์ง ๋ชปํด์ ๋ต๋ณ์ ์ฃ๋ถ๋ฆฌ ๋๋ฆด ์๊ฐ ์๋ค์..!
๋ค๋ง, ์กฐ๊ธ ๋ ์ต์ ๋ฌธ๋ฒ์ด๋ค ๋ณด๋ ์ต์ ๋ฌธ๋ฒ์ ๋ง์ถฐ์ ์ ์ฉํด๋ด๋ ๊ด์ฐฎ์ง ์์๊น ์ถ์์ต๋๋ค!
[ํด๋น ๋ธ๋ก๊ทธ](https://velog.io/@kimbyeonghwa/createBrowserRouter-vs-BrowserRouter)์์๋
๋ชจ๋ํ๊ฐ ๊ฐ๋ฅํ ์ ์ ๊ผฝ์๋ค์!
์ ๋ ๋ชจ๋ํ๊ฐ ๊ฐ๋ฅํ ์ ์ด ๊ฐ์ฅ ์ด์ ์ด ํฌ๋ค๊ณ ์๊ฐํ์ด์!
https://github.com/Largopie/react-shopping-cart/blob/step1/src/router.tsx
๊ฐ์ธ์ ... |
@@ -0,0 +1,31 @@
+import styled from "styled-components";
+
+export interface IButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
+ disabled?: boolean;
+}
+
+export default function Button({ children, ...attributes }: IButtonProps) {
+ return <S.Button {...attributes}>{children}</S.Button>;
+}
+
+const S =... | Unknown | ์ ๋ ๊ณต์ฉ์ ์ผ๋ก ์ฌ์ฉํ๋ ์ปดํฌ๋ํธ๋ ๋ณดํต `common` ์ฌ์ฉํฉ๋๋ค! ๐
๋จ์ง ์คํ์ผ์ ์ํด์ ์ฌ์ฉํ๋ ์ฝ๋๋ผ๋ฉด styled๋ผ๊ณ ๋ถ์ฌ๋ ๊ด์ฐฎ์ ๊ฒ ๊ฐ๋ค์! |
@@ -0,0 +1,35 @@
+package christmas.domain.discount;
+
+import christmas.domain.discount.dto.DiscountResponseDto;
+import christmas.domain.order.OrderRequestDto;
+
+import java.time.LocalDate;
+
+public class ChristmasDiscounter implements Discounter{
+
+ private final LocalDate START_DATE = LocalDate.of(2023,12,1);... | Java | 100๊ณผ 1000๋ ์์ํํ๋๊ฑด ์ด๋จ๊น์??! |
@@ -0,0 +1,45 @@
+package christmas.domain.discount;
+
+import christmas.domain.discount.dto.DiscountResponseDto;
+import christmas.domain.discount.dto.FreeBieResponseDto;
+import christmas.domain.menu.DrinkMenu;
+import christmas.domain.menu.Menu;
+import christmas.domain.order.OrderRequestDto;
+
+import java.time.Loc... | Java | 2023๋
12์์๋ง ์ ์ฉ๋๋ ์ด๋ฒคํธ๋ผ๋๊ฒ ๋์ ๋๋ ๊ฒ ๊ฐ์์! ์ ๋ ์๊ฐ๋ชปํ ๋ถ๋ถ์ธ๋ฐ ์ธ์ธํ๊ฒ ์ ํ์ ๊ฒ ๊ฐ๋ค์!! |
@@ -0,0 +1,33 @@
+package christmas.domain.discount.dto;
+
+import christmas.domain.menu.Menu;
+
+import java.util.Optional;
+
+public class FreeBieResponseDto extends DiscountResponseDto{
+
+ private final Optional<Menu> freeBieMenu;
+
+ public FreeBieResponseDto(Optional<Menu> freeBieMenu, String discountName) ... | Java | ์ค.. ์ด๋ฐ ํํ๋ ์ฒ์๋ณด๋ค์! |
@@ -0,0 +1,84 @@
+package christmas.domain.order;
+
+import christmas.domain.discount.Discounter;
+import christmas.domain.discount.dto.DiscountResponseDto;
+import christmas.domain.discount.dto.FreeBieResponseDto;
+import christmas.domain.menu.DrinkMenu;
+import christmas.domain.menu.Menu;
+
+import java.util.ArrayLis... | Java | ๋ฉ์๋๊ฐ ์๋ฃ๋ก๋ง ์ด๋ฃจ์ด์ก๋์ง ํ
์คํธํ๋ ๊ฒ ๊ฐ์์! ๋ฉ์๋๋ช
์ ๋ชจ๋ ์๋ฃ์ธ์ง ์ฒดํฌํ๋ ๋ฉ์๋๋ผ๋ ๊ฑธ ์ ์ ์๊ฒ ํ๋๊ฑด ์ด๋จ๊น์?
ValidOrder๋ ์ ์ฒด์ ์ธ ์ ํจ์ฑ์ ๋ํด์ ์๊ฐํ๊ฒ๋ ๊ฒ ๊ฐ์์! |
@@ -0,0 +1,43 @@
+package christmas.domain.user;
+
+import java.util.Optional;
+
+public enum Badge {
+ STAR(5_000, "๋ณ"),
+ TREE(10_000, "ํธ๋ฆฌ"),
+ SANTA(20_000, "์ฐํ");
+
+ private final int minPrice;
+ private final String message;
+
+ Badge(int minPrice, String message) {
+ this.minPrice = minP... | Java | message ๋ณด๋ค๋ badgeType ๊ฐ์ ํ๋๋ช
์ด ๋ ๋์ ๊ฒ ๊ฐ์์! |
@@ -0,0 +1,28 @@
+package christmas.domain.user;
+
+import christmas.domain.order.Order;
+import christmas.domain.order.OrderRequestDto;
+import christmas.domain.order.OrderResponseDto;
+
+import java.util.Optional;
+
+public class User {
+
+ private Optional<Badge> badge;
+ private final Order order;
+
+ publ... | Java | ์์์๋ ๋์์ง๋ง Optional์ ์ ๋ ์ฒ์ ๋ณด๋ ๊ฒ ๊ฐ์์! ์๋ฐ๊ฐ ์์ง ์ํด๋ฌ์..ใ
๋๋ถ์ ์๋ก์ด ๋ถ๋ถ์ ๋ํด ๊ณต๋ถํ๊ณ ๊ฐ ์ ์๊ฒ ๋ค์!! |
@@ -0,0 +1,81 @@
+package christmas.presentation;
+
+import camp.nextstep.edu.missionutils.Console;
+import christmas.domain.menu.Menu;
+import christmas.domain.order.OrderErrorMessage;
+
+import java.time.LocalDate;
+import java.util.*;
+
+public class InputView {
+
+ public LocalDate inputDate() throws IllegalArgu... | Java | ์ ๋ view์์๋ ์ซ์๊ฐ ๋ค์ด์๋์ง๋ง ์ฒดํฌํ๊ณ 1~31์ผ์ ํด๋นํ๋์ง๋ ๋๋ฉ์ธ ๊ฐ์ฒด์์ ์ฒดํฌํ์ด์!
์ ๋ ์ด ๋ถ๋ถ์ ๋ํด์ ์ด๋์์ ๊ตฌํํ ์ง ๊ณ ๋ฏผํ๋๋ฐ view์์ ์ฒดํฌํ์ ์ด์ ๊ฐ ์์๊น์? |
@@ -0,0 +1,81 @@
+package christmas.presentation;
+
+import camp.nextstep.edu.missionutils.Console;
+import christmas.domain.menu.Menu;
+import christmas.domain.order.OrderErrorMessage;
+
+import java.time.LocalDate;
+import java.util.*;
+
+public class InputView {
+
+ public LocalDate inputDate() throws IllegalArgu... | Java | ์์์๋ ๊ฐ์ ๋งฅ๋ฝ์ธ๋ฐ View์์๋ ์
๋ ฅ์ ๋ฐ๊ณ , utils ๊ฐ์ ๋ถ๋ถ์์ ์
๋ ฅ๊ฐ ํํ๋ฅผ ๋ฐ๊พธ์ด์ฃผ๋ ์ญํ ์ ํด์ผํ๋ค๊ณ ์ ๋ ์๊ฐํ์ด์! Inputview ๋ด์์ ํ์ ์ด์ ๊ฐ ๊ถ๊ธํด์! |
@@ -0,0 +1,116 @@
+package christmas.presentation;
+
+import christmas.domain.discount.Discounter;
+import christmas.domain.discount.dto.DiscountResponseDto;
+import christmas.domain.discount.dto.FreeBieResponseDto;
+import christmas.domain.menu.Menu;
+import christmas.domain.order.OrderResponseDto;
+import christmas.d... | Java | ์ด ๋ฉ์๋์์ ์ถ๋ ฅ์ ๋ํ ์ ์ฒด์ ์ธ ๋ถ๋ถ์ ์ญํ ์ ๋งก๊ณ ์๋ ๊ฒ ๊ฐ์์! ๊ฐ๊ฐ ํํธ๋ณ๋ก ๋๋๋๊ฑด ์ด๋จ๊น์? ํ ์ธ ์ ์ด ์ฃผ๋ฌธ ๊ธ์ก, ์ฆ์ ๋ฉ๋ด, ํํ ๋ด์ญ, ์ดํํ ๊ธ์ก, ํ ์ธ ํ ์์ ๊ฒฐ์ ๊ธ์ก ์ผ๋ก์! |
@@ -0,0 +1,35 @@
+package christmas.domain.discount;
+
+import christmas.domain.discount.dto.DiscountResponseDto;
+import christmas.domain.order.OrderRequestDto;
+
+import java.time.LocalDate;
+
+public class ChristmasDiscounter implements Discounter{
+
+ private final LocalDate START_DATE = LocalDate.of(2023,12,1);... | Java | ์์ํ์ ๊ดํด์ ํฌ๊ฒ ์๊ฐํ์ง ์์์๋ค์. ์์ํํ๋ ๊ฒ์ด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค! |
@@ -0,0 +1,45 @@
+package christmas.domain.discount;
+
+import christmas.domain.discount.dto.DiscountResponseDto;
+import christmas.domain.discount.dto.FreeBieResponseDto;
+import christmas.domain.menu.DrinkMenu;
+import christmas.domain.menu.Menu;
+import christmas.domain.order.OrderRequestDto;
+
+import java.time.Loc... | Java | ๊ฐ์ฌํฉ๋๋ค! |
@@ -0,0 +1,33 @@
+package christmas.domain.discount.dto;
+
+import christmas.domain.menu.Menu;
+
+import java.util.Optional;
+
+public class FreeBieResponseDto extends DiscountResponseDto{
+
+ private final Optional<Menu> freeBieMenu;
+
+ public FreeBieResponseDto(Optional<Menu> freeBieMenu, String discountName) ... | Java | ์ฆ์ ํ์ ์ด๋ป๊ฒ ์ฒ๋ฆฌํ ์ง์ ๋ํด ๋ง์ด ๊ณ ๋ฏผํ์ต๋๋ค ใ
ใ
..
์ข ๋ ์ข์ ๋ฐฉ๋ฒ์ด ์์ ๊ฒ ๊ฐ์๋ฐ, ์ ๋ ์ ๋ ์ค๋ฅด๋ค์ ใ
ใ
|
@@ -0,0 +1,84 @@
+package christmas.domain.order;
+
+import christmas.domain.discount.Discounter;
+import christmas.domain.discount.dto.DiscountResponseDto;
+import christmas.domain.discount.dto.FreeBieResponseDto;
+import christmas.domain.menu.DrinkMenu;
+import christmas.domain.menu.Menu;
+
+import java.util.ArrayLis... | Java | ์ค! ๊ทธ๋ ๋ค์. ๊ฐ์ฌํฉ๋๋ค! |
@@ -0,0 +1,43 @@
+package christmas.domain.user;
+
+import java.util.Optional;
+
+public enum Badge {
+ STAR(5_000, "๋ณ"),
+ TREE(10_000, "ํธ๋ฆฌ"),
+ SANTA(20_000, "์ฐํ");
+
+ private final int minPrice;
+ private final String message;
+
+ Badge(int minPrice, String message) {
+ this.minPrice = minP... | Java | ์ ๊ทธ๋ ๊ตฐ์. ๊ทธ๋ฅ message๋ก๋ง ์์ผ๋ฉด ํท๊ฐ๋ฆฌ๊ฒ ๋ค์. |
@@ -0,0 +1,28 @@
+package christmas.domain.user;
+
+import christmas.domain.order.Order;
+import christmas.domain.order.OrderRequestDto;
+import christmas.domain.order.OrderResponseDto;
+
+import java.util.Optional;
+
+public class User {
+
+ private Optional<Badge> badge;
+ private final Order order;
+
+ publ... | Java | Optional์ ์๊ฐ๋ณด๋ค ๋ง์ด ์ฐ๊ณ , ์ถ์ฒํด์ฃผ๋๋ผ๊ณ ์. ์ดํํฐ๋ธ ์๋ฐ๋ ์ข์ ์ฝ๋, ๋์ ์ฝ๋ ๋ฑ ๋ค์ํ ๊ณณ์์ ๋์ต๋๋ค! |
@@ -0,0 +1,81 @@
+package christmas.presentation;
+
+import camp.nextstep.edu.missionutils.Console;
+import christmas.domain.menu.Menu;
+import christmas.domain.order.OrderErrorMessage;
+
+import java.time.LocalDate;
+import java.util.*;
+
+public class InputView {
+
+ public LocalDate inputDate() throws IllegalArgu... | Java | ์... ์ ๋ ์ด์ ๋ณด๋ ๋๋ฉ์ธ ๊ฐ์ฒด์์ ์ฒดํฌํ๋ ๊ฒ์ด ๋ง๋ ๊ฒ ๊ฐ๋ค์.
๋ง์ฝ ์๊ตฌ์ฌํญ์ด ๋ณ๊ฒฝ๋์ด์ 11์๋ง ์ฃผ๋ฌธ์ด ๊ฐ๋ฅํ๋ค๋ฉด, ์ด ๋ถ๋ถ์ ๋๋ฉ์ธ์ ํด๋นํ๋ ๊ฒ ๊ฐ์ต๋๋ค.
ํผ๋๋ฐฑ ๊ฐ์ฌํฉ๋๋ค. |
@@ -0,0 +1,81 @@
+package christmas.presentation;
+
+import camp.nextstep.edu.missionutils.Console;
+import christmas.domain.menu.Menu;
+import christmas.domain.order.OrderErrorMessage;
+
+import java.time.LocalDate;
+import java.util.*;
+
+public class InputView {
+
+ public LocalDate inputDate() throws IllegalArgu... | Java | ์ฝค๋ง๋ก ๋ฉ๋ด๋ฅผ ๊ตฌ๋ถํ๊ฑฐ๋ <๋ฉ๋ด ์ด๋ฆ>-1 ์ด๋ฐ ์์ผ๋ก ์
๋ ฅ์ด ๋๋ค๋ ๊ฒ์ InputView๋ง ์๊ณ ์๋ค๊ณ ์๊ฐํ์ต๋๋ค. ๊ทธ๋์ ์ด ๋ถ๋ถ์ ๋ค๋ฅธ ๊ฐ์ฒด์์ ์ฌ์ฉํ ์ ์๊ฒ๋ ๊ฐ๊ณตํ๋ ๊ฒ๋ InputView์ ์ญํ ์ด๋ผ๊ณ ์๊ฐํด์ ์ด๋ ๊ฒ ์ฒ๋ฆฌ ํ์ต๋๋ค. |
@@ -0,0 +1,116 @@
+package christmas.presentation;
+
+import christmas.domain.discount.Discounter;
+import christmas.domain.discount.dto.DiscountResponseDto;
+import christmas.domain.discount.dto.FreeBieResponseDto;
+import christmas.domain.menu.Menu;
+import christmas.domain.order.OrderResponseDto;
+import christmas.d... | Java | ์ ๋ OrderResponseDto์ ๋ชจ๋ ์ ๋ณด๊ฐ ๋ค์ด์์ด์ ์ด๋ ๊ฒ ํ์์ต๋๋ค. ๋์ private method๋ฅผ ์ด์ฉํ์ฌ ์ธ๋ถ์ ์ผ๋ก ๋๋ด์ต๋๋ค!
ํ
์คํธ๋ ๊ธฐ๋ฅ ๋ณ๊ฒฝ ๋ฑ ๊ณ ๋ คํ๋ฉด private์ด ์๋ public์ผ๋ก ํด์ ์ธ๋ถ์์ ํธ์ถํ๋๋ก ํ๋ ๊ฒ๋ ์ข์ ๊ฒ ๊ฐ์ต๋๋ค.
ํผ๋๋ฐฑ ์ ๋ง ๊ฐ์ฌํฉ๋๋ค! |
@@ -0,0 +1,162 @@
+package store.controller;
+
+import static store.controller.PromotionController.getValidInput;
+
+import java.text.NumberFormat;
+import java.util.List;
+import store.model.Receipt;
+import store.view.InputView;
+import store.view.OutputView;
+import store.view.error.ErrorException;
+import store.vie... | Java | ์ ๊ฐ ์ ๋ฒ์๋ ์ฌ๊ท ํจ์๊ฐ ์์ข์ง ์์๊น๋ผ๋ ์์ผ๋ก ์๊ธฐ๋ฅผ ํ์์ง๋ง ์๋
3์ฃผ์ฐจ ํผ๋๋ฐฑ์ ๋ณด๋ ์ฌ๊ทํจ์๋ก ์ฒ๋ฆฌํ ์ ์๋ค๋ ๋ด์ฉ์ด ์๋๊ตฐ์... ์ฝ๋๋ฅผ ์ค์ผ ์ ์๋ค๋ฉด ์ฌ๊ท๋ ์ข์ ๊ฒ ๊ฐ์ต๋๋ค! |
@@ -0,0 +1,162 @@
+package store.controller;
+
+import static store.controller.PromotionController.getValidInput;
+
+import java.text.NumberFormat;
+import java.util.List;
+import store.model.Receipt;
+import store.view.InputView;
+import store.view.OutputView;
+import store.view.error.ErrorException;
+import store.vie... | Java | ์ ๋ ๋ชฐ๋๋ ๋ด์ฉ์ด์ง๋ง String format๊ณผ %-8s(8์นธ๋งํผ ์ผ์ชฝ์ ๋ ฌ ์ด๋ฐ์์ผ๋ก ์ฌ์ฉํด์ ์ ๋ ฌ์ ์๋ํ๋๊ตฐ์ |
@@ -0,0 +1,306 @@
+package store.controller;
+
+import camp.nextstep.edu.missionutils.DateTimes;
+import java.time.LocalDateTime;
+import java.util.List;
+import java.util.function.Function;
+import java.util.function.Supplier;
+import store.model.Product;
+import store.model.ProductStock;
+import store.model.Promotion... | Java | enum์ ์ฌ์ฉํด์ ์ฒ๋ฆฌํ ์ ์๋ ๋ถ๋ถ์
๋๋ค! |
@@ -1,7 +1,26 @@
package store;
+
+import store.controller.FrontController;
+import store.controller.ProductController;
+import store.controller.PromotionController;
+import store.view.InputView;
+import store.view.OutputView;
+
+
public class Application {
+
+
public static void main(String[] args) {
- ... | Java | ํด๋์ค๋ช
์ผ๋ก ์๋ฏธ๋ฅผ ์ ์ ์์ผ๋ฏ๋ก ๋ฉ์๋๋ช
์ ํํ์ํด๋ ๋ ๊ฑฐ ๊ฐ์ต๋๋ค |
@@ -0,0 +1,53 @@
+package christmas.Domain;
+
+import christmas.Constant.December;
+import christmas.Constant.DiscountPrice;
+import java.util.HashMap;
+import java.util.Map;
+
+public class Discount {
+
+ public Map<String, Integer> applyDiscount(int visitDay, int dessertCount, int mainCount) {
+ Map<String,... | Java | ์ ๊ฐ Enum ๊ณผ ํจ์ํ์ ํ์ฉํ์ง๋ ์์์ง๋ง ๋ค๋ฅธ๋ถ์ด ํ์ฉํ์ ๊ฒ์ ๋ดค์ด์ ๊ณต์ ํด๋๋ฆฝ๋๋ค!
[์ด ๋งํฌ](https://github.com/june-777/java-christmas-6-june-777/pull/1/files#diff-7bfcb10ed508aaf21090292db65f13df60f023b14552f1338a16fe10023b9948)์์ EventType ๋ถ๋ถ์ ํ์ธํด๋ณด์๋ฉด ๋ฉ๋๋ค!
<img width="850" alt="image" src="https://github.com/Firedrago95/java-christmas-6-Firedrago95... |
@@ -0,0 +1,97 @@
+package christmas.Controller;
+
+import christmas.Domain.PromotionService;
+import christmas.Util.Parser;
+import christmas.View.InputView;
+import christmas.View.OutputView;
+
+
+public class PromotionController {
+
+ private PromotionService promotionService;
+
+ public void run() {
+ s... | Java | ์๋น์ค ๊ณ์ธต์ ํ๋ฒ ์ค์ ๋๊ณ ๋ ๋ค๋ก ๋ณ๊ฒฝ๋์ง ์์ผ๋๊น Controller ์์ฑ์๋ฅผ ํตํด์ ์ฃผ์
๋ฐ๋ ๋ฐฉ๋ฒ๋ ๊ด์ฐฎ์ ๊ฒ ๊ฐ์ต๋๋ค!๐ |
@@ -0,0 +1,97 @@
+package christmas.Controller;
+
+import christmas.Domain.PromotionService;
+import christmas.Util.Parser;
+import christmas.View.InputView;
+import christmas.View.OutputView;
+
+
+public class PromotionController {
+
+ private PromotionService promotionService;
+
+ public void run() {
+ s... | Java | ์ ๋ ์ ํ์ฉํ์ง๋ ๋ชปํ์ง๋ง ํจ์ํ ์ธํฐํ์ด์ค๋ฅผ ํ์ฉํด๋ณด์๋ฉด ํ๋์ `try-catch` ๋ฌธ์ ์ฌ์ฉํ ์ ์๋๋ผ๊ณ ์!
๊ฐ์ ์ง์์์ด์ ํ์ค๋์ด [์ ๋ฆฌํด์ฃผ์ ๊ธ](https://hstory0208.tistory.com/entry/Java-%ED%95%A8%EC%88%98%ED%98%95-%EC%9D%B8%ED%84%B0%ED%8E%98%EC%9D%B4%EC%8A%A4%EB%9E%80-%ED%99%9C%EC%9A%A9-%EB%B0%A9%EB%B2%95%EC%97%90-%EB%8C%80%ED%95%B4-%EC%95%8C%EC%95%84%EB%B3%B4%EC%9E%90)์ด... |
@@ -0,0 +1,28 @@
+package christmas.View;
+
+import camp.nextstep.edu.missionutils.Console;
+import christmas.Domain.Date;
+
+public class InputView {
+
+ public static final String REQUEST_ORDER =
+ "์ฃผ๋ฌธํ์ค ๋ฉ๋ด๋ฅผ ๋ฉ๋ด์ ๊ฐ์๋ฅผ ์๋ ค ์ฃผ์ธ์. (e.g. ํด์ฐ๋ฌผํ์คํ-2,๋ ๋์์ธ-1,์ด์ฝ์ผ์ดํฌ-1)";
+ private static final String REQUEST_VISIT_DAY ... | Java | ์ ๊ทผ ์ ์ด์๊ฐ ๋ค๋ฅธ ํน๋ณํ ์ด์ ๊ฐ ์์ผ์๋์??๐ง |
@@ -0,0 +1,28 @@
+package christmas.View;
+
+import camp.nextstep.edu.missionutils.Console;
+import christmas.Domain.Date;
+
+public class InputView {
+
+ public static final String REQUEST_ORDER =
+ "์ฃผ๋ฌธํ์ค ๋ฉ๋ด๋ฅผ ๋ฉ๋ด์ ๊ฐ์๋ฅผ ์๋ ค ์ฃผ์ธ์. (e.g. ํด์ฐ๋ฌผํ์คํ-2,๋ ๋์์ธ-1,์ด์ฝ์ผ์ดํฌ-1)";
+ private static final String REQUEST_VISIT_DAY ... | Java | ๊ฐ์ธ์ ์ธ ์๊ฐ์ด์ง๋ง ์ด๋ฌ๋ฉด `IllegalArgumentException` ์ด ์๋ `NumberFormatException` ๊ฐ ๋ฐ์ํ ๊ฒ ๊ฐ์์.
๋ฌผ๋ก `NumberFormatException`๊ฐ `IllegalArgumentException` ์ ์์ ์์ธ์ด์ง๋ง ๊ทธ๋๋ ์๊ตฌ์ฌํญ์ ๋ช
์์ ์ผ๋ก `IllegalArgumentException` ๋ฅผ ๋ฐ์์ํค๋ผ๊ณ ๋์ด ์์ผ๋๊น ์ง๊ฒจ์ฃผ๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค!(์ง๊ทนํ ๊ฐ์ธ์ ์ธ ์๊ฒฌ์
๋๋ค!โบ๏ธ) |
@@ -0,0 +1,97 @@
+package christmas.Controller;
+
+import christmas.Domain.PromotionService;
+import christmas.Util.Parser;
+import christmas.View.InputView;
+import christmas.View.OutputView;
+
+
+public class PromotionController {
+
+ private PromotionService promotionService;
+
+ public void run() {
+ s... | Java | ```suggestion
private boolean hasNoEvent() {
return !promotionService.isEventOn();
}
```
๊ฐ๋จํ๊ฒ ๋ฐ๊ฟ์ค ์ ์์ ๊ฒ ๊ฐ์์!โบ๏ธ |
@@ -0,0 +1,54 @@
+package christmas.Util.Validator;
+
+import christmas.Domain.Menu;
+import java.util.Map;
+
+public class OrderValidator {
+
+ public static final String INVALID_ORDER = "[ERROR] ์ ํจํ์ง ์์ ์ฃผ๋ฌธ์
๋๋ค. ๋ค์ ์
๋ ฅํด ์ฃผ์ธ์.";
+ public static final int MAX_ORDER = 20;
+ public static final int MIN_ORDER_QUANTIT... | Java | ์,, `allMatch` ๋ฅผ ํ์ฉํด์ ์ ๋ง ๊น๋ํ๊ฒ ํด์ฃผ์
จ๋ค์! ๋ฐฐ์๊ฐ๋๋ค!๐ |
@@ -0,0 +1,117 @@
+package christmas.View;
+
+import christmas.Domain.Menu;
+import java.util.Map;
+
+public class OutputView {
+
+ public static final String ORDER_LIST_MESSAGE = "<์ฃผ๋ฌธ ๋ฉ๋ด>";
+ public static final String TOTAL_PRICE_MESSAGE = "<ํ ์ธ ์ ์ด์ฃผ๋ฌธ ๊ธ์ก>";
+ public static final String GIFT_MESSAGE = "<์ฆ์ ๋ฉ๋ด>... | Java | ์,, ์ ๋ DecimalFormat ์ ํ์ฉํ์๋๋ฐ ์ด๋ ๊ฒ ๊ฐ๋จํ๊ฒ ํ ์ ์์๊ตฐ์! ๋ฐฐ์๊ฐ๋๋ค! |
@@ -0,0 +1,53 @@
+package christmas.Domain;
+
+import christmas.Constant.December;
+import christmas.Constant.DiscountPrice;
+import java.util.HashMap;
+import java.util.Map;
+
+public class Discount {
+
+ public Map<String, Integer> applyDiscount(int visitDay, int dessertCount, int mainCount) {
+ Map<String,... | Java | ์ ๊ฐ ์ฐพ๋๊ฑด๋ฐ ๊ฐ์ฌํฉ๋๋ค. |
@@ -0,0 +1,146 @@
+import pickle
+import pandas as pd
+import numpy as np
+import re
+from openai import OpenAI
+import os
+from tqdm import tqdm
+import time
+
+def clean(answer):
+ '''
+ ์ฃผ์ด์ง ๋ต๋ณ์ ์ ์ฒ๋ฆฌํ๋ ํจ์
+ Args:
+ answer (str) : FAQ์ ๋ต๋ณ ๋ฐ์ดํฐ
+ Returns:
+ answer (str) : ์ ์ฒ๋ฆฌ๋ ๋ต๋ณ ๋ฐ์ดํฐ
+ re... | Python | ํ์ผ๋ช
์ ๋์ฌ |
@@ -0,0 +1,146 @@
+import pickle
+import pandas as pd
+import numpy as np
+import re
+from openai import OpenAI
+import os
+from tqdm import tqdm
+import time
+
+def clean(answer):
+ '''
+ ์ฃผ์ด์ง ๋ต๋ณ์ ์ ์ฒ๋ฆฌํ๋ ํจ์
+ Args:
+ answer (str) : FAQ์ ๋ต๋ณ ๋ฐ์ดํฐ
+ Returns:
+ answer (str) : ์ ์ฒ๋ฆฌ๋ ๋ต๋ณ ๋ฐ์ดํฐ
+ re... | Python | ์ฃผ์์ ์ข์ผ๋ ํ์ดํ๋ |
@@ -0,0 +1,146 @@
+import pickle
+import pandas as pd
+import numpy as np
+import re
+from openai import OpenAI
+import os
+from tqdm import tqdm
+import time
+
+def clean(answer):
+ '''
+ ์ฃผ์ด์ง ๋ต๋ณ์ ์ ์ฒ๋ฆฌํ๋ ํจ์
+ Args:
+ answer (str) : FAQ์ ๋ต๋ณ ๋ฐ์ดํฐ
+ Returns:
+ answer (str) : ์ ์ฒ๋ฆฌ๋ ๋ต๋ณ ๋ฐ์ดํฐ
+ re... | Python | ์๊ฑฐ๋ ๋ฐ์ผ๋ก |
@@ -0,0 +1,146 @@
+import pickle
+import pandas as pd
+import numpy as np
+import re
+from openai import OpenAI
+import os
+from tqdm import tqdm
+import time
+
+def clean(answer):
+ '''
+ ์ฃผ์ด์ง ๋ต๋ณ์ ์ ์ฒ๋ฆฌํ๋ ํจ์
+ Args:
+ answer (str) : FAQ์ ๋ต๋ณ ๋ฐ์ดํฐ
+ Returns:
+ answer (str) : ์ ์ฒ๋ฆฌ๋ ๋ต๋ณ ๋ฐ์ดํฐ
+ re... | Python | ๋์ด์ ํ๋๊ฒ ๋์ ๊ฒ ๊ฐ๋ค |
@@ -0,0 +1,135 @@
+import pandas as pd
+import os
+from openai import OpenAI
+from sklearn.metrics.pairwise import cosine_similarity
+
+
+def embed(text):
+ '''
+ ํ
์คํธ๋ฅผ ์๋ฒ ๋ฉํ๋ ํจ์
+ Args:
+ text (str) : ์๋ฒ ๋ฉํ ํ
์คํธ
+ Returns:
+ embedding (list) : ํ
์คํธ์ ์๋ฒ ๋ฉ
+ '''
+
+ response = client.embeddings.create(input = text... | Python | ๋ฐ์ผ๋ก |
@@ -0,0 +1,135 @@
+import pandas as pd
+import os
+from openai import OpenAI
+from sklearn.metrics.pairwise import cosine_similarity
+
+
+def embed(text):
+ '''
+ ํ
์คํธ๋ฅผ ์๋ฒ ๋ฉํ๋ ํจ์
+ Args:
+ text (str) : ์๋ฒ ๋ฉํ ํ
์คํธ
+ Returns:
+ embedding (list) : ํ
์คํธ์ ์๋ฒ ๋ฉ
+ '''
+
+ response = client.embeddings.create(input = text... | Python | ํธ์ถํ ๋ ์ด๋ฆ๊น์ง |
@@ -0,0 +1,135 @@
+import pandas as pd
+import os
+from openai import OpenAI
+from sklearn.metrics.pairwise import cosine_similarity
+
+
+def embed(text):
+ '''
+ ํ
์คํธ๋ฅผ ์๋ฒ ๋ฉํ๋ ํจ์
+ Args:
+ text (str) : ์๋ฒ ๋ฉํ ํ
์คํธ
+ Returns:
+ embedding (list) : ํ
์คํธ์ ์๋ฒ ๋ฉ
+ '''
+
+ response = client.embeddings.create(input = text... | Python | ๋์ด์ฐ๊ธฐ |
@@ -0,0 +1,135 @@
+import pandas as pd
+import os
+from openai import OpenAI
+from sklearn.metrics.pairwise import cosine_similarity
+
+
+def embed(text):
+ '''
+ ํ
์คํธ๋ฅผ ์๋ฒ ๋ฉํ๋ ํจ์
+ Args:
+ text (str) : ์๋ฒ ๋ฉํ ํ
์คํธ
+ Returns:
+ embedding (list) : ํ
์คํธ์ ์๋ฒ ๋ฉ
+ '''
+
+ response = client.embeddings.create(input = text... | Python | ํ์คํ ๋ฆฌ๋ฅผ ๋ค๋ฅธ ์๋ฃํ ์ฐ๋๊ฒ ๋์๊ฒ ๊ฐ์ต๋๋ค str๋ณด๋ค๋ |
@@ -1,7 +1,20 @@
package christmas;
+import christmas.domain.EventController;
+import christmas.global.config.Dependency;
+import christmas.global.view.output.OutputView;
+
+import static christmas.global.exception.CommonExceptionMessage.EXCEPTION_PREFIX;
+
public class Application {
public static void main(St... | Java | ์๋ชป๋ ์
๋ ฅ์ ๋ชจ๋ ์์ธ ํด๋์ค๋ก ๋ง๋ค์ด์ Application ๋ด์์ catch๋๋๊ฒ ํฅ๋ฏธ๋กญ๊ณ ํจ์จ์ ์ธ ๊ฒ ๊ฐ๋ค์! ์ ๋ฐฐ์ฐ๊ณ ๊ฐ๋๋ค |
@@ -0,0 +1,114 @@
+package christmas.domain.order;
+
+import christmas.domain.order.enums.food.Food;
+import christmas.domain.order.enums.food.FoodCategory;
+
+import java.util.*;
+
+import static christmas.global.exception.OrderExceptionMessage.INVALID_ORDERS;
+import static christmas.domain.order.enums.OrderNumberDef... | Java | ์ค๋ณต๊ฒ์ฆ์ ๋ก์ง์ ์จ์ ํ validateDuplicateMenu ๋ฉ์๋๋ก ๋๊ธฐ๋ ๊ฒ๋ ์ข์ง ์์๊น ์๊ฐํด๋ด
๋๋ค! |
@@ -0,0 +1,32 @@
+package christmas.domain.sale.enums;
+
+import christmas.domain.calendar.enums.Week;
+import christmas.domain.order.enums.food.FoodCategory;
+
+import java.util.Arrays;
+
+import static christmas.domain.calendar.enums.Week.WEEKDAY;
+import static christmas.domain.calendar.enums.Week.WEEKEND;
+import s... | Java | SaleTarget์ด๋ผ๋ enum์ผ๋ก ํ์ผ๊ณผ ์ฃผ๋ง์ ํ ์ธ์ ์ฒ๋ฆฌํ์ ๋ถ๋ถ์ด ๊ต์ฅํ ํฅ๋ฏธ๋ก์ด๋ฐ ์ผ๋ฐ ํด๋์ค๊ฐ ์๋๋ผ enum์ผ๋ก ํ์ ์ด์ ๊ฐ ๋ฌด์์ธ๊ฐ์? |
@@ -0,0 +1,114 @@
+package christmas.domain.order;
+
+import christmas.domain.order.enums.food.Food;
+import christmas.domain.order.enums.food.FoodCategory;
+
+import java.util.*;
+
+import static christmas.global.exception.OrderExceptionMessage.INVALID_ORDERS;
+import static christmas.domain.order.enums.OrderNumberDef... | Java | ์ฃผ๋ฌธํ ๋ฉ๋ด ๋ชฉ๋ก์ ์์ฑํ๊ธฐ ์ํด Food.generateOrderedMenu๋ฅผ ํธ์ถํ์ ์ด์ ๊ฐ ๊ถ๊ธํฉ๋๋ค.
์ถ๋ ฅ ํ์์ ๋ณํ ์๊ธฐ๋ฉด Food enum์ด ์ํฅ์ ๋ฐ๋ ๋์ Orders๊ฐ ์ํฅ์ ๋ฐ๋ ๊ฒ์ด ๋ ์์ฐ์ค๋ฝ์ง ์์๊น ํ๋ ์๊ฐ์์ ์ง๋ฌธ๋๋ฆฝ๋๋ค! |
@@ -0,0 +1,25 @@
+package christmas.domain.calendar.dto;
+
+import static christmas.global.exception.DateExceptionMessage.INVALID_DATE;
+
+public record DateDto(String date) {
+
+ public DateDto {
+ validateDateIsNotNull(date);
+ validateDateIsNumber(date);
+ }
+
+ private void validateDateIsNotN... | Java | ์ฝ๋ ์ฝ๋ค๊ฐ record์ ๋ํด ์๋กญ๊ฒ ์๊ฒ ๋์์ต๋๋ค. ์ ๋ง ๊ฐ์ฌํฉ๋๋ค ๐ฅน |
@@ -0,0 +1,94 @@
+package christmas.domain.sale;
+
+import christmas.domain.calendar.EventCalendar;
+import christmas.domain.calendar.enums.Week;
+import christmas.domain.order.Orders;
+import christmas.domain.order.enums.food.FoodCategory;
+import christmas.domain.sale.enums.BenefitCategory;
+import christmas.domain.s... | Java | christmasDDaySale ์ฒ๋ผ starDateSale๋ก ๊ด๋ฆฌํ๋ฉด ๋ ์ผ๊ด์ฑ ์์ด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค :> |
@@ -0,0 +1,38 @@
+package christmas.domain.calendar.enums;
+
+import christmas.domain.sale.enums.BenefitCategory;
+
+import java.time.DayOfWeek;
+import java.time.LocalDate;
+
+import static christmas.domain.sale.enums.BenefitCategory.WEEKDAY_SALE;
+import static christmas.domain.sale.enums.BenefitCategory.WEEKEND_SALE... | Java | enum ํด๋์ค์ ํ์ฉ๋๊ฐ ๊ต์ฅํ ๋์ผ์ ๊ฒ ๊ฐ์์! enum ์ฌ์ฉ๋ฒ ๋ง์ด ๋ฐฐ์๊ฐ๋๋ค ใ
ใ
|
@@ -0,0 +1,49 @@
+package christmas.domain;
+
+import christmas.global.view.io.EventCalendarView;
+import christmas.global.view.io.OrdersView;
+import christmas.global.view.io.BenefitDetailsView;
+import christmas.global.view.output.OutputView;
+
+import static christmas.global.view.message.OrderDynamicMessage.SHOW_EVE... | Java | P5: ํจํค์ง์ด ๋ฌํ ๊ฒ์ด์ด์ ใ
ใ
ใ
์ด๋ค ๋ชฉ์ ์ผ๋ก ํจํค์ง์ ํ์
จ๋์ง ๊ถ๊ธํฉ๋๋น ๐ค
(docs/README.md์ ์ถ๊ฐํด์ฃผ์
๋ ์ข์์ ๊ฒ ๊ฐ๊ณ ์?!) |
@@ -0,0 +1,29 @@
+package christmas.global.view.io;
+
+import christmas.domain.calendar.EventCalendar;
+import christmas.domain.calendar.dto.DateDto;
+import christmas.global.view.input.InputView;
+import christmas.global.view.output.OutputView;
+
+import static christmas.global.view.message.OrderStaticMessage.EXPECTED... | Java | P2: ์ด ๋ทฐ์ ์ญํ ์ด ์ด๋ค ๊ฑด์ง ๋ช
ํํ ํด์ผํ ๊ฒ ๊ฐ์์. ๐ค
์ง๊ธ์ ๋ทฐ ๊ณ์ธต๋ ์ฌ๋ฌ ๋จ๊ณ๋ก ์ถ์ํ ๋์ด์๊ณ , ์ปจํธ๋กค๋ฌ์์ ๋ฐ...์๊ฒ๋ง ๊ฐ์ DTO๋ ๋์
์ด ๋์ด์๋๋ฐ, ์ ์ ํธ์ถํ ์ชฝ์ผ๋ก ๋์๊ฐ๋ ๊ฑด `int` ํ์
์ ๊ฐ ํ๋๋ ๋ง์ด์ฃ . '์ ์ก๋์ง ์๋ ์ ์ก๊ฐ์ฒด(DTO)๋ ์ ์กด์ฌํ๋ ๊ฑฐ์ง?....' ์ด๋ฐ ์๊ฐ์ด ์ถฉ๋ถํ ๋ค ์ ์๋ ์ฝ๋์ธ ๊ฒ ๊ฐ๊ฑฐ๋ ์.
- ์ `InputView`์ `EventCalendarView`๊ฐ ๋๋์๋๊ฐ
- ์ DateDto๋ฅผ ๋์
ํ๋๊ฐ
- ์ ๋ฐํ๊ฐ์ `View`๊ฐ ์๋ `eventCalendar`๊ฐ ๋ง๋ค์ด ๋ฐํํ๋... |
@@ -0,0 +1,49 @@
+package christmas.domain;
+
+import christmas.global.view.io.EventCalendarView;
+import christmas.global.view.io.OrdersView;
+import christmas.global.view.io.BenefitDetailsView;
+import christmas.global.view.output.OutputView;
+
+import static christmas.global.view.message.OrderDynamicMessage.SHOW_EVE... | Java | P4: 30๋ผ์ธ์ ์ฝ๋๋ ๋ทฐ ๊ฐ์ฒด๋ก ์ด์ ํ ์ ์์ ๊ฑฐ ๊ฐ์์..!
์ ๊ทผ๋ฐ ์ด๋ฒคํธ ์๋ด ๋ฌธ๊ตฌ ์ถ๋ ฅ ์ฝ๋๊ฐ `takeReservation()` ์์.... ๐ญ |
@@ -0,0 +1,114 @@
+package christmas.domain.order;
+
+import christmas.domain.order.enums.food.Food;
+import christmas.domain.order.enums.food.FoodCategory;
+
+import java.util.*;
+
+import static christmas.global.exception.OrderExceptionMessage.INVALID_ORDERS;
+import static christmas.domain.order.enums.OrderNumberDef... | Java | P5: orderMap์ ๋ํํ ์ปฌ๋ ์
๋ ํน์ ๊ณ ๋ คํด๋ณด์๋ฉด ์ด๋จ๊น์? ๐ |
@@ -0,0 +1,92 @@
+package christmas.domain.order.enums.food;
+
+import java.util.*;
+
+import static christmas.global.exception.OrderExceptionMessage.INVALID_ORDERS;
+
+public enum Food {
+ ์์ก์ด์ํ(FoodCategory.APPETIZER,"์์ก์ด์ํ", 6000),
+ ํํ์ค(FoodCategory.APPETIZER, "ํํ์ค", 5500),
+ ์์ ์๋ฌ๋(FoodCategory.APPETIZER, ... | Java | P3: `generateOrderedMenu()`์ ํ๋ผ๋ฏธํฐ๋ก ํต์งธ๋ก ๋งต์ ๋๊ฒจ์ฃผ์ง ์๊ณ , ๋ฐ์์ ๋งต์ ์ํํ๋ฉด์ `Food`์๋ `getOrderedFoodName(food:Food)` ๊ฐ์ ๋ฉ์๋๋ง ํธ์ถํด์ ๊ฒฐ๊ณผ๋ฅผ ๋ฐ์๋ณด๊ฒ ํ๋ฉด ๋ ์ข์ ๊ฒ ๊ฐ์์ ๐ ๐ |
@@ -0,0 +1,75 @@
+package christmas.global.view.io;
+
+import christmas.domain.badge.Enum.EventBadge;
+import christmas.domain.sale.BenefitDetails;
+import christmas.domain.sale.enums.Giveaway;
+import christmas.global.view.output.OutputView;
+
+import static christmas.global.view.message.PriceMessage.getDiscountPriceM... | Java | P5: 25๋ผ์ธ์ `calculateTotalPrice()`๊ฐ
-> `BenefitDetails#calculateTotalPrice()`
-> `SaleDetails#calculateTotalPrice()`
-> `Orders#calculateTotalPrice(foodMap)`
-> `Food.calculateTotalPrice(foodMap)`
์ด๋ฐ์์ผ๋ก ํธ์ถ์ด ๋๋๋ฐ์.
BenefitDetails์ SaleDetails๋ ์ด๋ค ๋ชฉ์ ์ผ๋ก ๊ฑฐ์ณ๊ฐ๋๋ก ๊ตฌํํ์
จ๋์ง ๊ถ๊ธํฉ๋๋ค! |
@@ -0,0 +1,75 @@
+package christmas.global.view.io;
+
+import christmas.domain.badge.Enum.EventBadge;
+import christmas.domain.sale.BenefitDetails;
+import christmas.domain.sale.enums.Giveaway;
+import christmas.global.view.output.OutputView;
+
+import static christmas.global.view.message.PriceMessage.getDiscountPriceM... | Java | P5: benefitDetails๋ฅผ ํ๋๋ก ๋๊ณ , ์ด๋ ๊ฒ showResult() ์์์ ์ฌ์ฉํ๋ ์ฝ๋๊ฐ ๊น๋ํด์ง๊ณ ์ข๋ค์ ๐ ๐ |
@@ -0,0 +1,39 @@
+package christmas.domain.badge.Enum;
+
+import static christmas.global.exception.CommonExceptionMessage.UNEXPECTED_EXCEPTION;
+
+public enum EventBadge {
+ NONE("์์", 0)
+ ,STAR("๋ณ", 5_000)
+ ,TREE("ํธ๋ฆฌ", 10_000)
+ ,SANTA("์ฐํ", 20_000)
+ ;
+
+ private final String badge;
+ private ... | Java | P4: ์ ์ ๋ฉ์๋์์ ์ ํจ์ฑ ๊ฒ์ฆ์ ํ๋ฒ ๋ ๊ฑฐ์น๋ ๊ฒ ์ ๋ง ๊ผผ๊ผผํ๊ณ ์ข๋ค์ ๐
P4: 22~31๋ผ์ธ์ ๋ค์ค if ๋ฌธ์ enum์ ๊ธฐ๋ฅ์ ํ์ฉํด์ ํด๊ฒฐ ํ ์ ์์ง ์์๊น์? ๐ |
@@ -0,0 +1,38 @@
+package christmas.global.config;
+
+import christmas.domain.EventController;
+import christmas.domain.calendar.EventCalendar;
+import christmas.domain.order.Orders;
+import christmas.domain.sale.BenefitDetails;
+import christmas.domain.sale.ChristmasDDaySale;
+import christmas.domain.sale.SaleDetails;... | Java | P3: ์ฐ๊ด๊ด๊ณ ์ ๋ณด๊ฐ ์์ ํ ๋ถ๋ฆฌ๋์ง ์์ ๊ฒ ๊ฐ์์..!
์ฝ๋ ์์์๋ง ๋ถ๋ฆฌํ ๊ฑฐ๋ผ๋ฉด Application์ชฝ์ ๋ฉ์๋๋ก๋ง ๋ถ๋ฆฌํด๋ ์ถฉ๋ถํ ๊ฑฐ ๊ฐ๊ณ , ์ง๊ธ์ฒ๋ผ Dependency ํ์ผ์ ์์ ๋ฐ๋ก ๋บ ๊ฑฐ๋ผ๋ฉด, Orders๊ฐ ์์ ์ ์ธ์คํด์ค๊ฐ ๋ฌด์์ธ์ง ์ ํ ์์ง ๋ชปํ๊ฒ ๋ฐ์์ ์ฃผ์
ํ๋๋ก ๋ง๋ค์ด์ฃผ๋๊ฒ ์ข์ ๊ฒ ๊ฐ์์. |
@@ -1,7 +1,16 @@
package christmas;
+import christmas.config.Dependency;
+
public class Application {
public static void main(String[] args) {
- // TODO: ํ๋ก๊ทธ๋จ ๊ตฌํ
+
+ try {
+ EventPlanner eventPlanner = Dependency.eventPlannner();
+ eventPlanner.run();
+ } catch (Excep... | Java | P5: ์๊ตฌ์ฌํญ์ด ๋ค ๊ตฌํ๋์ง ์์ ๊ฒ ๊ฐ์์ ๐ญ ... |
@@ -1,7 +1,16 @@
package christmas;
+import christmas.config.Dependency;
+
public class Application {
public static void main(String[] args) {
- // TODO: ํ๋ก๊ทธ๋จ ๊ตฌํ
+
+ try {
+ EventPlanner eventPlanner = Dependency.eventPlannner();
+ eventPlanner.run();
+ } catch (Excep... | Java | P5: ์ง์ง ์ฌ์ํ ๊ฑด๋ฐ์.
์ด ๊ณต๋ฐฑ ์ถ๋ ฅ์ ์๋ฏธ...๋ ๋ญ๊น์?... ๐ค ... |
@@ -0,0 +1,42 @@
+package christmas.domain;
+
+import christmas.constant.Calendar;
+import christmas.constant.FoodName;
+import christmas.validator.DateValidator;
+import christmas.view.InputView;
+import christmas.view.OutputView;
+
+public class Date {
+ int date;
+
+ public void saveDate(){
+ String inp... | Java | P2: `Date`๊ฐ ๋จ์ ๊ฐํ์
์ ์๋๊ณ ์๊ธฐ๋ง์ ์ญํ ์ ๊ฐ์ง ๊ฐ์ฒด๋ก ๋ณด์ฌ์ง๋๋ฐ์!
๊ทธ๋ ๋ค๋ฉด ์ฌ๊ธฐ์ ๋ทฐ๋ฅผ ํธ์ถํ๊ฒ ๋๋ฉด, ๋ทฐ์ ๋น์ฆ๋์ค ๋ก์ง์ด ๊ฐํ๊ฒ ์ฐ๊ด๋๋ค๋ ์๊ฐ์ด ๋ค์ด์.
์ฐํ
์ฝ ์๊ตฌ์ฌํญ์ ์์๋ฏ์ด ๋ทฐ๋ฅผ ๋ถ๋ฆฌํด์ฃผ๋ ค๋ฉด, ์นํ๋๊ป์ ๊ตฌํํด๋์ผ์ ์ปจํธ๋กค๋ฌ๋, `EventPlanner`๋, ์๋๋ฉด ์๋น์ค ๋ณด๋ค ์์์๋ ์ด๋ค ์ 3์ ๊ฐ์ฒด์์, ๋ทฐ๋ฅผ ์ฒ๋ฆฌํ๊ณ ๊ฐ๋ง `Date`์ชฝ์ผ๋ก ๋๊ฒจ์ฃผ๋ฉด ๋ ๊ฒ ๊ฐ์์..! |
@@ -0,0 +1,33 @@
+package christmas.validator;
+
+import jdk.jshell.spi.ExecutionControl.RunException;
+
+public class DateValidator {
+
+ public static int validateDate(String input) {
+ validateInputType(input);
+
+ try {
+ if (input == null) {
+ throw new IllegalArgumentExc... | Java | P5: ํ์
๊น์ง ๊ฒ์ฆํ์๋ ค๊ณ ๋
ธ๋ ฅํ์ ๋ถ๋ถ์ด ๋ณด์ฌ์ ์ ๋ง ์ข์ ๊ฒ ๊ฐ์์ ๐ ๐
๊ทธ๋ฐ๋ฐ ์์ฒ input์ ํ์
์ ๋ฌด์กฐ๊ฑด String์ด ๋ ์ ๋ฐ์ ์์ด์! ์ผ๋ถ๋ฌ ์์์ ํ์
์ ๋ณํํ์ง ์๋ ์ด์์์(๋ง์ฝ ๊ทธ๋ ๋ค๋ฉด, ์๋์ ๋ฐ๋ผ ๋ฐ๋ ๊ฒ์ด๋ ์์ธ์ ์ธ ์ํฉ์ด ์๋๊ฒ ์ฃ ..!)
๊ทธ๋์ ์ด ๋ถ๋ถ์ ์ฝ๋๋ ์ ๊ฑฐํด๋ ์ข์ ๊ฒ ๊ฐ์ต๋๋ค..! |
@@ -0,0 +1,60 @@
+package christmas.constant;
+
+import java.util.Arrays;
+import java.util.stream.Stream;
+
+public enum FoodName {
+ MUSHROOM_SOUP("์์ก์ด์ํ",6000,"APPITIZER"),
+ TAPAS("ํํ์ค", 6000,"APPITIZER"),
+ CEASAR_SALAD("์์ ์๋ฌ๋", 6000,"APPITIZER"),
+ T_BONE_STAKE("ํฐ๋ณธ์คํ
์ดํฌ", 6000,"MAIN"),
+ BARBECUE_RI... | Java | P4: enum์ผ๋ก ๋ฉ๋ด๋ฅผ ๊ตฌํํ์ ๋ถ๋ถ ์ ๋ง ์ข์ ๊ฒ ๊ฐ์์ ๐
๊ทธ๋ฐ๋ฐ ์ดํ๋ฆฌ์ผ์ด์
์ด ์ ์๋์ ํ์ง ์๋ ์ด์ ์ค ์ผ๋ถ๊ฐ ์ฌ๊ธฐ ์จ์ด์์๊ตฐ์
๊ฐ๊ฒฉ์ด ์ ๋ถ 6000์... ๐ญ
ํ๊ฐ์ง๋ง ์๊ฒฌ์ ๋ด๋ณด์๋ฉด, ์์์ ์นดํ
๊ณ ๋ฆฌ(`sort`)๋ enum์ผ๋ก ๊ด๋ฆฌํด๋ณด๋ฉด ์ข์ ๊ฑฐ ๊ฐ์์! |
@@ -0,0 +1,27 @@
+package christmas;
+
+import christmas.controller.EventController;
+
+public class EventPlanner {
+ private final EventController eventController;
+
+ public EventPlanner(EventController eventController) {
+ this.eventController = eventController;
+ }
+
+ public void run(){
+ ... | Java | P5: ์ง๋ฌธ๋๋ฆฝ๋๋ค..!
EventPlanner์ EventController์ ์ญํ ์ด ๋ค์ ์ค์ฒฉ๋๋ ๊ฒ ๊ฐ์๋ฐ์(๋ค๋ฅด๊ฒ ๋งํ๋ฉด, ํ ๊ฐ์ฒด๋ก ํ ์ ์๋ ์ญํ ์ ๋๋ก ์ชผ๊ฐ ๊ฒ ๊ฐ์๋ฐ์)
๋๋์ ์ด์ ๊ฐ ์ด๋ค๊ฑด์ง ๊ถ๊ธํฉ๋๋ค! |
@@ -0,0 +1,68 @@
+package christmas.domain;
+
+import christmas.view.OutputView;
+import java.util.Map;
+
+public class Price {
+
+ int totalPriceBeforeDiscount;
+ EventPrices eventPrices;
+
+
+ public Price(int totalPrice) {
+ this.totalPriceBeforeDiscount = totalPrice;
+ this.eventPrices = new ... | Java | P5: ์ด ๋ถ๋ถ๋, ๋ทฐ๋ ๋ถ๋ฆฌํ๋๊ฒ ์ข์ ๊ฒ ๊ฐ์์!
๋ค๋ฅธ ๋ถ๋ถ์๋ ์ฝ๋ฉํธ ๋จ๊ฒผ์ง๋ง, ์ด ๊ณณ์ ์์ System.out์ ์ฌ์ฉํ๊ณ ์์ด์ ํ ๋ฒ ๋ ๋จ๊ฒจ๋ณด์์..! ๐
๊ทธ๋ฆฌ๊ณ ์ด ๋ถ๋ถ ๊ธ์ก ํฌ๋งทํ
๋ ์ถ๊ฐ๋๋ฉด ๋ ์ข๊ฒ ๋ค์ฉ..! (๋ค๋ฅธ ๋ถ๋ถ์ ๋์ด์๋๋ฐ ์ฌ๊ธฐ๋ง ๋น ์ ธ์์ด์์) |
@@ -0,0 +1,68 @@
+package christmas.domain;
+
+import christmas.view.OutputView;
+import java.util.Map;
+
+public class Price {
+
+ int totalPriceBeforeDiscount;
+ EventPrices eventPrices;
+
+
+ public Price(int totalPrice) {
+ this.totalPriceBeforeDiscount = totalPrice;
+ this.eventPrices = new ... | Java | P3: ์ฌ๊ธฐ์ if-else๋ก์ง์ด... ๋ญ๊ฐ ์ด์ํ๊ฒ ์จ์ด์๋ ๊ฒ ๊ฐ์๋ฐ์ ๐ต๏ธโโ๏ธ (์ฌ์ฉํ์ง ์๊ธฐ๋ก ํ๋ if-else๊ฐ ์๋ ๊ฒ์ ์ ์ธํ๊ณ ์๋ผ๋...) |
@@ -0,0 +1,90 @@
+package christmas.domain;
+
+import christmas.constant.BenefitList;
+import christmas.view.OutputView;
+import java.text.DecimalFormat;
+import java.util.HashMap;
+import java.util.Map;
+
+public class EventPrices {
+ Map<String,Integer> benefitList;
+ int totalPrice;
+
+ public EventPrices()... | Java | P2: if-else ๋ฌธ์๋ return์ด ํ์ํ์ง ์์์..! ๋๊ตฐ๋ค๋ ๋ฐํํ์
์ด void์ธ ์ํฉ์์๋์!
๋ฌผ๋ก ๋ช
์์ ์ธ return์ ์จ์ ํท๊ฐ๋ฆด๋งํ ์ฝ๋๋ ์ฌ์ด๋์ดํํธ๋ฅผ ๋ง๋ ๊ฒฝ์ฐ๋ ์๋๋ฐ, ์ง๊ธ์ ํด๋น๋์ง ์๋ ์ฝ๋ ๊ฐ์์ ๋ง์๋๋ ค๋ณด์์ต๋๋ค ๐ |
@@ -0,0 +1,25 @@
+package christmas.controller;
+
+import christmas.service.EventService;
+
+public class EventController {
+ private final EventService eventService;
+
+ public EventController(EventService eventRepository) {
+ this.eventService = eventRepository;
+ }
+
+ public void requestInfo() {
... | Java | EventPlanner EventController EventService๋ก ๊ตฌ์กฐ๋ฅผ ๊ฐ์ ธ๊ฐ์ ์ด์ ๊ฐ ๊ถ๊ธํฉ๋๋ค. ์ด๋ค ์ด์ ์ด ์๋ค ์๊ฐ์ด ๋ค์ด์ ์ด๋ ๊ฒ ๊ตฌ์กฐ๋ฅผ ๊ฐ์ ธ๊ฐ์ ๊ฑธ๊น์?
๋ํ ๋ทฐ๋ก์ง์ด ๋๋ฉ์ธ๊ณผ ๊ฐํ๊ฒ ๊ฒฐํฉ๋๋ค ์๊ฐํ๋๋ฐ ์ด๋ป๊ฒ ์๊ฐํ์ค๊น์? |
@@ -0,0 +1,28 @@
+# ๊ธฐ๋ฅ ์๊ตฌ ์ฌํญ
+
+1. ์ํ ๋ชฉ๋ก ์กฐํ
+
+ - [x] API๋ฅผ ํตํด ์ํ ๋ชฉ๋ก์ ๊ฐ์ ธ์ฌ ์ ์๋ค.
+ - [x] ๋งจ ์ฒ์ API ํธ์ถ ์ 20๊ฐ์ ๋ชฉ๋ก์ ๋ถ๋ฌ์จ๋ค.
+ - [x] ์ด ํ ์ถ๊ฐ API ํธ์ถ ์ 4๊ฐ์ ๋ชฉ๋ก์ ๋ถ๋ฌ์จ๋ค.
+ - [x] ๋ฌดํ ์คํฌ๋กค์ ํ ์ ์๋ค.
+
+2. ์ํ ์ ๋ ฌ ๋ฐ ํํฐ๋ง
+
+ - [x] ์ํ ์นดํ
๊ณ ๋ฆฌ๋ณ ํํฐ๋ง์ ํ ์ ์๋ค.
+ - [x] ์ํ์ ์ ๋ ฌ ํ ์ ์๋ค. (๋ฎ์ ๊ฐ๊ฒฉ ์, ๋์ ๊ฐ๊ฒฉ ์)
+
+3. ์ํ ์ฅ๋ฐ๊ตฌ๋ ๋ด๊ธฐ
+
+ - [x] ์ฌ์ฉ์๊ฐ ๋ด๊ธฐ ๋ฒ... | Unknown | ์ฌ์ํ์ง๋ง, ์ฌ๊ธฐ ๋ง์ง๋ง ๋ถ๋ถ ์ฒดํฌ๋ฆฌ์คํธ๊ฐ ๋น ์ ธ์๋ค์! ์์ง ๊ตฌํ ๋ชปํ ๋ถ๋ถ์ผ๊น์?! |
@@ -4,17 +4,21 @@
"version": "0.0.0",
"type": "module",
"scripts": {
- "dev": "vite",
+ "dev": "vite --host",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
"test": "vitest"
},
"depend... | Unknown | ์ ์ด๋๋ styled-components๋ฅผ ์ฌ์ฉํ ์ด์ ๊ฐ ์์๊น์? ์ ์ด๋์ ์๊ฒฌ์ด ๊ถ๊ธํ๋ค์! ๐ซ |
@@ -0,0 +1,28 @@
+# ๊ธฐ๋ฅ ์๊ตฌ ์ฌํญ
+
+1. ์ํ ๋ชฉ๋ก ์กฐํ
+
+ - [x] API๋ฅผ ํตํด ์ํ ๋ชฉ๋ก์ ๊ฐ์ ธ์ฌ ์ ์๋ค.
+ - [x] ๋งจ ์ฒ์ API ํธ์ถ ์ 20๊ฐ์ ๋ชฉ๋ก์ ๋ถ๋ฌ์จ๋ค.
+ - [x] ์ด ํ ์ถ๊ฐ API ํธ์ถ ์ 4๊ฐ์ ๋ชฉ๋ก์ ๋ถ๋ฌ์จ๋ค.
+ - [x] ๋ฌดํ ์คํฌ๋กค์ ํ ์ ์๋ค.
+
+2. ์ํ ์ ๋ ฌ ๋ฐ ํํฐ๋ง
+
+ - [x] ์ํ ์นดํ
๊ณ ๋ฆฌ๋ณ ํํฐ๋ง์ ํ ์ ์๋ค.
+ - [x] ์ํ์ ์ ๋ ฌ ํ ์ ์๋ค. (๋ฎ์ ๊ฐ๊ฒฉ ์, ๋์ ๊ฐ๊ฒฉ ์)
+
+3. ์ํ ์ฅ๋ฐ๊ตฌ๋ ๋ด๊ธฐ
+
+ - [x] ์ฌ์ฉ์๊ฐ ๋ด๊ธฐ ๋ฒ... | Unknown | ++ README์ ์์ฑํ๊ธฐ๋ณด๋ค, REQUIREMENTS์ ์์ฑํ์ ์ด์ ๊ฐ ์์๊น์? |
@@ -4,17 +4,21 @@
"version": "0.0.0",
"type": "module",
"scripts": {
- "dev": "vite",
+ "dev": "vite --host",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
"test": "vitest"
},
"depend... | Unknown | styled-component์
emotion ์ ์ ํ
์ฌ์ค ์ ๋ ๋ ๋ค์ฌ์ฉํด๋ณด๊ณ emotion์ ๋ ์ ํธํ์ง๋ง,
์ด๋ฒ ๋ฏธ์
์์๋ ์ด ๋์ ์ ํ์ ๋ํด์ ํฌ๋ฃจ์ ์๊ฒฌ์ ๋ฐ๋์ต๋๋ค.
emotion์ ์ข ๋ ์ ํธํ๋ ์ด์ :
styled-component๋ฅผ ๋ค๋ฅธํ์ผ์ ๊ณ์ ๋ง๋ค์ด ์ค ํ์ ์์
๋์ ์ธ css๋ฅผ ์ฌ์ฉํ๊ณ ์ถ์ ๋ ์ข ๋ ํธํ๋ค๊ณ ๋๊ผ์
์
๋๋ค. |
@@ -0,0 +1,28 @@
+# ๊ธฐ๋ฅ ์๊ตฌ ์ฌํญ
+
+1. ์ํ ๋ชฉ๋ก ์กฐํ
+
+ - [x] API๋ฅผ ํตํด ์ํ ๋ชฉ๋ก์ ๊ฐ์ ธ์ฌ ์ ์๋ค.
+ - [x] ๋งจ ์ฒ์ API ํธ์ถ ์ 20๊ฐ์ ๋ชฉ๋ก์ ๋ถ๋ฌ์จ๋ค.
+ - [x] ์ด ํ ์ถ๊ฐ API ํธ์ถ ์ 4๊ฐ์ ๋ชฉ๋ก์ ๋ถ๋ฌ์จ๋ค.
+ - [x] ๋ฌดํ ์คํฌ๋กค์ ํ ์ ์๋ค.
+
+2. ์ํ ์ ๋ ฌ ๋ฐ ํํฐ๋ง
+
+ - [x] ์ํ ์นดํ
๊ณ ๋ฆฌ๋ณ ํํฐ๋ง์ ํ ์ ์๋ค.
+ - [x] ์ํ์ ์ ๋ ฌ ํ ์ ์๋ค. (๋ฎ์ ๊ฐ๊ฒฉ ์, ๋์ ๊ฐ๊ฒฉ ์)
+
+3. ์ํ ์ฅ๋ฐ๊ตฌ๋ ๋ด๊ธฐ
+
+ - [x] ์ฌ์ฉ์๊ฐ ๋ด๊ธฐ ๋ฒ... | Unknown | ์๊ตฌ์ฌํญ์ด๋ผ์ REQUIREMENTS๋ก ๋ช
๋ช
ํ์ต๋๋ค.
README์๋ ํ๋ก์ ํธ ๋ด์ฉ์๋ํ ์๊ฐ ๋ฑ์ ์ฐ๋ ํธ์ธ ๊ฒ ๊ฐ์ต๋๋ค |
@@ -0,0 +1,86 @@
+package store.controller;
+
+import static store.util.Constant.ANSWER_NO;
+import static store.util.InformationMessage.WELCOME_MESSAGE;
+import static store.util.Validator.validateAnswer;
+import static store.view.InputView.readForAdditionalPurchase;
+import static store.view.OutputView.displayReceipt... | Java | ์ด๋ถ๋ถ ๊น๋ํ๊ฑฐ ๊ฐ์ต๋๋ค! |
@@ -0,0 +1,86 @@
+package store.controller;
+
+import static store.util.Constant.ANSWER_NO;
+import static store.util.InformationMessage.WELCOME_MESSAGE;
+import static store.util.Validator.validateAnswer;
+import static store.view.InputView.readForAdditionalPurchase;
+import static store.view.OutputView.displayReceipt... | Java | ๋ฐ๋ก static์ ์ธ์ ์ํ์ ์ด์ ๊ฐ ๊ถ๊ธํฉ๋๋ค |
@@ -0,0 +1,162 @@
+package store.domain;
+
+import static store.util.Constant.BLANK;
+import static store.util.Constant.PRODUCTS_FILE_NAME;
+import static store.util.ErrorMessage.INSUFFICIENT_INVENTORY_MESSAGE;
+import static store.util.ErrorMessage.PRODUCT_NOT_FOUND_MESSAGE;
+import static store.util.Parser.parseProdu... | Java | ํ์ผ์
์ถ๋ ฅ ๋ฐฉ๋ฒ์ด ์ฌ๋ฌ๊ฐ ์๋๊ฑธ๋ก ์๋๋ฐ ํด๋น ๋ฐฉ๋ฒ์ ํํ์ ์ด์ ๊ฐ ๊ถ๊ธํฉ๋๋ค |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.