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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.