code
stringlengths
41
34.3k
lang
stringclasses
8 values
review
stringlengths
1
4.74k
@@ -0,0 +1,412 @@ +* { + margin: 0; + padding: 0; +} +nav { + position: fixed; + width: 100%; + top: 0px; + left: 0px; + right: 0px; + background-color: #fff; + border-bottom: 1px solid #dbdbdb; + .navcontents { + width: 935px; + height: 54px; + background-color: #fff; + margin: 0 auto; + ...
Unknown
```suggestion ``` ๋นˆ์นธ์„ ์ค„์ด๋Š” ๊ฒƒ๋„ ์ข‹์€ ์Šต๊ด€์ด๋ผ๊ณ  ํ•˜๋„ค์š”!
@@ -0,0 +1,85 @@ +* { + box-sizing: border-box; +} + +.loginContainer { + border: 2px solid #e6e6e6; + width: 350px; + height: 380px; + margin: 0 auto; + .logoName { + display: flex; + justify-content: center; + align-items: center; + width: 100%; + h1 { + font-family: "Lobster",...
Unknown
๋„˜ ๋””ํ…Œ์ผํ•œ css ์†์„ฑ๊ฐ’ .. ์žฌ์˜๋‹˜ ๋…ธ๊ณ ์— ๊ฒฝ์˜๋ฅผ..๐Ÿ‘๐Ÿป
@@ -0,0 +1,50 @@ +import React from 'react'; +import { withRouter } from 'react-router-dom'; +import './Login.scss'; + + +class LoginJaeyoung extends React.Component { + constructor () { + super(); + this.state = { + id: '', + pw : '', + }; + } + + handleInput = (e) ...
JavaScript
target ๋ณด๋‹ค๋Š” ์ง๊ด€์ ์ธ ํ‚ค๋„ค์ž„์œผ๋กœ ๋ณ€๊ฒฝํ•˜๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.
@@ -0,0 +1,85 @@ +* { + box-sizing: border-box; +} + +.loginContainer { + border: 2px solid #e6e6e6; + width: 350px; + height: 380px; + margin: 0 auto; + .logoName { + display: flex; + justify-content: center; + align-items: center; + width: 100%; + h1 { + font-family: "Lobster",...
Unknown
- ํ•˜๋‚˜์˜ ์š”์†Œ์— ์—ฌ๋Ÿฌ๊ฐ€์ง€ ์†์„ฑ์„ ๋ถ€์—ฌํ•˜๋Š” ๊ฒฝ์šฐ ์ค‘์š”๋„, ๊ด€๋ จ๋„์— ๋”ฐ๋ผ์„œ ๋‚˜๋ฆ„์˜ convention์„ ์ง€์ผœ์„œ ์ž‘์„ฑํ•˜๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค. - ์ผ๋ฐ˜์ ์ธ convention ์€ ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค. ์•„๋ž˜์™€ ๊ฐ™์ด ์ˆœ์„œ ์ ์šฉํ•ด์ฃผ์„ธ์š”. [CSS property ์ˆœ์„œ] - Layout Properties (position, float, clear, display) - Box Model Properties (width, height, margin, padding) - Visual Properties (color, background, border, box-shadow) ...
@@ -3,7 +3,10 @@ <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> - <title>React App</title> + <meta name="description" content="Web site created using create-react-app"/> + <link href="https://fonts.googleapis.com/css2?family=Lobster&display=s...
Unknown
meta ํƒœ๊ทธ์˜ ์ข…๋ฅ˜๊ฐ€ ๋งŽ๊ธฐ ๋Œ€๋ฌธ์— ์–ด๋–ค ๋ฐ์ดํ„ฐ์ธ์ง€ ๋ช…์‹œํ•˜๋Š” ์ฐจ์›์—์„œ๋Š” ์žˆ๋Š” ๊ฒƒ์ด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค!
@@ -3,7 +3,10 @@ <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> - <title>React App</title> + <meta name="description" content="Web site created using create-react-app"/> + <link href="https://fonts.googleapis.com/css2?family=Lobster&display=s...
Unknown
๋ถˆํ•„์š”ํ•œ ์—”ํ„ฐ ์ฒ˜๋ฆฌ๋Š” ์‚ญ์ œํ•ด์ฃผ์„ธ์š”!
@@ -0,0 +1,50 @@ +import React from 'react'; +import { withRouter } from 'react-router-dom'; +import './Login.scss'; + + +class LoginJaeyoung extends React.Component { + constructor () { + super(); + this.state = { + id: '', + pw : '', + }; + } + + handleInput = (e) ...
JavaScript
Import ์ˆœ์„œ ์ˆ˜์ •ํ•ด์ฃผ์„ธ์š”! ์ผ๋ฐ˜์ ์ธ convention์„ ๋”ฐ๋ฅด๋Š” ์ด์œ ๋„ ์žˆ์ง€๋งŒ ์ˆœ์„œ๋งŒ ์ž˜ ์ง€์ผœ์ฃผ์…”๋„ ๊ฐ€๋…์„ฑ์ด ์ข‹์•„์ง‘๋‹ˆ๋‹ค. ์•„๋ž˜ ์ˆœ์„œ ์ฐธ๊ณ ํ•ด์ฃผ์„ธ์š”. - React โ†’ Library(Package) โ†’ Component โ†’ ๋ณ€์ˆ˜ / ์ด๋ฏธ์ง€ โ†’ css ํŒŒ์ผ(scss ํŒŒ์ผ)
@@ -0,0 +1,50 @@ +import React from 'react'; +import { withRouter } from 'react-router-dom'; +import './Login.scss'; + + +class LoginJaeyoung extends React.Component { + constructor () { + super(); + this.state = { + id: '', + pw : '', + }; + } + + handleInput = (e) ...
JavaScript
```js // render ์•„๋ž˜์—์„œ const isBtnAble = idValue.includes('@') && psValue.length > 5; <button disabled={!isBtnAble} /> ``` - ์ด๋Ÿฐ์‹์œผ๋กœ ๋ณ€์ˆ˜๋ฅผ ํ™œ์šฉํ•˜๋ฉด ์ข€ ๋” ๊น”๋”ํ•ด์งˆ ์ˆ˜ ์žˆ๊ฒ ๋„ค์š”! - Boolean ๋ฐ์ดํ„ฐ๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ์—๋Š” ๊ตณ์ด true, false ํ‘œ์‹œํ•ด์ค„ ํ•„์š” ์—†์Šต๋‹ˆ๋‹ค! (์‚ผํ•ญ ์—ฐ์‚ฐ์ž ์กฐ๊ฑด์— ํ•ด๋‹น๋˜๋Š” ๋ถ€๋ถ„์ด ์ด๋ฏธ t/f ๊ฐ’์„ ๊ฐ–๊ธฐ ๋•Œ๋ฌธ์—)
@@ -0,0 +1,85 @@ +* { + box-sizing: border-box; +} + +.loginContainer { + border: 2px solid #e6e6e6; + width: 350px; + height: 380px; + margin: 0 auto; + .logoName { + display: flex; + justify-content: center; + align-items: center; + width: 100%; + h1 { + font-family: "Lobster",...
Unknown
๊ฐ€๋…์„ฑ์„ ์œ„ํ•ด selector ์‚ฌ์ด์— ํ•œ ์ค„ ๋„์›Œ์ฃผ์‹œ๋ฉด ์ข‹์Šต๋‹ˆ๋‹ค.
@@ -0,0 +1,85 @@ +* { + box-sizing: border-box; +} + +.loginContainer { + border: 2px solid #e6e6e6; + width: 350px; + height: 380px; + margin: 0 auto; + .logoName { + display: flex; + justify-content: center; + align-items: center; + width: 100%; + h1 { + font-family: "Lobster",...
Unknown
๊ณตํ†ต๋˜๋Š” ์†์„ฑ์ด ๋งŽ์ด ๋ณด์ด๋„ค์š”! ์ค„์—ฌ๋ด…์‹œ๋‹ค ๐Ÿ™Œ ํ•˜๋‚˜์˜ ์š”์†Œ์— ๋ณต์ˆ˜์˜ className์„ ๋ถ€์—ฌํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
@@ -0,0 +1,190 @@ +import React from 'react'; +import FeedComponent from './FeedComponent/FeedComponent'; +import './Main.scss'; +import explore from '../../../images/jaeyoungLee/Main/explore.jpg'; +import heart from '../../../images/jaeyoungLee/Main/heart.jpg'; +import profile from '../../../images/jaeyoungLee/Main/pr...
JavaScript
addComment์™€ ๊ฐ™์ด ๊ธฐ๋Šฅ์˜ ์˜๋ฏธ๊ฐ€ ๋“ค์–ด๋‚˜๋Š” ์ด๋ฆ„์œผ๋กœ ํ•จ์ˆ˜๋ช…์„ ์ž‘์„ฑํ•ด์ฃผ์„ธ์š”!
@@ -0,0 +1,190 @@ +import React from 'react'; +import FeedComponent from './FeedComponent/FeedComponent'; +import './Main.scss'; +import explore from '../../../images/jaeyoungLee/Main/explore.jpg'; +import heart from '../../../images/jaeyoungLee/Main/heart.jpg'; +import profile from '../../../images/jaeyoungLee/Main/pr...
JavaScript
- ํ•ด๋‹น ํŒŒ์ผ์— ๋ฐ์ดํ„ฐ๋ฅผ ๋ฐฐ์—ด๋กœ ๋งŒ๋“ค์–ด์„œ map ํ•จ์ˆ˜ ์ ์šฉํ•˜๋ฉด ์ข‹์„ ๋ถ€๋ถ„์ด ๋งŽ์ด ๋ณด์ด๋„ค์š”! ์šฐ์„  ์ด ๊ฒƒ ๋ถ€ํ„ฐ ์ˆ˜์ •ํ•ด๋ณด์‹œ๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค. - https://www.notion.so/wecode/React-Refactoring-Check-List-aea297cf88ed4601b769e4b2c2cfd4e1#ef5cf308f13f48458f69175875c239e9
@@ -0,0 +1,17 @@ +import React from 'react'; +import './CommentComponent.scss'; + +class CommentComponent extends React.Component { + render() { + const { key, name, comment} = this.props + return ( + <li className="CommentComponent"> + {key} + <strong>{name}</strong> + {comment...
JavaScript
commentList๋Š” ul ํƒœ๊ทธ๋ฅผ ์˜๋ฏธํ•˜๋Š” ๊ฒƒ ๊ฐ™์•„์„œ props ์ด๋ฆ„์„ comment๋กœ ํ•˜๋Š”๊ฒŒ ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.
@@ -0,0 +1,412 @@ +* { + margin: 0; + padding: 0; +} +nav { + position: fixed; + width: 100%; + top: 0px; + left: 0px; + right: 0px; + background-color: #fff; + border-bottom: 1px solid #dbdbdb; + .navcontents { + width: 935px; + height: 54px; + background-color: #fff; + margin: 0 auto; + ...
Unknown
์ „์ฒด์ ์œผ๋กœ camelCase, snake_case ํ˜ผ์šฉํ•ด์„œ ์‚ฌ์šฉํ•˜๊ณ  ๊ณ„์‹ ๋ฐ ๋‹ค์Œ์—๋Š” ํŒ€์›๋“ค๊ณผ ์ •ํ•œ ๊ทœ์น™๋Œ€๋กœ ์ ์šฉํ•ด์ฃผ์„ธ์š”! ์ตœ์†Œํ•œ ๋‚ด๊ฐ€ ์ž‘์„ฑํ•œ ์ฝ”๋“œ ์•ˆ์—์„œ๋Š” ์ผ๊ด€์„ฑ์ด ์žˆ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
@@ -0,0 +1,85 @@ +* { + box-sizing: border-box; +} + +.loginContainer { + border: 2px solid #e6e6e6; + width: 350px; + height: 380px; + margin: 0 auto; + .logoName { + display: flex; + justify-content: center; + align-items: center; + width: 100%; + h1 { + font-family: "Lobster",...
Unknown
๋„ต! ์•Œ๊ฒ ์Šต๋‹ˆ๋‹ค!
@@ -3,7 +3,10 @@ <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> - <title>React App</title> + <meta name="description" content="Web site created using create-react-app"/> + <link href="https://fonts.googleapis.com/css2?family=Lobster&display=s...
Unknown
์‚ญ์ œํ–ˆ์Šต๋‹ˆ๋‹ค! ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค
@@ -0,0 +1,50 @@ +import React from 'react'; +import { withRouter } from 'react-router-dom'; +import './Login.scss'; + + +class LoginJaeyoung extends React.Component { + constructor () { + super(); + this.state = { + id: '', + pw : '', + }; + } + + handleInput = (e) ...
JavaScript
์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค!
@@ -0,0 +1,50 @@ +import React from 'react'; +import { withRouter } from 'react-router-dom'; +import './Login.scss'; + + +class LoginJaeyoung extends React.Component { + constructor () { + super(); + this.state = { + id: '', + pw : '', + }; + } + + handleInput = (e) ...
JavaScript
์™€...์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค!
@@ -0,0 +1,85 @@ +* { + box-sizing: border-box; +} + +.loginContainer { + border: 2px solid #e6e6e6; + width: 350px; + height: 380px; + margin: 0 auto; + .logoName { + display: flex; + justify-content: center; + align-items: center; + width: 100%; + h1 { + font-family: "Lobster",...
Unknown
์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค! ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹น
@@ -0,0 +1,190 @@ +import React from 'react'; +import FeedComponent from './FeedComponent/FeedComponent'; +import './Main.scss'; +import explore from '../../../images/jaeyoungLee/Main/explore.jpg'; +import heart from '../../../images/jaeyoungLee/Main/heart.jpg'; +import profile from '../../../images/jaeyoungLee/Main/pr...
JavaScript
์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค! ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค!
@@ -0,0 +1,13 @@ +<!DOCTYPE html> +<html lang="ko"> + <head> + <meta charset="UTF-8" /> + <meta http-equiv="X-UA-Compatible" content="IE=edge" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + + <title>์˜ํ™”๊ด€</title> + <script defer src="./bundle.js"></script></head> + <body> +...
Unknown
์•„๋งˆ ๋ฐฐํฌ ๋•Œ๋ฌธ์— dist ํด๋”๋ฅผ ์ด๋ ‡๊ฒŒ ์˜ฌ๋ ค์ฃผ์‹  ๊ฒƒ ๊ฐ™๋„ค์š” ใ…Žใ…Ž gh-pages ๋ธŒ๋žœ์น˜๋ฅผ ์ด์šฉํ•˜๋ฉด ์–ด๋–จ๊นŒ ์‹ถ์–ด์š”!
@@ -0,0 +1,20 @@ +import { createComponent } from "../createComponent"; +import { Header } from "./Header"; +import { Main } from "./Main"; + +export async function App() { + const header = await createComponent(Header); + const main = await createComponent(Main); + + const bindEvents = () => { + main.bindEvents(...
JavaScript
์ด์ œ๋ณด๋‹ˆ header๋ž‘ main ๋•Œ๋ฌธ์ด๊ตฐ์š” ใ…Žใ…Ž
@@ -0,0 +1,13 @@ +export let currentComponent = null; + +export async function createComponent(component, props) { + const previousComponent = currentComponent; + + currentComponent = { name: component.name, stateIndex: 0 }; + + const componentInstance = await component(props); + + currentComponent = previousCompon...
JavaScript
์—ฌ๊ธฐ์„œ previousComponent๊ฐ€ ํ•˜๋Š” ์—ญํ• ์€ ๋ฌด์—‡์ผ๊นŒ์š”?
@@ -0,0 +1,55 @@ +import { createComponent, currentComponent } from "../createComponent"; +import { fetchMovies } from "../fetch"; +import { useState } from "../state"; +import { MovieCard } from "./MovieCard"; + +export async function MovieList() { + const [page, setPage] = useState(1); + + const movieData = await f...
JavaScript
๋งŒ์•ฝ ํ•œ ํŽ˜์ด์ง€์— ์นดํ…Œ๊ณ ๋ฆฌ๋ณ„๋กœ ์—ฌ๋Ÿฌ ๊ฐœ์˜ ์˜ํ™”๋ชฉ๋ก์„ ๋„์›Œ์ค€๋‹ค๊ณ  ํ–ˆ์„ ๋•Œ, ์ด ์ปดํฌ๋„ŒํŠธ๋ฅผ ์žฌํ™œ์šฉํ•  ์ˆ˜ ์žˆ์„๊นŒ์š”?
@@ -0,0 +1,55 @@ +import { createComponent, currentComponent } from "../createComponent"; +import { fetchMovies } from "../fetch"; +import { useState } from "../state"; +import { MovieCard } from "./MovieCard"; + +export async function MovieList() { + const [page, setPage] = useState(1); + + const movieData = await f...
JavaScript
๋ชจ๋“  ๊ตฌ๊ฐ„์ด ๋‹ค async/await ์œผ๋กœ ๋งŒ๋“ค์–ด์ง„ ์ด์œ ๊ฐ€ ์—ฌ๊ธฐ์„œ ์ถœ๋ฐœ์ด ๋˜๋„ค์š”. ์ด ๋ถ€๋ถ„๋งŒ ๊ฐœ์„ ํ•˜๋ฉด async/awiat ์„ ์ „์ฒด์ ์œผ๋กœ ์ œ๊ฑฐํ• ์ˆ˜ ์žˆ์ง€ ์•Š์„๊นŒ์š”?
@@ -0,0 +1,55 @@ +import { createComponent, currentComponent } from "../createComponent"; +import { fetchMovies } from "../fetch"; +import { useState } from "../state"; +import { MovieCard } from "./MovieCard"; + +export async function MovieList() { + const [page, setPage] = useState(1); + + const movieData = await f...
JavaScript
movieData๋ฅผ props๋กœ ๋ฐ›์•„์˜ค๋ฉด ์–ด๋–จ๊นŒ์š”?
@@ -0,0 +1,13 @@ +export async function fetchMovies({ page }) { + const baseUrl = "https://api.themoviedb.org/3/movie/popular"; + const param = new URLSearchParams({ + page, + language: "ko-KR", + }); + + const response = await fetch(`${baseUrl}?${param}`, { + headers: { authorization: `Bearer ${process.en...
JavaScript
์‚ฌ์‹ค ๋ฐฐํฌ๋œ ์‚ฌ์ดํŠธ์˜ ๋„คํŠธ์›Œํฌ ์š”์ฒญ์„ ๊นŒ๋ณด๋ฉด API_KEY ๊ฐ€ ๊ทธ๋Œ€๋กœ ๋…ธ์ถœ๋˜๋Š”๊ฑธ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ต๋‹ˆ๋‹ค ใ…Žใ…Ž ์ด๊ฑด ์–ด๋–ป๊ฒŒ ๋ฐฉ์ง€ํ•  ์ˆ˜ ์žˆ์„๊นŒ์š”?
@@ -0,0 +1,13 @@ +export async function fetchMovies({ page }) { + const baseUrl = "https://api.themoviedb.org/3/movie/popular"; + const param = new URLSearchParams({ + page, + language: "ko-KR", + }); + + const response = await fetch(`${baseUrl}?${param}`, { + headers: { authorization: `Bearer ${process.en...
JavaScript
์—ฌ๊ธฐ์„œ await์„ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ๊ณผ ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š”๊ฒŒ ์–ด๋–ค ์ฐจ์ด๊ฐ€ ์žˆ๋Š”์ง€ ํ˜น์‹œ ์•„์‹ค๊นŒ์š”~?
@@ -0,0 +1,50 @@ +package christmas.domain; + +public enum Calendar { + WEEKEND(1, 2, 8, 9, 15, 16, 22, 23, 29, 30), + WEEKDAY(3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 17, 18, 19, 20, 21, 24, 25, 26, 27, 28, 31), + SPECIAL_DAY(3, 10, 17, 24, 25, 31); + + private final int[] days; + + Calendar(int... days) { + ...
Java
๋‚ ์งœ ๊ด€๋ จ๋œ ๋กœ์ง์€ `LocalDate`์™€ `DayOfWeek`๋ฅผ ์ ์šฉํ•˜๋ฉด ํ›จ์”ฌ ๊ฐ„๊ฒฐํ•˜๊ฒŒ ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค!!
@@ -0,0 +1,50 @@ +package christmas.domain; + +public enum Calendar { + WEEKEND(1, 2, 8, 9, 15, 16, 22, 23, 29, 30), + WEEKDAY(3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 17, 18, 19, 20, 21, 24, 25, 26, 27, 28, 31), + SPECIAL_DAY(3, 10, 17, 24, 25, 31); + + private final int[] days; + + Calendar(int... days) { + ...
Java
ํ•ด๋‹น ๋กœ์ง์€ depth๊ฐ€ 3์ด๊ธฐ์— ์ ์ ˆํ•œ ๋ฉ”์„œ๋“œ ์ถ”์ถœ, ๋˜๋Š” ๋ฆฌํŒฉํ† ๋ง์ด ํ•„์š”ํ•  ๊ฒƒ ๊ฐ™์€๋ฐ์š”. ์ฃผ๋ง์„ ํ™•์ธํ•˜๊ธฐ ์œ„ํ•ด์„œ ๋ชจ๋“  `Calandar`์˜ `enum` ์ƒ์ˆ˜๋ฅผ ํƒ์ƒ‰ํ•  ํ•„์š”๋Š” ์—†์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. ๋˜ํ•œ, ์ŠคํŠธ๋ฆผ์„ ์‚ฌ์šฉํ•œ๋‹ค๋ฉด ๋•Œ๋ก  ์ฒด์ธ๋“ค๋กœ ๊ฐ๊ฐ์˜ ๋‹จ๊ณ„๊ฐ€ ๊ตฌ๋ถ„๋˜๊ธฐ์— ๊ฐ€๋…์„ฑ์ด ์ข‹์•„์ง€๊ธฐ๋„ ํ•˜๋‹ˆ ์ŠคํŠธ๋ฆผ์„ ์ ๊ทน ํ™œ์šฉํ•˜์‹œ๋ฉด ๋” ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค! ```suggestion return Arrays.stream(WEEKEND.days) .anyMatch(day -> day == date); ```
@@ -0,0 +1,37 @@ +package christmas.domain; + +import java.util.Arrays; + +public enum Menu { + ์–‘์†ก์ด์ˆ˜ํ”„(6_000), ํƒ€ํŒŒ์Šค(5_500), ์‹œ์ €์ƒ๋Ÿฌ๋“œ(8_000), + ํ‹ฐ๋ณธ์Šคํ…Œ์ดํฌ(55_000), ๋ฐ”๋น„ํ๋ฆฝ(54_000), ํ•ด์‚ฐ๋ฌผํŒŒ์Šคํƒ€(35_000), ํฌ๋ฆฌ์Šค๋งˆ์ŠคํŒŒ์Šคํƒ€(25_000), + ์ดˆ์ฝ”์ผ€์ดํฌ(15_000), ์•„์ด์Šคํฌ๋ฆผ(5_000), + ์ œ๋กœ์ฝœ๋ผ(3_000), ๋ ˆ๋“œ์™€์ธ(60_000), ์ƒดํŽ˜์ธ(25_000); + + private final int price; +...
Java
์ด ๊ฒฝ์šฐ ๋ฉ”๋‰ด์˜ ์ถ”๊ฐ€ ๋ฐ ๋ณ€๊ฒฝ์ด ์žˆ์„ ๋•Œ ๋งˆ๋‹ค ๋ฉ”์„œ๋“œ ๋กœ์ง์˜ ๋ณ€๊ฒฝ ๋˜ํ•œ ํ•จ๊ป˜ ๋ฐœ์ƒํ•ด์•ผ ํ•˜๋Š”๋ฐ์š”. ๊ฐ ๋ฉ”๋‰ด์˜ ์ •๋ณด๊ฐ€ ๋ฉ”๋‰ด ํƒ€์ž…์„ ํ•จ๊ป˜ ์ €์žฅํ•˜๊ณ  ์žˆ๊ฑฐ๋‚˜, ๋ฉ”๋‰ด ํƒ€์ž…์ด ๋ฆฌ์ŠคํŠธ ํ˜•์‹์œผ๋กœ ๋ฉ”๋‰ด๋“ค์„ ์ €์žฅํ•˜๊ณ  ์žˆ๋„๋ก ํ•˜๋ฉด `public boolean isTypeOf(MenuType expectedType)`๊ณผ ๊ฐ™์€ ๋ฉ”์„œ๋“œ ํ•˜๋‚˜๋งŒ ์ œ๊ณตํ•ด ์ฃผ๋Š” ๊ฒƒ์œผ๋กœ ๋ณ€ํ™”์— ์‰ฝ๊ฒŒ ๋Œ€์‘ํ•  ์ˆ˜๊ฐ€ ์žˆ์–ด์š”!
@@ -0,0 +1,24 @@ +package christmas.domain; + +public enum DiscountType { + MIN_EVENT_CONDITION(10000), + CHAMPAGNE_CONDITION(120000), + CHAMPAGNE(25000), + SERVICE_MENU_CONDITION(1), + DDAY_CONDITION(25), + BASE_AMOUNT(900), + DAY_BONUS(100), + SPECIALDAY_CONDITION(2023), + INIT_COUNT(0), + ...
Java
์ˆซ์ž์˜ ์ž๋ฆฌ์ˆ˜๊ฐ€ ๋งŽ์•„์ง„๋‹ค๋ฉด _ ์œผ๋กœ ์ž๋ฆฌ์ˆ˜ ๊ตฌ๋ถ„์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค! ```suggestion CHAMPAGNE_CONDITION(120_000), ```
@@ -0,0 +1,36 @@ +package christmas.view; + +import camp.nextstep.edu.missionutils.Console; +import christmas.domain.Menu; +import christmas.domain.Order; +import christmas.domain.Reservation; +import christmas.exception.ValidatorException; +import christmas.validator.Validator; +import java.util.Map; + +public class I...
Java
`InputView`์— ์กด์žฌํ•˜๋Š” ์ฝ”๋“œ ํ๋ฆ„์˜ ์ค‘๋ณต์„ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ œ๊ฑฐํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค! ๋™์ž‘ ํŒŒ๋ผ๋ฏธํ„ฐํ™”๋กœ ๋ณ€๊ฒฝ์ด ํ•„์š”ํ•œ ๋กœ์ง์˜ ๋ถ€๋ถ„๋งŒ ์ค‘๋ณต๋˜๋Š” ํ๋ฆ„ ์‚ฌ์ด์— ์ „๋‹ฌํ•ด ์ฃผ๋Š” ๋ฐฉ์‹์ด์—์š”! ```suggestion public static Order createOrder() { return getResult(() -> { String input = Console.readLine(); Validator.isValidOrderFormat(input); Map<Menu, Intege...
@@ -0,0 +1,36 @@ +package christmas.view; + +import camp.nextstep.edu.missionutils.Console; +import christmas.domain.Menu; +import christmas.domain.Order; +import christmas.domain.Reservation; +import christmas.exception.ValidatorException; +import christmas.validator.Validator; +import java.util.Map; + +public class I...
Java
`View`์—์„œ ๋„๋ฉ”์ธ ํด๋ž˜์Šค ์ž์ฒด๊ฐ€ ์ƒ์„ฑ๋˜์–ด ๋ฐ˜ํ™˜๋˜๋Š” ๊ฒƒ์ด `View` ํด๋ž˜์Šค์— ๋„ˆ๋ฌด ๋งŽ์€ ์ฑ…์ž„์ด ์กด์žฌํ•˜๋Š” ๊ฒƒ ์ฒ˜๋Ÿผ ๋ณด์ด๊ธฐ๋„ ํ•˜๋Š”๋ฐ ์ด ๋ถ€๋ถ„์— ๋Œ€ํ•ด์„  ์–ด๋–ป๊ฒŒ ์ƒ๊ฐํ•˜์‹œ๋‚˜์š”?
@@ -0,0 +1,48 @@ +package christmas.view.messages; + +public enum PrintMessage { + INPUT_INTRODUCE("์•ˆ๋…•ํ•˜์„ธ์š”! ์šฐํ…Œ์ฝ” ์‹๋‹น 12์›” ์ด๋ฒคํŠธ ํ”Œ๋ž˜๋„ˆ์ž…๋‹ˆ๋‹ค."), + INPUT_RESERVATION("12์›” ์ค‘ ์‹๋‹น ์˜ˆ์ƒ ๋ฐฉ๋ฌธ ๋‚ ์งœ๋Š” ์–ธ์ œ์ธ๊ฐ€์š”? (์ˆซ์ž๋งŒ ์ž…๋ ฅํ•ด ์ฃผ์„ธ์š”!)"), + INPUT_ORDER("์ฃผ๋ฌธํ•˜์‹ค ๋ฉ”๋‰ด๋ฅผ ๋ฉ”๋‰ด์™€ ๊ฐœ์ˆ˜๋ฅผ ์•Œ๋ ค ์ฃผ์„ธ์š”. (e.g. ํ•ด์‚ฐ๋ฌผํŒŒ์Šคํƒ€-2,๋ ˆ๋“œ์™€์ธ-1,์ดˆ์ฝ”์ผ€์ดํฌ-1)"), + + OUTPUT_RESULT("12์›” 26์ผ์— ์šฐํ…Œ์ฝ” ์‹๋‹น์—์„œ...
Java
์—ฌ๋Ÿฌ ์ค„๋กœ ๊ตฌ์„ฑ๋œ `String`์€ `"""`๋กœ ๊ฐ์‹ธ์ค„ ์ˆ˜ ์žˆ๋Š” ๊ฒƒ์œผ๋กœ ์•Œ๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค!
@@ -0,0 +1,150 @@ +package christmas.validator; + +import christmas.domain.Menu; +import christmas.exception.ErrorMessage; +import christmas.exception.ValidatorException; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.regex.Matcher; +import java.uti...
Java
ํ•ด๋‹น ๋กœ์ง์€ 26๋ผ์ธ์œผ๋กœ ๊ตฌ์„ฑ๋˜์–ด ์žˆ์–ด์š”. ๊ฐ ๋‹จ๊ณ„๋ฅผ ๋ฉ”์„œ๋“œ๋กœ ์ถ”์ถœํ•ด ๋ณด๋Š” ๊ฑด ์–ด๋–จ๊นŒ์š”?
@@ -0,0 +1,50 @@ +package christmas.domain; + +public enum Calendar { + WEEKEND(1, 2, 8, 9, 15, 16, 22, 23, 29, 30), + WEEKDAY(3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 17, 18, 19, 20, 21, 24, 25, 26, 27, 28, 31), + SPECIAL_DAY(3, 10, 17, 24, 25, 31); + + private final int[] days; + + Calendar(int... days) { + ...
Java
์ƒ๊ฐํ•˜์ง€ ๋ชปํ–ˆ๋˜ ๋ถ€๋ถ„์ธ๋ฐ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค.
@@ -0,0 +1,50 @@ +package christmas.domain; + +public enum Calendar { + WEEKEND(1, 2, 8, 9, 15, 16, 22, 23, 29, 30), + WEEKDAY(3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 17, 18, 19, 20, 21, 24, 25, 26, 27, 28, 31), + SPECIAL_DAY(3, 10, 17, 24, 25, 31); + + private final int[] days; + + Calendar(int... days) { + ...
Java
ํ—‰.. ๊ทธ๋ ‡์ง€ ์•Š์•„๋„ Stream์— ๋Œ€ํ•ด ๊ณ„์† ๊ณต๋ถ€ํ•˜๊ณ  ์žˆ๋Š”๋ฐ ๋ณต์Šตํ•˜๋ฉฐ ์ ์šฉํ•ด๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค!
@@ -0,0 +1,24 @@ +package christmas.domain; + +public enum DiscountType { + MIN_EVENT_CONDITION(10000), + CHAMPAGNE_CONDITION(120000), + CHAMPAGNE(25000), + SERVICE_MENU_CONDITION(1), + DDAY_CONDITION(25), + BASE_AMOUNT(900), + DAY_BONUS(100), + SPECIALDAY_CONDITION(2023), + INIT_COUNT(0), + ...
Java
๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค!
@@ -0,0 +1,37 @@ +package christmas.domain; + +import java.util.Arrays; + +public enum Menu { + ์–‘์†ก์ด์ˆ˜ํ”„(6_000), ํƒ€ํŒŒ์Šค(5_500), ์‹œ์ €์ƒ๋Ÿฌ๋“œ(8_000), + ํ‹ฐ๋ณธ์Šคํ…Œ์ดํฌ(55_000), ๋ฐ”๋น„ํ๋ฆฝ(54_000), ํ•ด์‚ฐ๋ฌผํŒŒ์Šคํƒ€(35_000), ํฌ๋ฆฌ์Šค๋งˆ์ŠคํŒŒ์Šคํƒ€(25_000), + ์ดˆ์ฝ”์ผ€์ดํฌ(15_000), ์•„์ด์Šคํฌ๋ฆผ(5_000), + ์ œ๋กœ์ฝœ๋ผ(3_000), ๋ ˆ๋“œ์™€์ธ(60_000), ์ƒดํŽ˜์ธ(25_000); + + private final int price; +...
Java
์ข€ ๋” ๊ฐ์ฒด์ง€ํ–ฅ์ ์œผ๋กœ ์„ค๊ณ„๊ฐ€ ๊ฐ€๋Šฅํ•œ ๋ถ€๋ถ„์ด๋„ค์š”. ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค!
@@ -0,0 +1,150 @@ +package christmas.validator; + +import christmas.domain.Menu; +import christmas.exception.ErrorMessage; +import christmas.exception.ValidatorException; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.regex.Matcher; +import java.uti...
Java
15๋ผ์ธ์œผ๋กœ ์ค„์ด๋„๋กœ ๋…ธ๋ ฅํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค!
@@ -0,0 +1,36 @@ +package christmas.view; + +import camp.nextstep.edu.missionutils.Console; +import christmas.domain.Menu; +import christmas.domain.Order; +import christmas.domain.Reservation; +import christmas.exception.ValidatorException; +import christmas.validator.Validator; +import java.util.Map; + +public class I...
Java
์ตœ๊ทผ์— ๊ณต๋ถ€ํ•˜๋ฉฐ View๋Š” ์ปจํŠธ๋กค๋Ÿฌ์—์„œ Model์„ ๋ฐ›๊ธฐ๋งŒ ํ•ด์•ผ ํ•œ๋‹ค๋Š” ์ƒ๊ฐ์ด ๋“ค์—ˆ์Šต๋‹ˆ๋‹ค. ์ด ๋‹น์‹œ์—๋Š” View์—์„œ Model์„ ์ƒ์„ฑํ•ด์„œ ๋ฐ˜ํ™˜ํ•˜๋Š” ๋ฐฉ๋ฒ•์ด ์ €๋„ ๋งž๋Š”๊ฑด๊ฐ€? ์ƒ๊ฐ์„ ํ–ˆ์—ˆ๋Š”๋ฐ ๊ฐ’๋งŒ ๋ฐ˜ํ™˜ํ•ด์ฃผ๋Š” ํ˜•์‹์œผ๋กœ ์ˆ˜์ •ํ•ด๋ด์•ผ๊ฒ ๋„ค์š”. ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค.
@@ -0,0 +1,36 @@ +package christmas.view; + +import camp.nextstep.edu.missionutils.Console; +import christmas.domain.Menu; +import christmas.domain.Order; +import christmas.domain.Reservation; +import christmas.exception.ValidatorException; +import christmas.validator.Validator; +import java.util.Map; + +public class I...
Java
ํ—‰ ์ด๋Ÿฐ์‹์œผ๋กœ ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•  ์ˆ˜ ์žˆ๊ตฐ์š”. ์•Œ๋ ค์ฃผ์…”์„œ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค. ์ข€ ๋” ๊ณต๋ถ€ํ•ด์„œ ์ ์šฉํ•ด๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค!
@@ -0,0 +1,48 @@ +package christmas.view.messages; + +public enum PrintMessage { + INPUT_INTRODUCE("์•ˆ๋…•ํ•˜์„ธ์š”! ์šฐํ…Œ์ฝ” ์‹๋‹น 12์›” ์ด๋ฒคํŠธ ํ”Œ๋ž˜๋„ˆ์ž…๋‹ˆ๋‹ค."), + INPUT_RESERVATION("12์›” ์ค‘ ์‹๋‹น ์˜ˆ์ƒ ๋ฐฉ๋ฌธ ๋‚ ์งœ๋Š” ์–ธ์ œ์ธ๊ฐ€์š”? (์ˆซ์ž๋งŒ ์ž…๋ ฅํ•ด ์ฃผ์„ธ์š”!)"), + INPUT_ORDER("์ฃผ๋ฌธํ•˜์‹ค ๋ฉ”๋‰ด๋ฅผ ๋ฉ”๋‰ด์™€ ๊ฐœ์ˆ˜๋ฅผ ์•Œ๋ ค ์ฃผ์„ธ์š”. (e.g. ํ•ด์‚ฐ๋ฌผํŒŒ์Šคํƒ€-2,๋ ˆ๋“œ์™€์ธ-1,์ดˆ์ฝ”์ผ€์ดํฌ-1)"), + + OUTPUT_RESULT("12์›” 26์ผ์— ์šฐํ…Œ์ฝ” ์‹๋‹น์—์„œ...
Java
์•—! ๊นŒ๋จน๊ณ  ์žˆ์—ˆ๋„ค์š”. ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค!
@@ -0,0 +1,15 @@ +package christmas.controller; + +import christmas.domain.Order; +import christmas.domain.Reservation; +import christmas.domain.Result; + +public class EventPlannerController { + public static void run() { + Reservation reservation = ReservationController.inputReservation(); + Order or...
Java
์–ด๋–ค ์ด์œ ๋กœ static ๋ฉ”์„œ๋“œ๋ฅผ ์‚ฌ์šฉํ•˜์…จ์„๊นŒ์š”? static๋ฉ”์„œ๋“œ๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ํŽธ๋ฆฌํ•  ์ˆ˜ ์žˆ๋Š”๋ฐ ๋‹ค๋ฅธ ์‚ฌ์ด๋“œ ์ดํŽ™ํŠธ๊ฐ€ ์—†์„๊นŒ์š”?
@@ -0,0 +1,20 @@ +package christmas.controller; + +import christmas.domain.Order; +import christmas.domain.Reservation; +import christmas.domain.Result; +import christmas.view.OutputView; + +public class ResultController { + + public static Result createResult(Order order, Reservation reservation) { + OutputV...
Java
์—ฌ๋Ÿฌ ์ปจํŠธ๋กค๋Ÿฌ ํด๋ž˜์Šค๋ฅผ ๋ถ„๋ฆฌํ•˜์‹  ์ด์œ ๊ฐ€ ๋ฌด์—‡์ธ๊ฐ€์š”?
@@ -0,0 +1,50 @@ +package christmas.domain; + +public enum Calendar { + WEEKEND(1, 2, 8, 9, 15, 16, 22, 23, 29, 30), + WEEKDAY(3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 17, 18, 19, 20, 21, 24, 25, 26, 27, 28, 31), + SPECIAL_DAY(3, 10, 17, 24, 25, 31); + + private final int[] days; + + Calendar(int... days) { + ...
Java
calendar๋ผ๋Š” enum์ด 2023๋…„ 12์›”์˜ ๋‚ ์งœ๋งŒ ์žˆ์œผ๋‹ˆ ์กฐ๊ธˆ ์–ด์ƒ‰ํ•œ ๊ฒƒ ๊ฐ™์•„์š” ํด๋ž˜์Šค ๋ช…์„ ์ข€ ๋” ๋ช…ํ™•ํ•˜๊ฒŒ ํ•˜๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์š”
@@ -0,0 +1,29 @@ +package christmas.domain; + +public enum EventBadge { + SANTA(20000, "์‚ฐํƒ€"), + TREE(10000, "ํŠธ๋ฆฌ"), + STAR(5000, "๋ณ„"), + NONE(0, "์—†์Œ"); + + private final int threshold; + private final String description; + + EventBadge(int threshold, String description) { + this.threshold = t...
Java
์ด๊ฒƒ๋„ ์ŠคํŠธ๋ฆผ์œผ๋กœ ํ•ด๊ฒฐํ•  ์ˆ˜ ์žˆ๊ฒ ๋„ค์š” ํœด๋Œ€ํฐ์œผ๋กœ ํ•˜๋Š” ๊ฒƒ์ด๋ผ ์ฝ”๋“œ์น˜๊ธฐ๊ฐ€ ๋ถˆํŽธํ•ด์„œ ์ŠคํŠธ๋ฆผ, filter, findAny, orElseGet ์„ ์‚ฌ์šฉํ•˜๋ฉด ๋  ๊ฒƒ ๊ฐ™์•„์š”!
@@ -0,0 +1,37 @@ +package christmas.domain; + +import java.util.Arrays; + +public enum Menu { + ์–‘์†ก์ด์ˆ˜ํ”„(6_000), ํƒ€ํŒŒ์Šค(5_500), ์‹œ์ €์ƒ๋Ÿฌ๋“œ(8_000), + ํ‹ฐ๋ณธ์Šคํ…Œ์ดํฌ(55_000), ๋ฐ”๋น„ํ๋ฆฝ(54_000), ํ•ด์‚ฐ๋ฌผํŒŒ์Šคํƒ€(35_000), ํฌ๋ฆฌ์Šค๋งˆ์ŠคํŒŒ์Šคํƒ€(25_000), + ์ดˆ์ฝ”์ผ€์ดํฌ(15_000), ์•„์ด์Šคํฌ๋ฆผ(5_000), + ์ œ๋กœ์ฝœ๋ผ(3_000), ๋ ˆ๋“œ์™€์ธ(60_000), ์ƒดํŽ˜์ธ(25_000); + + private final int price; +...
Java
์—ฌ๊ธฐ๋งŒ ๋ณ€์ˆ˜๋ช…์„ ํ•œ๊ธ€๋กœ ํ•˜์‹  ์ด์œ ๊ฐ€ ์žˆ๋‚˜์š”? ์ €๋Š” ํ•œ๊ธ€ ๋ณ€์ˆ˜๊ฐ€ ๊ฐ€๋…์„ฑ์ด ์ข‹๋‹ค๊ณ  ์ƒ๊ฐํ•˜์ง€๋งŒ ์ž๋™์™„์„ฑ์—์„œ ๋ถˆํŽธํ•˜๋”๋ผ๊ณ ์š” ๊ทธ๋ฆฌ๊ณ  ์•„๋ž˜์— is~~~ ๋ฉ”์„œ๋“œ๊ฐ€ ๋งŽ์€๋ฐ ๋ฉ”๋‰ด์— ๊ฐ€๊ฒฉ๊ณผ ํƒ€์ž…๋„ ๊ฐ™์ด ๊ฐ€์ง€๊ณ  ์žˆ๋‹ค๋ฉด ์ข€ ๋” ๊น”๋”ํ•˜๊ฒŒ ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•  ์ˆ˜ ์žˆ์„ ๊ฒƒ ๊ฐ™๋„ค์š”
@@ -0,0 +1,25 @@ +package christmas.domain; + +import christmas.validator.Validator; +import java.util.HashMap; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class Order { + + private Map<Menu, Integer> orderedItems; + + private Order(Map<Menu, Integer> ordered...
Java
์™œ ๊ฐ™์€ ๋ฉ”์„œ๋“œ๊ฐ€ ๋‘๊ฐœ์ผ๊นŒ์š”?
@@ -0,0 +1,20 @@ +package christmas.domain; + +import christmas.validator.Validator; + +public class Reservation { + private final int date; + + private Reservation(int date) { + Validator.isInRange(date); + this.date = date; + } + + public static Reservation from(int date) { + return n...
Java
์—ฌ๊ธฐ๋„ ๊ทธ๋ ‡๋„ค์š” ์–ด๋–ค ์ด์œ ๋กœ ์ƒ์„ฑ์ž๋ฅผ private์œผ๋กœ ๋ง‰์•„๋‘์‹œ๊ณ  static ๋ฉ”์„œ๋“œ๋ฅผ ์‚ฌ์šฉํ•˜์…จ์„๊นŒ์š”
@@ -0,0 +1,171 @@ +package christmas.domain; + +import static christmas.domain.DiscountType.*; + +import java.util.Map; + +public class Result { + + private int totalBeforeDiscount; + private int serviceMenu; + private int dDayDiscount; + private int weekdayDiscount; + private int weekendDiscount; + p...
Java
ํ•œ ๊ฐ์ฒด์— ๋„ˆ๋ฌด ๋งŽ์€ ํ•„๋“œ๋ฅผ ์„ ์–ธํ–ˆ๋Š”๋ฐ ์ฑ…์ž„์„ ๋ถ„๋ฆฌํ•  ์ˆ˜ ์žˆ์ง€ ์•Š์„๊นŒ์š”?
@@ -0,0 +1,150 @@ +package christmas.validator; + +import christmas.domain.Menu; +import christmas.exception.ErrorMessage; +import christmas.exception.ValidatorException; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.regex.Matcher; +import java.uti...
Java
validator๋ผ๋Š” static ๋ฉ”์„œ๋“œ๋งŒ ๊ฐ€์ง€๊ณ  ์žˆ๋Š” ํด๋ž˜์Šค๋ฅผ ๋งŒ๋“œ์‹  ์ด์œ ๊ฐ€ ๊ถ๊ธˆํ•ฉ๋‹ˆ๋‹ค
@@ -0,0 +1,87 @@ +package christmas.domain; + +import static org.junit.jupiter.api.Assertions.*; + +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +class CalendarTest { + + @DisplayName("ํ‰์ผ์— ํ•ด๋‹นํ•˜๋Š” ๋‚ ์งœ๋ฅผ ์ž…๋ ฅํ–ˆ์„ ๋•Œ ๊ฒ€์ฆ") + @Test + public void testIsWeekday() { + // Given + ...
Java
assertJ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์‚ฌ์šฉํ•˜์‹œ๋Š” ๊ฒƒ์„ ์ถ”์ฒœ๋“œ๋ฆฝ๋‹ˆ๋‹ค
@@ -0,0 +1,88 @@ +package christmas.domain; + +import static org.junit.jupiter.api.Assertions.*; + +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +class MenuTest { + + @DisplayName("์–‘์†ก์ด ์ˆ˜ํ”„ ๊ฐ€๊ฒฉ ๋™์ผํ•œ์ง€ ๊ฒ€์ฆ") + @Test + public void testGetPrice() { + // Given + Menu menu...
Java
softAssertion์ด๋‚˜ assertAll์— ๋Œ€ํ•ด ์•Œ์•„๋ณด์‹œ๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์š”
@@ -0,0 +1,241 @@ +# ๋ฏธ์…˜ - ํฌ๋ฆฌ์Šค๋งˆ์Šค ํ”„๋กœ๋ชจ์…˜ ๐ŸŽ„ + +## โœ…ย ๊ธฐ๋Šฅ ๋ชฉ๋ก + +### 1. ๊ฒŒ์ž„ ์‹œ์ž‘ + +- [X] ์‹๋‹น ์˜ˆ์ƒ ๋ฐฉ๋ฌธ ๋‚ ์งœ๋ฅผ ์ž…๋ ฅ ๋ฐ›๋Š”๋‹ค. + - [X] ๋ฐฉ๋ฌธํ•  ๋‚ ์งœ๋Š” 1 ์ด์ƒ 31 ์ดํ•˜์˜ ์ˆซ์ž๋งŒ ์ž…๋ ฅ ๋ฐ›๋Š”๋‹ค. + - [X] ์ž˜๋ชป๋œ ๊ฐ’์„ ์ž…๋ ฅํ•œ ๊ฒฝ์šฐ ์˜ˆ์™ธ ์ฒ˜๋ฆฌํ•œ๋‹ค. + +- [X] ๊ณ ๊ฐ์—๊ฒŒ ์•ˆ๋‚ดํ•  ์ด๋ฒคํŠธ ์ฃผ์˜ ์‚ฌํ•ญ์„ ์ถœ๋ ฅํ•œ๋‹ค. + +- [X] ์ฃผ๋ฌธํ•  ๋ฉ”๋‰ด์™€ ๊ฐœ์ˆ˜๋ฅผ ์ž…๋ ฅ ๋ฐ›๋Š”๋‹ค. + - [X] ๋ฉ”๋‰ดํŒ์— ์—†๋Š” ๋ฉ”๋‰ด๋ฅผ ์ž…๋ ฅ ์‹œ ์˜ˆ์™ธ ์ฒ˜๋ฆฌํ•œ๋‹ค. + - [X] ๋ฉ”๋‰ด์˜ ๊ฐœ์ˆ˜๋Š” 1 ์ด์ƒ์˜ ์ˆซ์ž๊ฐ€ ์•„๋‹ ๊ฒฝ์šฐ ์˜ˆ์™ธ ์ฒ˜๋ฆฌํ•œ๋‹ค...
Unknown
๊ฒŒ์ž„์ด๋ผ๊ณ  ํ•˜์‹  ์ด์œ ๊ฐ€ ๋”ฐ๋กœ ์žˆ์„๊นŒ์š”?
@@ -0,0 +1,15 @@ +package christmas.controller; + +import christmas.domain.Order; +import christmas.domain.Reservation; +import christmas.domain.Result; + +public class EventPlannerController { + public static void run() { + Reservation reservation = ReservationController.inputReservation(); + Order or...
Java
static ๋ฉ”์„œ๋“œ๋งŒ ์žˆ๋Š” ํด๋ž˜์Šค๋ผ๋ฉด ์ธ์Šคํ„ด์Šค๋ฅพ ๋งŒ๋“ค ํ•„์š”๊ฐ€ ์—†์„ํ…๋ฐ์š”, ์ด๋ฅผ ์–ด๋–ป๊ฒŒ ๋ฐฉ์ง€ํ•  ์ˆ˜ ์žˆ์„๊นŒ์š”?
@@ -0,0 +1,117 @@ +package christmas.view; + +import static christmas.view.messages.PrintMessage.*; + +import christmas.domain.Menu; +import christmas.domain.Order; +import christmas.domain.Result; +import christmas.view.messages.PrintMessage; +import java.util.Map; + +public class OutputView { + private static fina...
Java
๋ถˆํ•„์š”ํ•œ ๊ฐœํ–‰์€ ์ง€์›Œ์ฃผ์„ธ์š”..!
@@ -1,6 +1,9 @@ package bridge; +import bridge.domain.constant.MoveCommand; import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.IntStream; /** * ๋‹ค๋ฆฌ์˜ ๊ธธ์ด๋ฅผ ์ž…๋ ฅ ๋ฐ›์•„์„œ ๋‹ค๋ฆฌ๋ฅผ ์ƒ์„ฑํ•ด์ฃผ๋Š” ์—ญํ• ์„ ํ•œ๋‹ค. @@ -18,6 +21,10 @@ public BridgeMaker(BridgeNumberGenerator bridgeNumberGenerator) { * @return...
Java
์ด ๋ถ€๋ถ„ ๊ฐ์ฒด์ง€ํ–ฅ์ ์œผ๋กœ ์„ค๊ณ„๋ฅผ ์ž˜ํ•˜์…จ๋„ค์š”!! ๊ฐ€๋…์„ฑ ์•„์ฃผ ๊ตฟ์ž…๋‹ˆ๋‹ค
@@ -0,0 +1,95 @@ +package bridge.controller; + +import bridge.domain.model.Bridge; +import bridge.domain.model.BridgeGame; +import bridge.domain.constant.MoveCommand; +import bridge.domain.constant.RetryCommand; +import bridge.domain.constant.Status; +import bridge.view.InputView; +import bridge.view.OutputView; + +pub...
Java
depth๊ฐ€ 3์ด๋„ค์š” ใ…œใ…œ ํ•จ์ˆ˜๋ฅผ ๋ถ„๋ฆฌํ•˜์…”์•ผํ• ๊ฑฐ ๊ฐ™์Šต๋‹ˆ๋‹ค
@@ -0,0 +1,41 @@ +package bridge.domain.model; + +import bridge.domain.constant.MoveCommand; +import bridge.domain.constant.Status; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +public class GameDashboard { + + private final List<Status> upResult = new ArrayList<>(); + pri...
Java
์ด ๋ถ€๋ถ„ ์ข‹๋„ค์š”! ์ €๋„ Map ์„ ์™ธ๋ถ€๋กœ ๋บ„์ง€ ๋ง์ง€ ๊ณ ๋ฏผํ•˜๋‹ค๊ฐ€ ์•ˆ๋บ๋Š”๋ฐ ๋บ€ ํ›„์— Player๊ฐ€ ๊ฐ€์ง€๊ณ  ์žˆ๋Š” ๊ธฐ๋Šฅ๋“ค์„ ์˜ฎ๊ฒจ์ฃผ๋Š”๊ฒŒ ๋” ์ข‹์•˜์„๊ฑฐ ๊ฐ™์Šต๋‹ˆ๋‹ค.
@@ -0,0 +1,95 @@ +package bridge.controller; + +import bridge.domain.model.Bridge; +import bridge.domain.model.BridgeGame; +import bridge.domain.constant.MoveCommand; +import bridge.domain.constant.RetryCommand; +import bridge.domain.constant.Status; +import bridge.view.InputView; +import bridge.view.OutputView; + +pub...
Java
์ด ๋ถ€๋ถ„์„ BridgeGame์—์„œ ์ง„ํ–‰ํ•˜๋Š” ๋ฐฉ๋ฒ•์€ ์—†์—ˆ์„๊นŒ์š”???
@@ -0,0 +1,64 @@ +package bridge.view; + +import static bridge.view.ViewMessage.*; + +import bridge.domain.model.BridgeGame; +import bridge.domain.model.GameDashboard; +import bridge.domain.constant.Status; +import java.util.List; +import java.util.stream.Collectors; + +/** + * ์‚ฌ์šฉ์ž์—๊ฒŒ ๊ฒŒ์ž„ ์ง„ํ–‰ ์ƒํ™ฉ๊ณผ ๊ฒฐ๊ณผ๋ฅผ ์ถœ๋ ฅํ•˜๋Š” ์—ญํ• ์„ ํ•œ๋‹ค. + */ +pu...
Java
๋งค๊ฐœ๊ฐ’์„ BridgeGame์ด ์•„๋‹Œ GameDashBoard๋กœ ๋ฐ›์•˜์œผ๋ฉด ์–ด๋• ์„๊นŒ์š”???
@@ -0,0 +1,23 @@ +package bridge.view; + +public enum ViewMessage { + START_MESSAGE("๋‹ค๋ฆฌ ๊ฑด๋„ˆ๊ธฐ ๊ฒŒ์ž„์„ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค."), + INPUT_BRIDGE_SIZE_MESSAGE("๋‹ค๋ฆฌ์˜ ๊ธธ์ด๋ฅผ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”."), + INPUT_MOVE_COMMAND_MESSAGE("์ด๋™ํ•  ์นธ์„ ์„ ํƒํ•ด์ฃผ์„ธ์š”. (์œ„: U, ์•„๋ž˜: D)"), + INPUT_RETRY_COMMAND_MESSAGE("๊ฒŒ์ž„์„ ๋‹ค์‹œ ์‹œ๋„ํ• ์ง€ ์—ฌ๋ถ€๋ฅผ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”. (์žฌ์‹œ๋„: R, ์ข…๋ฃŒ: Q)"), + RESULT_MESSAG...
Java
StringJoiner ๋ฅผ ์“ฐ๋ฉด ํ•ด๋‹น ๋ถ€๋ถ„์„ ํ•œ๋ฒˆ์— ํ•ด๊ฒฐํ•  ์ˆ˜ ์žˆ๋”๋ผ๊ตฌ์š”!
@@ -0,0 +1,18 @@ +const GATHERING_TYPE = ["DALLAEMFIT", "OFFICE_STRETCHING", "MINDFULNESS", "WORKATION"] as const; + +export type ScoresQuery = { + gatheringId?: number; + type?: (typeof GATHERING_TYPE)[number]; +}; + +export type ScoresResponse = { + teamId: number; + gatheringId: number; + type?: (typeof GATHERI...
TypeScript
_:warning: Potential issue_ **ScoresQuery์˜ type ํ•„๋“œ ํƒ€์ž…์ด ์ž˜๋ชป ์ •์˜๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.** ํ˜„์žฌ `type?: typeof GATHERING_TYPE`๋Š” ๋ฐฐ์—ด ํƒ€์ž…์„ ์˜๋ฏธํ•˜๋ฉฐ, ์ด๋Š” ์˜๋„ํ•œ ํƒ€์ž…์ด ์•„๋‹ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ˆ˜์ •ํ•˜๋Š” ๊ฒƒ์„ ์ œ์•ˆ๋“œ๋ฆฝ๋‹ˆ๋‹ค: ```diff export type ScoresQuery = { gatheringId?: number; - type?: typeof GATHERING_TYPE; + type?: (typeof GATHERING_TYPE)[number]; }; ``` ๋˜๋Š” ๋” ...
@@ -0,0 +1,18 @@ +const GATHERING_TYPE = ["DALLAEMFIT", "OFFICE_STRETCHING", "MINDFULNESS", "WORKATION"] as const; + +export type ScoresQuery = { + gatheringId?: number; + type?: (typeof GATHERING_TYPE)[number]; +}; + +export type ScoresResponse = { + teamId: number; + gatheringId: number; + type?: (typeof GATHERI...
TypeScript
_:warning: Potential issue_ **ScoresResponse์—๋„ ๋™์ผํ•œ ํƒ€์ž… ์ด์Šˆ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.** ScoresResponse์˜ type ํ•„๋“œ๋„ ๊ฐ™์€ ๋ฌธ์ œ๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ˆ˜์ •ํ•ด ์ฃผ์„ธ์š”: ```diff export type ScoresResponse = { teamId: number; gatheringId: number; - type?: typeof GATHERING_TYPE; + type?: (typeof GATHERING_TYPE)[number]; averageScore: number; oneSt...
@@ -0,0 +1,31 @@ +import { fetchReviewsScores } from "../_utils/api"; +import ScoreProgressBar from "./ScoreProgressBar"; +import Score from "@/components/Score"; + +export default async function ReviewsAverage() { + const [scores] = await fetchReviewsScores(); + + const { averageScore, oneStar, twoStars, threeStars,...
Unknown
_:warning: Potential issue_ **map ํ•จ์ˆ˜์— key prop์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.** React ๋ฐฐ์—ด ๋ Œ๋”๋ง ์‹œ ๊ฐ ์š”์†Œ๋ฅผ ์‹๋ณ„ํ•˜๊ธฐ ์œ„ํ•œ key prop์ด ๋ˆ„๋ฝ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ˆ˜์ •ํ•˜๋Š” ๊ฒƒ์„ ์ œ์•ˆ๋“œ๋ฆฝ๋‹ˆ๋‹ค: ```diff {stars.map((count, index) => ( - <ScoreProgressBar score={5 - index} stars={count} total={total} /> + <ScoreProgressBar + key={5 - index} + score={5 - index} + stars={...
@@ -0,0 +1,31 @@ +import { fetchReviewsScores } from "../_utils/api"; +import ScoreProgressBar from "./ScoreProgressBar"; +import Score from "@/components/Score"; + +export default async function ReviewsAverage() { + const [scores] = await fetchReviewsScores(); + + const { averageScore, oneStar, twoStars, threeStars,...
Unknown
_:warning: Potential issue_ **๋ฐ์ดํ„ฐ ๋กœ๋”ฉ ๋ฐ ์—๋Ÿฌ ์ƒํƒœ ์ฒ˜๋ฆฌ๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.** ๋น„๋™๊ธฐ ๋ฐ์ดํ„ฐ ํŽ˜์นญ ์‹œ ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ๋Š” ์—๋Ÿฌ์™€ ๋กœ๋”ฉ ์ƒํƒœ์— ๋Œ€ํ•œ ์ฒ˜๋ฆฌ๊ฐ€ ๋ˆ„๋ฝ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์—๋Ÿฌ ์ฒ˜๋ฆฌ๋ฅผ ์ถ”๊ฐ€ํ•˜๋Š” ๊ฒƒ์„ ์ œ์•ˆ๋“œ๋ฆฝ๋‹ˆ๋‹ค: ```diff export default async function ReviewsAverage() { - const [scores] = await fetchReviewsScores(); + try { + const [scores] = await fetchReviewsScores(); + } catch (e...
@@ -0,0 +1,18 @@ +const GATHERING_TYPE = ["DALLAEMFIT", "OFFICE_STRETCHING", "MINDFULNESS", "WORKATION"] as const; + +export type ScoresQuery = { + gatheringId?: number; + type?: (typeof GATHERING_TYPE)[number]; +}; + +export type ScoresResponse = { + teamId: number; + gatheringId: number; + type?: (typeof GATHERI...
TypeScript
์ฝ”๋“œ๋ž˜๋น— ๋ง๋Œ€๋กœ type์ด (typeof GATHERING_TYPE)[number]; ๊ฐ€ ๋˜์–ด์•ผ ํ•  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.
@@ -0,0 +1,31 @@ +import { fetchReviewsScores } from "../_utils/api"; +import ScoreProgressBar from "./ScoreProgressBar"; +import Score from "@/components/Score"; + +export default async function ReviewsAverage() { + const [scores] = await fetchReviewsScores(); + + const { averageScore, oneStar, twoStars, threeStars,...
Unknown
์—ฌ๊ธฐ key prop์ด ํ•„์š”ํ•  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค... ๊ทผ๋ฐ ์ฝ”๋“œ๋ž˜๋น—์ด ์ด๋ฏธ ๋ฆฌ๋ทฐํ•ด์คฌ๋„ค์š”
@@ -0,0 +1,141 @@ +package com.fourseason.delivery.domain.review.service; + +import com.fourseason.delivery.domain.order.entity.Order; +import com.fourseason.delivery.domain.order.entity.OrderStatus; +import com.fourseason.delivery.domain.order.repository.OrderRepository; +import com.fourseason.delivery.domain.review.d...
Java
collect(Collectors.toList()) ๋ณด๋‹ค๋Š” Stream.toList()๋ฅผ ์ ์šฉํ•˜๋Š” ๊ฒƒ์ด ์–ด๋–จ๊นŒ์š”? toList()๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด UnmodifiableList ๋ฅผ ๋ฐ˜ํ™˜ํ•ด List ์— ๋Œ€ํ•œ ๋ณ€๊ฒฝ์ด ๋ถˆ๊ฐ€๋Šฅํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์ค‘๊ฐ„์— ์ˆ˜์ •๋  ์œ„ํ—˜์„ ์ค„์ผ ์ˆ˜ ์žˆ์„๊ฑฐ ๊ฐ™์•„์š”!
@@ -0,0 +1,19 @@ +package com.fourseason.delivery.domain.review.dto.request; + + +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.PositiveOrZero; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; + +public record ReviewRequestDto( + String co...
Java
dto์˜ ๊ฒฝ์šฐ record๋กœ ์ž‘์„ฑํ•˜๊ธฐ๋กœ ํ–ˆ๋˜๊ฑธ๋กœ ๊ธฐ์–ตํ•ฉ๋‹ˆ๋‹น.
@@ -0,0 +1,17 @@ +package com.fourseason.delivery.domain.review.repository; + +import com.fourseason.delivery.domain.order.entity.Order; +import com.fourseason.delivery.domain.review.entity.Review; +import com.fourseason.delivery.domain.shop.entity.Shop; +import org.springframework.data.jpa.repository.JpaRepository; + ...
Java
๋ฐ์ดํ„ฐ๋“ค์„ ์‹ค์ œ๋กœ ์‚ญ์ œํ•˜์ง€ ์•Š๊ณ  ๋…ผ๋ฆฌ์  ์‚ญ์ œ ์ฒ˜๋ฆฌ ํ•˜๊ธฐ๋กœ ํ–ˆ๋˜ ๋ถ€๋ถ„์ด๋ผ findByIdAndDeletedAtIsNotNull ๊ณผ ๊ฐ™์€ ํ˜•ํƒœ๋กœ ์กฐํšŒํ•ด์ฃผ์…”์•ผ... ์ €๋„ ์ด ๋ถ€๋ถ„ ์ฒ˜์Œ์— ๊นŒ๋จน์—ˆ์Šต๋‹ˆ๋‹ค.
@@ -0,0 +1,62 @@ +package com.fourseason.delivery.domain.review.controller; + +import com.fourseason.delivery.domain.review.dto.request.ReviewRequestDto; +import com.fourseason.delivery.domain.review.dto.response.ReviewResponseDto; +import com.fourseason.delivery.domain.review.service.ReviewService; +import lombok.Requ...
Java
`String order_id` ๋Š” ์•„์ง `Order`๋ฅผ ํ‘ธ์‹œ ์•ˆํ–ˆ๊ธฐ ๋•Œ๋ฌธ์— `UUID` ํƒ€์ž…์œผ๋กœ ๋ฐ”๊พธ์ง€ ์•Š์œผ์‹ ๊ฑธ๊นŒ์š”?
@@ -0,0 +1,62 @@ +package com.fourseason.delivery.domain.review.controller; + +import com.fourseason.delivery.domain.review.dto.request.ReviewRequestDto; +import com.fourseason.delivery.domain.review.dto.response.ReviewResponseDto; +import com.fourseason.delivery.domain.review.service.ReviewService; +import lombok.Requ...
Java
์ด ๋ถ€๋ถ„์€ ์ •ํ™•ํžˆ ์ž˜ ๋ชจ๋ฅด๊ฒ ์ง€๋งŒ, `reviewId` ์ฒ˜๋Ÿผ ์นด๋ฉœ์ผ€์ด์Šค๋กœ ์ž‘์„ฑ๋˜๋Š” ๊ฒƒ์ด ๋” ์ข‹์„ ๊ฒƒ ๊ฐ™๋‹ค๋Š” ์ƒ๊ฐ์ด ๋“ค์–ด์š”. ๊ทธ๋ ‡๊ฒŒ ์ƒ๊ฐํ•˜๋Š” ์ด์œ ๋Š” `@PathVariable` ์—์„œ๋„ `String review_id` ์™€ ๊ฐ™์ด ์‚ฌ์šฉ๋˜๊ธฐ ๋•Œ๋ฌธ์ด์—์š”.
@@ -0,0 +1,28 @@ +package com.fourseason.delivery.domain.review.controller; + +import com.fourseason.delivery.domain.review.dto.response.ReviewResponseDto; +import com.fourseason.delivery.domain.review.repository.ReviewRepository; +import com.fourseason.delivery.domain.review.service.ReviewService; +import lombok.Requi...
Java
`/api/shops` ๋ถ€๋ถ„์€ ๊ณตํ†ต์œผ๋กœ ํ•ด๋„ ๋  ๊ฒƒ ๊ฐ™์•„์š”! ์•„๋‹ˆ๋ฉด, `ShopController`์™€ ๊ฒน์น˜๊ธฐ ๋•Œ๋ฌธ์ผ๊นŒ์š”?
@@ -0,0 +1,17 @@ +package com.fourseason.delivery.domain.review.repository; + +import com.fourseason.delivery.domain.order.entity.Order; +import com.fourseason.delivery.domain.review.entity.Review; +import com.fourseason.delivery.domain.shop.entity.Shop; +import org.springframework.data.jpa.repository.JpaRepository; + ...
Java
์†Œํ”„ํŠธ ๋”œ๋ฆฌํŠธ์— ๋Œ€ํ•ด ์ฐพ์•„๋ณด๋‹ˆ๊นŒ JPA์—์„œ `@SQLDelte` ๋‚˜ `@Where`๋ฅผ ์—”ํ‹ฐํ‹ฐ ํด๋ž˜์Šค์— ๋ถ™์ž„์œผ๋กœ์จ, ์‰ฝ๊ฒŒ ๊ตฌํ˜„ํ•  ์ˆ˜ ์žˆ๋Š” ๊ฒƒ ๊ฐ™์•„์š”. ๊ฐ™์ด ๋…ผ์˜ํ•ด๋ณด๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. ๋ชจ๋“  ์‚ญ์ œ ์ฟผ๋ฆฌ๋ฉ”์„œ๋“œ๋ฅผ update๋กœ ํ•˜๊ฑฐ๋‚˜, ์กฐํšŒ ์‹œ `DeleteAtIsNotNull` ์„ ์ ‘๋ฏธ์‚ฌ๋กœ ๋ถ™์ธ๋‹ค๋ฉด, ๋‚˜์ค‘์— ์ •์ฑ…์ด ๋ฐ”๋€Œ์—ˆ์„ ๋•Œ, ์ฝ”๋“œ ์ˆ˜์ •์ด ๋ฒˆ๊ฑฐ๋กœ์šธ ๊ฒƒ ๊ฐ™์•„์š”. ์–ด๋А ํ•œ ๊ณณ์—์„œ ์‚ญ์ œ ์ •์ฑ…์— ๋”ฐ๋ผ ๊ณตํ†ต์œผ๋กœ ์ฒ˜๋ฆฌ๋˜๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™๋‹ค๋Š” ์ƒ๊ฐ์ด ๋“ค์—ˆ์Šต๋‹ˆ๋‹ค.
@@ -0,0 +1,14 @@ +package step1; + +public class Print { + + private int calculateResult; + + public Print(int calculateResult) { + this.calculateResult = calculateResult; + } + + public void printResult() { + System.out.println("calculateResult = " + calculateResult); + } +}
Java
Print๊ฐ€ ํ•˜๋‚˜์˜ ๊ณ„์‚ฐ๊ฒฐ๊ณผ๋ฅผ ์ƒํƒœ๋กœ ๊ฐ€์ง€๋„๋ก ๊ตฌํ˜„ํ•˜์…จ๋„ค์š”! ๋งŒ์•ฝ Print๋ฅผ ํ†ตํ•ด ๋˜ ๋‹ค๋ฅธ ๊ณ„์‚ฐ ๊ฒฐ๊ณผ๋ฅผ ์ถœ๋ ฅํ•ด์•ผํ•œ๋‹ค๋ฉด ์–ด๋–ป๊ฒŒ ๋ ๊นŒ์š”? Print๋ผ๋Š” ํด๋ž˜์Šค์˜ ์ฑ…์ž„์— ๋งž๋Š” ์—ญํ• ์„ ํ•˜๊ณ  ์žˆ๋‹ค๊ณ  ๋ณผ ์ˆ˜ ์žˆ์„๊นŒ์š”?
@@ -0,0 +1,50 @@ +package step1; + +import java.util.List; + +public class Calculator { + + private CalculatorResource calculatorResource; + + public Calculator(String stringCalculatorSentence) { + this.calculatorResource = new CalculatorResource(stringCalculatorSentence); + } + + public int calculat...
Java
java์˜ Enum ํด๋ž˜์Šค๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ์ƒํƒœ์™€ ํ–‰์œ„๋ฅผ ํ•œ๊ณณ์—์„œ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ๋Š”๋ฐ์š”! ๋งํฌ๋ฅผ ๋ณด์‹œ๊ณ  ์ฐธ๊ณ ํ•˜์…”์„œ enum ํด๋ž˜์Šค๋ฅผ ์‚ฌ์šฉํ•ด๋ณด๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค :) https://techblog.woowahan.com/2527/
@@ -0,0 +1,50 @@ +package step1; + +import java.util.List; + +public class Calculator { + + private CalculatorResource calculatorResource; + + public Calculator(String stringCalculatorSentence) { + this.calculatorResource = new CalculatorResource(stringCalculatorSentence); + } + + public int calculat...
Java
๋ฉ”์„œ๋“œ์˜ ํŒŒ๋ผ๋ฏธํ„ฐ์˜ ๊ฐœ์ˆ˜๋ฅผ 2๊ฐœ ์ดํ•˜๋กœ ๋ฆฌํŒฉํ„ฐ๋งํ•ด๋ณด๋Š”๊ฑด ์–ด๋–จ๊นŒ์š”? ํด๋ฆฐ ์ฝ”๋“œ ์ฑ…์—์„œ๋Š” ๋ฉ”์„œ๋“œ์˜ ํŒŒ๋ผ๋ฏธํ„ฐ ๊ฐœ์ˆ˜๋Š” 0~2๊ฐœ๊ฐ€ ์ ์ ˆํ•˜๋ฉฐ 4๊ฐœ ์ด์ƒ์€ ๋ฌด์กฐ๊ฑด์ ์œผ๋กœ ํ”ผํ•ด์•ผํ•œ๋‹ค๊ณ  ์ด์•ผ๊ธฐํ•ฉ๋‹ˆ๋‹ค. ํŒŒ๋ผ๋ฏธํ„ฐ์˜ ๊ฐœ์ˆ˜๊ฐ€ ๋งŽ์„ ์ˆ˜๋ก ํ•˜๋‚˜์˜ ๋ฉ”์„œ๋“œ์—์„œ ํ•˜๋Š” ์ผ์ด ๋งŽ์•„์งˆ ์ˆ˜ ์žˆ๊ณ  ์ฝ”๋“œ๋ฅผ ์ฝ๊ธฐ ์–ด๋ ค์›Œ์ง€๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค :)
@@ -0,0 +1,50 @@ +package step1; + +import java.util.List; + +public class Calculator { + + private CalculatorResource calculatorResource; + + public Calculator(String stringCalculatorSentence) { + this.calculatorResource = new CalculatorResource(stringCalculatorSentence); + } + + public int calculat...
Java
`๊ณ„์‚ฐ๊ธฐ`๊ฐ€ ํ•˜๋‚˜์˜ `๊ณ„์‚ฐ๊ธฐ ์ž์›`์„ ์ƒํƒœ๋กœ ๊ฐ€์ง€๋„๋ก ๊ตฌํ˜„ํ•˜์…จ๋„ค์š” ! ๋งŒ์•ฝ ๊ณ„์‚ฐ๊ธฐ๊ฐ€ ๋˜ ๋‹ค๋ฅธ ์ž์›์— ๋Œ€ํ•œ ๊ณ„์‚ฐ์„ ํ•ด์•ผํ•˜๋Š” ์ƒํ™ฉ์ด๋ผ๋ฉด ์–ด๋–ป๊ฒŒ ํ•ด์•ผํ• ๊นŒ์š”? ํ˜„์žฌ ์ƒํƒœ์—์„œ๋Š” ํ•˜๋‚˜์˜ ๊ณ„์‚ฐ๊ธฐ ๊ฐ์ฒด๊ฐ€ ํ•˜๋‚˜์˜ ์ž์›๋งŒ์„ ๊ณ„์‚ฐํ•  ์ˆ˜ ์žˆ๋Š”๋ฐ์š”. ์—ฌ๋Ÿฌ ๊ฐœ์˜ ์ž์›์— ๋Œ€ํ•ด ๊ณ„์‚ฐํ•  ์ˆ˜ ์žˆ๋„๋ก ๊ฐœ์„ ํ•ด๋ณด๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค :)
@@ -0,0 +1,64 @@ +package step1; + +import java.util.ArrayList; +import java.util.List; + +public class CalculatorResource { + + private String sentence; + private String[] sentenceArray; + private List<Integer> numberArray; + private List<String> operatorArray; + + public List<Integer> getNumberArray() ...
Java
CalculatorResource ํด๋ž˜์Šค ๋„ค์ด๋ฐ์€ ์ถ”์ƒํ™”๊ฐ€ ๋งŽ์ด ๋˜์–ด ์žˆ๋Š” ํด๋ž˜์Šค ๋ช…์ž…๋‹ˆ๋‹ค. ํด๋ž˜์Šค ๋‚ด๋ถ€๋ฅผ ๋ณด์ง€ ์•Š์œผ๋ฉด ์–ด๋–ค ์ƒํƒœ๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ๋Š”์ง€ ์œ ์ถ”ํ•˜๊ธฐ ํž˜๋“ญ๋‹ˆ๋‹ค. ์กฐ๊ธˆ ๋” ๊ตฌ์ฒด์ ์ธ ํด๋ž˜์Šค ๋ช…์„ ๋งŒ๋“ค์–ด๋ณด๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์š” :)
@@ -0,0 +1,64 @@ +package step1; + +import java.util.ArrayList; +import java.util.List; + +public class CalculatorResource { + + private String sentence; + private String[] sentenceArray; + private List<Integer> numberArray; + private List<String> operatorArray; + + public List<Integer> getNumberArray() ...
Java
๊ฐ์ฒด๊ฐ€ ์ƒ์„ฑ๋œ ์ดํ›„์— ๋‘ ๋ณ€์ˆ˜๋Š” ์‚ฌ์šฉ๋˜์ง€ ์•Š๊ณ  ์žˆ๋„ค์š”! ๐Ÿค” ๊ทธ๋ ‡๋‹ค๋ฉด ๊ณ„์‚ฐ๊ธฐ ์ž์›ํด๋ž˜์Šค์—์„œ sentence์™€ sentenceArray๋ฅผ ์ƒํƒœ๋กœ ๊ฐ€์ง€๊ณ  ์žˆ์„ ํ•„์š”๊ฐ€ ์žˆ์„๊นŒ์š”?
@@ -0,0 +1,21 @@ +import { EOL as LINE_SEPARATOR } from 'os'; +import { TIME, UNITS } from './system.js'; + +export const OUTPUT_MESSAGES = Object.freeze({ + intro: `์•ˆ๋…•ํ•˜์„ธ์š”! ์šฐํ…Œ์ฝ” ์‹๋‹น ${TIME.month}${UNITS.month} ์ด๋ฒคํŠธ ํ”Œ๋ž˜๋„ˆ์ž…๋‹ˆ๋‹ค.`, + outro: `์ผ์— ์šฐํ…Œ์ฝ” ์‹๋‹น์—์„œ ๋ฐ›์„ ์ด๋ฒคํŠธ ํ˜œํƒ ๋ฏธ๋ฆฌ ๋ณด๊ธฐ!`, +}); + +export const INPUT_MESSAGES = Object.freeze({ +...
JavaScript
์ด๋ฒคํŠธ๋ฅผ ์ง„ํ–‰ํ•˜๋Š” ๋‹ฌ์ด ๋ฐ”๋€Œ๋Š” ๊ฒƒ์„ ๊ณ ๋ คํ•ด `TIME.month` ์ƒ์ˆ˜๋ฅผ ๋”ฐ๋กœ ์ƒ์„ฑํ•œ ์ ์ด ์ธ์ƒ ๊นŠ์–ด์š”! `12์›” ์ด๋ฒคํŠธ ์ฐธ์—ฌ ๊ณ ๊ฐ์˜ 5%๊ฐ€ ๋‚ด๋…„ 1์›” ์ƒˆํ•ด ์ด๋ฒคํŠธ์— ์žฌ์ฐธ์—ฌํ•˜๋Š” ๊ฒƒ` ์ด๋ฉ”์ผ์˜ ์ด๋Ÿฌํ•œ ๋ฌธ์žฅ์ด ์ €๋„ ๋ˆˆ์— ๋ฐŸํžˆ๊ธด ํ–ˆ๋Š”๋ฐ ๊ทธ๋ƒฅ ๊ธฐ๋Šฅ ๊ตฌํ˜„์— ์ง‘์ค‘ํ•˜๋А๋ผ ์žŠ์–ด๋ฒ„๋ ธ๊ฑฐ๋“ ์š”.. ์ •๋ง ์„ฌ์„ธํ•˜๊ฒŒ ๊ณ ๋ฏผํ•˜์‹œ๋ฉด์„œ ๊ตฌํ˜„ํ•˜์‹  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค! ๊ฐํƒ„๋งŒ ๋‚˜์˜ค๋„ค์š” ๐Ÿ˜ฎ
@@ -0,0 +1,28 @@ +export const TIME = Object.freeze({ + year: '2023', + month: '12', + dateFormat: `2023-12-`, +}); + +export const PROMOTION_TITLES = Object.freeze({ + 1: '์ƒˆํ•ด', + 12: 'ํฌ๋ฆฌ์Šค๋งˆ์Šค', +}); + +export const SYMBOLS = Object.freeze({ + comma: ',', + dash: '-', + colon: ':', + blank: '', +}); + +export co...
JavaScript
ํ™•์žฅ์„ ๊ณ ๋ คํ•˜์…จ๊ตฐ์š”! ๋ฐฐ์šฐ๊ณ  ๊ฐ‘๋‹ˆ๋‹ค ๐Ÿ‘ ์‹ค์ œ ํšŒ์‚ฌ์˜€๋‹ค๋ฉด ์ด๋ฒคํŠธ ๊ธฐํš์ž๊ฐ€ ๋„ˆ๋ฌด ์ข‹์•„ํ•  ๊ฒƒ ๊ฐ™์•„์š”!
@@ -0,0 +1,28 @@ +export const TIME = Object.freeze({ + year: '2023', + month: '12', + dateFormat: `2023-12-`, +}); + +export const PROMOTION_TITLES = Object.freeze({ + 1: '์ƒˆํ•ด', + 12: 'ํฌ๋ฆฌ์Šค๋งˆ์Šค', +}); + +export const SYMBOLS = Object.freeze({ + comma: ',', + dash: '-', + colon: ':', + blank: '', +}); + +export co...
JavaScript
๊ทธ๋ƒฅ ๊ฐํƒ„๋งŒ ๋‚˜์˜ค๋„ค์š”... ํ• ๋ง์ด ์—†๋„ค์š”... ์ตœ์ข… ์ฝ”ํ…Œ ์ด๋Ÿฐ๋ถ„์ด ๊ฐ€์‹œ๋Š”๊ตฌ๋‚˜...
@@ -0,0 +1,87 @@ +import VisitDate from '../domain/VisitDate.js'; +import Order from '../domain/Order.js'; +import InputView from '../views/InputView.js'; +import OutputView from '../views/OutputView.js'; +import EventPlanner from '../domain/EventPlanner.js'; +import Save from '../domain/Save.js'; + +class EventControl...
JavaScript
์—๋Ÿฌ๋ฉ”์‹œ์ง€ ์ถœ๋ ฅ ๊ธฐ๋Šฅ์„ `outputView`๊ฐ€ ์ฑ…์ž„์„ ๋งก๋„๋ก ํ–ˆ๊ตฐ์š”! ๋ฆฌํŒฉํ† ๋ง ํ•  ๋•Œ ์ €๋„ ๋ฐ˜์˜ํ•ด๋ด์•ผ๊ฒ ์Šต๋‹ˆ๋‹ค ๐Ÿ‘
@@ -0,0 +1,32 @@ +import { ERROR_MESSAGES } from '../constants/messages.js'; +import { TIME } from '../constants/system.js'; +import validationErrorHandler from '../errors/index.js'; +import { isPositiveInteger, isValidDate } from '../validators/index.js'; + +class VisitDate { + #visitDate; + + constructor(date) { + ...
JavaScript
๊ธฐ๋ณธ ์ œ๊ณต๋˜๋Š” `Date` ๊ฐ์ฒด๋ฅผ ํ™œ์šฉํ•  ์ƒ๊ฐ์€ ๋ชปํ–ˆ๋„ค์š”! ์ด๋ ‡๊ฒŒ ์‹ ๋ฐ•ํ•œ ๋ฐฉ๋ฒ•๋„ ์žˆ๋‹ค๋Š” ๊ฒƒ์„ ์•Œ์•„๊ฐ‘๋‹ˆ๋‹ค ๐Ÿ‘
@@ -0,0 +1,9 @@ +import { ERROR_MESSAGES } from '../constants/messages.js'; + +class AppError extends Error { + constructor(message) { + super(`${ERROR_MESSAGES.prefix} ${message}`); + } +} + +export default AppError;
JavaScript
์—๋Ÿฌ๋ฅผ ์ƒ์†ํ•˜์…จ๊ตฐ์š”! ์ •๋ง ์ฒด๊ณ„์ ์ธ ์ฝ”๋“œ์ธ ๊ฒƒ ๊ฐ™์•„์š”! `Error`๋ฅผ ์ƒ์†ํ•ด `AppError` ํด๋ž˜์Šค๋ฅผ ๋”ฐ๋กœ ๋งŒ๋“œ์‹œ๊ฒŒ ๋œ ๊ณ„๊ธฐ๋ฅผ ์—ฌ์ญค๋ด๋„ ๋ ๊นŒ์š”?
@@ -0,0 +1,12 @@ +import MENUS from '../constants/menus.js'; + +/** + * ๋ฉ”๋‰ด ์ด๋ฆ„์„ ์ž…๋ ฅํ•˜๋ฉด ์นดํ…Œ๊ณ ๋ฆฌ ๋‚ด ๋ฉ”๋‰ด์˜ ๊ฐ€๊ฒฉ ๊ฐ’์„ ๋ฐ˜ํ™˜ + * @param {string} menu - ๋ฉ”๋‰ด ์ด๋ฆ„ + * @returns {number | undefined} + */ +const menuPriceFinder = menu => { + return Object.values(MENUS).find(category => menu in category)[menu]; +}; + +export default menuPriceFinde...
JavaScript
๊ธฐ๋Šฅ์„ ๊ตฌํ˜„ํ•˜๋‹ค๋ณด๋ฉด ๋ฉ”๋‰ด์˜ ๊ฐ€๊ฒฉ์„ ์ž์ฃผ ๊ฐ€์ ธ๋‹ค ์“ฐ๊ฒŒ ๋˜๋Š”๋ฐ utils ํด๋”์— ๋”ฐ๋กœ ํ•จ์ˆ˜๋ฅผ ๊ตฌํ˜„ํ•ด๋‘๋‹ˆ ์ข‹์€ ๊ฒƒ ๊ฐ™์•„์š”! ๋ฐฐ์›Œ๊ฐ‘๋‹ˆ๋‹ค ๐Ÿ‘
@@ -0,0 +1,15 @@ +import { UNITS } from '../constants/system.js'; + +/** + * number type์˜ ๊ฐ€๊ฒฉ์„ ์ž…๋ ฅ๋ฐ›์•„ ๊ฐ€๊ฒฉ์„ ๋ณ€ํ™˜ ํ›„ '์›'์„ ํฌํ•จํ•œ string type์œผ๋กœ ๋ณ€ํ™˜ + * 20000์ด๋ผ๋Š” ๋งค๊ฐœ๋ณ€์ˆ˜๋ฅผ ํ†ตํ•ด '20,000์›'์„ ๋ฐ˜ํ™˜ + * @param {number} price ๊ฐ€๊ฒฉ + * @returns {string} + */ +const priceFormatter = price => { + const formattedPrice = new Intl.NumberFormat().format(pr...
JavaScript
`Intl.NumberFormat` ๋ฅผ ์ฒ˜์Œ ์ ‘ํ–ˆ๋Š”๋ฐ ์ด๋ ‡๊ฒŒ ๊ฐ€๊ฒฉ์„ ํฌ๋งทํ•˜๋Š” ๊ฐ„๋‹จํ•œ ๋ฐฉ๋ฒ•์ด ์žˆ์—ˆ๊ตฐ์š”! ์ €๋Š” ์ •๊ทœํ‘œํ˜„์‹์œผ๋กœ ๊ตฌํ˜„ํ–ˆ๋Š”๋ฐ ์ƒˆ๋กœ์šด ๋ฐฉ๋ฒ•์„ ์•Œ์•„๊ฐ€๊ฒŒ ๋ผ์„œ ์ข‹์•„์š”!
@@ -0,0 +1,68 @@ +import { ERROR_MESSAGES } from '../constants/messages.js'; +import { SYMBOLS } from '../constants/system.js'; +import validationErrorHandler from '../errors/index.js'; +import { isValidMenuName } from '../validators/index.js'; +import { isOnlyBeverage } from '../validators/is-valid-menu/name.js'; +imp...
JavaScript
๋ฉ”์†Œ๋“œ ์ˆœ์„œ๋ฅผ ์ž˜ ์ •ํ•˜์…”์„œ ์ดํ•ดํ•˜๊ธฐ ์ •๋ง ์ข‹์•˜์Šต๋‹ˆ๋‹ค! ์–ด, ์ด ๋ฉ”์†Œ๋“œ๋Š” ๋ญ์ง€? ์‹ถ์œผ๋ฉด ๋ฐ”๋กœ ๋ฐ‘์— ๊ทธ ๋ฉ”์†Œ๋“œ๊ฐ€ ์žˆ์–ด์„œ ์ˆ ์ˆ  ์ฝํ˜”์–ด์š”! ๋ฉ”์†Œ๋“œ ์ˆœ์„œ๋„ ์ปจ๋ฒค์…˜์ด๋ผ๊ณ  ํ•˜๋Š” ๊ณตํ†ต ํ”ผ๋“œ๋ฐฑ์ด ์žˆ์—ˆ๋Š”๋ฐ ๊ทธ๊ฑธ ์ž˜ ๋ฐ˜์˜ํ•˜์‹  ๊ฒƒ ๊ฐ™์•„์š” ๐Ÿ‘
@@ -0,0 +1,57 @@ +import { GIVEAWAYS, TITLES } from '../constants/events.js'; +import { NONE } from '../constants/system.js'; +import menuPriceFinder from '../utils/menuPriceFinder.js'; + +class Benefit { + #isFitGiveaway; + + #benefitList; + + #totalPrice; + + constructor(discountList, isFitGiveaway) { + this.#...
JavaScript
3์ฃผ์ฐจ ๊ณตํ†ต ํ”ผ๋“œ๋ฐฑ์— `ํ•„๋“œ์˜ ์ˆ˜๋ฅผ ์ค„์ด๊ธฐ ์œ„ํ•ด ๋…ธ๋ ฅํ•œ๋‹ค`๋ผ๋Š” ๋ง์ด ์žˆ์—ˆ์ฃ ! `#benefitList`์™€ `#totalPrice`๋Š” ์ƒ์„ฑ์ž์˜ ์ธ์ˆ˜๋กœ ์ „๋‹ฌ๋œ `discountList`, `isFitGiveaway`์œผ๋กœ ๋งŒ๋“ค ์ˆ˜ ์žˆ๊ธฐ ๋•Œ๋ฌธ์— ๊ผญ ํ•„๋“œ๋กœ ์„ ์–ธํ•ด์•ผ ํ•˜๋Š” ๊ฑด์ง€์— ๋Œ€ํ•œ ์˜๋ฌธ์ด ์ƒ๊น๋‹ˆ๋‹ค! ํ•„๋“œ์˜ ๊ฐœ์ˆ˜๋ฅผ ์ตœ๋Œ€ํ•œ ์ค„์ด๋Š” ๊ฒŒ ์ •๋ง ์˜ณ์€ ๊ฒƒ์ธ์ง€ ๊ณ ๋ฏผ์ด ๋งŽ์•„์ง€๋„ค์š” ํฌํƒœ๋‹˜ ์ƒ๊ฐ์€ ์–ด๋– ์‹ ๊ฐ€์š”?!
@@ -0,0 +1,106 @@ +import { BADGES, GIVEAWAYS } from '../constants/events.js'; +import { NONE } from '../constants/system.js'; +import menuPriceFinder from '../utils/menuPriceFinder.js'; +import Benefit from './Benefit.js'; +import Discount from './Discount.js'; + +class EventPlanner { + #benefit; + + #preTotalPrice;...
JavaScript
`switch`๋ฌธ์„ ์‚ฌ์šฉํ•˜๋‹ˆ ์ •๋ง ๊น”๋”ํ•œ ๊ฒƒ ๊ฐ™์•„์š”!
@@ -0,0 +1,43 @@ +import fs from 'fs'; +import { FILE_PATH } from '../constants/system.js'; + +class Save { + #eventPlanner; + + #filePath; + + constructor(eventPlanner) { + this.#eventPlanner = eventPlanner; + this.#filePath = FILE_PATH; + this.#writeData(); + } + + // ๊ธฐ์กด JSON ๋ฐ์ดํ„ฐ์— ์‹ ๊ทœ ๋ฐ์ดํ„ฐ๋ฅผ ์ถ”๊ฐ€ํ•˜๊ณ  ์ €์žฅ + #wr...
JavaScript
๋ฐฉ๋ฌธํ•œ ์†๋‹˜๋“ค์— ๋Œ€ํ•œ ๋ฐ์ดํ„ฐ๋ฅผ ์ €์žฅํ•˜๋Š” ๊ธฐ๋Šฅ์€ ์ƒ๊ฐ ๋ชป ํ–ˆ๋Š”๋ฐ ๋„ˆ๋ฌด ์ข‹์€ ์•„์ด๋””์–ด์ž…๋‹ˆ๋‹ค โœจ
@@ -0,0 +1,21 @@ +import { EOL as LINE_SEPARATOR } from 'os'; +import { TIME, UNITS } from './system.js'; + +export const OUTPUT_MESSAGES = Object.freeze({ + intro: `์•ˆ๋…•ํ•˜์„ธ์š”! ์šฐํ…Œ์ฝ” ์‹๋‹น ${TIME.month}${UNITS.month} ์ด๋ฒคํŠธ ํ”Œ๋ž˜๋„ˆ์ž…๋‹ˆ๋‹ค.`, + outro: `์ผ์— ์šฐํ…Œ์ฝ” ์‹๋‹น์—์„œ ๋ฐ›์„ ์ด๋ฒคํŠธ ํ˜œํƒ ๋ฏธ๋ฆฌ ๋ณด๊ธฐ!`, +}); + +export const INPUT_MESSAGES = Object.freeze({ +...
JavaScript
์ด๋ฒˆ ๋ฏธ์…˜์—์„œ๋Š” ํ™•์žฅ์„ฑ์„ ์‹ ๊ฒฝ์“ฐ๊ณ ์ž ๋…ธ๋ ฅํ–ˆ๋Š”๋ฐ ์•Œ์•„๋ด์ฃผ์…”์„œ ๊ฐ์‚ฌํ•  ๋”ฐ๋ฆ„์ž…๋‹ˆ๋‹ค! ๐Ÿ™‚
@@ -0,0 +1,32 @@ +import { ERROR_MESSAGES } from '../constants/messages.js'; +import { TIME } from '../constants/system.js'; +import validationErrorHandler from '../errors/index.js'; +import { isPositiveInteger, isValidDate } from '../validators/index.js'; + +class VisitDate { + #visitDate; + + constructor(date) { + ...
JavaScript
์•„๋งˆ ๋” ์ข‹์€ ๋ฐฉ๋ฒ•์ด ์žˆ์„๊ฒ๋‹ˆ๋‹ค! :) ์ €๋„ `Date` ๊ฐ์ฒด๋ฅผ ์ž˜ ํ™œ์šฉํ•˜์ง€ ๋ชปํ•œ ๊ฒƒ ๊ฐ™์•„์„œ ๋” ๊ณต๋ถ€ํ•ด๋ณด๋ ค๊ตฌ์š”!
@@ -0,0 +1,9 @@ +import { ERROR_MESSAGES } from '../constants/messages.js'; + +class AppError extends Error { + constructor(message) { + super(`${ERROR_MESSAGES.prefix} ${message}`); + } +} + +export default AppError;
JavaScript
์•„๋ฌด๋ž˜๋„ `[ERROR]` ๋ผ๋Š” prefix๋ฅผ ํ†ตํ•ด ์—๋Ÿฌ ๋ฉ”์‹œ์ง€๋ฅผ ์ •์˜ํ•˜๋Š” ๊ณผ์ •์—์„œ ๋งŒ๋“ค๊ฒŒ ๋˜์—ˆ๋Š”๋ฐ์š”, ์ง€์ • ์—๋Ÿฌ ํด๋ž˜์Šค๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ์ถ”ํ›„์— ๋” ์‰ฝ๊ฒŒ ํ™•์žฅํ•  ์ˆ˜ ์žˆ๋Š” ์žฅ์ ์ด ์žˆ์ง€ ์•Š์„๊นŒ๋ผ๋Š” ์ƒ๊ฐ์ด์—ˆ์Šต๋‹ˆ๋‹ค!
@@ -0,0 +1,15 @@ +import { UNITS } from '../constants/system.js'; + +/** + * number type์˜ ๊ฐ€๊ฒฉ์„ ์ž…๋ ฅ๋ฐ›์•„ ๊ฐ€๊ฒฉ์„ ๋ณ€ํ™˜ ํ›„ '์›'์„ ํฌํ•จํ•œ string type์œผ๋กœ ๋ณ€ํ™˜ + * 20000์ด๋ผ๋Š” ๋งค๊ฐœ๋ณ€์ˆ˜๋ฅผ ํ†ตํ•ด '20,000์›'์„ ๋ฐ˜ํ™˜ + * @param {number} price ๊ฐ€๊ฒฉ + * @returns {string} + */ +const priceFormatter = price => { + const formattedPrice = new Intl.NumberFormat().format(pr...
JavaScript
`Intl.NumberFormat` ์ƒ์„ฑ์ž๋ฅผ ํ†ตํ•ด ๋‹ค์–‘ํ•œ ํ†ตํ™” ์„œ์‹์„ ๋ณ€ํ™˜ํ•  ์ˆ˜ ์žˆ๋”๋ผ๊ตฌ์š”! [Intl.NumberFormat](https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) ๋„์›€์ด ๋ ๊นŒ์‹ถ์–ด ๋งํฌ ์ฒจ๋ถ€ํ•ด๋‘์—ˆ์Šต๋‹ˆ๋‹ค :)
@@ -0,0 +1,57 @@ +import { GIVEAWAYS, TITLES } from '../constants/events.js'; +import { NONE } from '../constants/system.js'; +import menuPriceFinder from '../utils/menuPriceFinder.js'; + +class Benefit { + #isFitGiveaway; + + #benefitList; + + #totalPrice; + + constructor(discountList, isFitGiveaway) { + this.#...
JavaScript
์ €๋Š” ์šฐ์„  ๋ชจ๋“  ๋ฉ”์„œ๋“œ์™€ ํ•„๋“œ๋ฅผ `private`์œผ๋กœ ์ง€์ •ํ•˜๊ณ ๋‚˜์„œ, ์ดํ›„์— `public`์œผ๋กœ ์ ‘๊ทผ์„ ํ•ด์•ผ๋งŒ ํ• ๋•Œ `public`์œผ๋กœ ์ „ํ™˜ํ•˜์˜€์Šต๋‹ˆ๋‹ค! ์•„๋งˆ ์ด ๊ณผ์ •์—์„œ๋„ ํด๋ž˜์Šค ๋‚ด ๋ฉ”์„œ๋“œ๊ฐ€ `benefitList`์™€ `totalPrice`๋ฅผ ์‚ฌ์šฉํ•จ์— ์žˆ์–ด์„œ `public`์œผ๋กœ ์ „ํ™˜ํ•˜์ง€ ์•Š์•„๋„ ๋  ๊ฒƒ ๊ฐ™์•„์„œ ๊ทธ๋Œ€๋กœ ๋‘์—ˆ์Šต๋‹ˆ๋‹ค :) ์ €๋„ ์‚ฌ์‹ค ๊ณตํ†ต ํ”ผ๋“œ๋ฐฑ์„ ๋ฐ›๊ณ ๋‚˜์„œ ํ•„๋“œ์˜ ๊ฐœ์ˆ˜๋ฅผ ์ตœ๋Œ€ํ•œ ์ค„์—ฌ์•ผํ•˜๋Š” ๊ฒƒ๊ณผ, ์ตœ๋Œ€ํ•œ private ํ•„๋“œ๋กœ ์บก์Аํ™”๋ฅผ ๊ตฌํ˜„ํ•˜๋Š” ๊ฒƒ ์‚ฌ์ด์—์„œ์˜ ์ค‘๊ฐ„์ ์„ ๋ชป์ฐพ๊ฒ ๋”๋ผ๊ตฌ์š”! ์ข‹์€ ํ”ผ๋“œ๋ฐฑ ๊ฐ์‚ฌ๋“œ๋ฆฝ๋‹ˆ๋‹ค! `benefitList`์™€ `totalP...