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 ๊ตฌํ˜„ํ•˜์…จ๋„ค์š”..! ๐Ÿ‘ ์ถ”๊ฐ€์ ์œผ๋กœ ์ด๋ฏธ์ง€๊ฐ€ ๋กœ๋”ฉ์ƒํƒœ์ผ ๋•Œ, ํ™”๋ฉด์ด ์ ‘ํžˆ๋„ค์š”..! ์Šคํƒ€์ผ๋„ ์ถ”๊ฐ€์ ์œผ๋กœ ์ ์šฉํ•˜๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค! ![image](https://github.com/cys4585/react-shopping-cart/assets/106071687/5c0b6fa9-7f24-4c18-8f66-f800db48bcaa)
@@ -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
ํŒŒ์ผ์ž…์ถœ๋ ฅ ๋ฐฉ๋ฒ•์ด ์—ฌ๋Ÿฌ๊ฐœ ์žˆ๋Š”๊ฑธ๋กœ ์•„๋Š”๋ฐ ํ•ด๋‹น ๋ฐฉ๋ฒ•์„ ํƒํ•˜์‹  ์ด์œ ๊ฐ€ ๊ถ๊ธˆํ•ฉ๋‹ˆ๋‹ค