code stringlengths 41 34.3k | lang stringclasses 8
values | review stringlengths 1 4.74k |
|---|---|---|
@@ -0,0 +1,87 @@
+import React, { useState } from 'react';
+import { AiFillHeart, AiOutlineComment, AiOutlineUpload } from 'react-icons/ai';
+import { BiDotsHorizontalRounded } from 'react-icons/bi';
+import { GrBookmark } from 'react-icons/gr';
+import './Feeds.scss';
+import Comments from './Comment/Comments';
+
+exp... | Unknown | .ํด๋น ๋ถ๋ถ๋ ์ข ๋ ๋ฐ๋ณต๋๋ ๋จ์ด๋ฅผ ์ค์ผ ์ ์์์ง ๊ณ ๋ฏผํด๋ด
์๋ค.
๋๋ถ์ด ๋ถํ์ํ state๊ฐ๋ ๋ณด์ด๋ค์! ์ ๋ฆฌ๋ทฐ๋ฅผ ์ฐธ๊ณ ํด ์์ ํด์ฃผ์ธ์! |
@@ -0,0 +1,101 @@
+@use '../../../../styles/mixin.scss' as mixin;
+@use '../../../../styles/color.scss' as clr;
+
+.feeds {
+ position: relative;
+ top: 77px;
+ width: 60%;
+ margin-bottom: 80px;
+ background: #fff;
+
+ .top_menu {
+ @include mixin.flex($justify: space-between, $align: center);
+ height: 82... | Unknown | class๋ช
์ ์ด๋ค ํํ๊ฐ ์ข์๊น์?!
ํด๋น class๋ช
์ '๋์'์ ๋ํ๋ด๊ธฐ์ ํด๋์ค ๋ค์๋ณด๋ค๋ ํจ์๋ช
์ฒ๋ผ ๋๊ปด์ง๋๋ค! |
@@ -1,5 +1,98 @@
import React from 'react';
+import { useState, useEffect } from 'react';
+import { useNavigate } from 'react-router-dom';
+import './Login.scss';
-export default function Login() {
- return <div>Hello, Hyeonze!</div>;
-}
+const Login = () => {
+ const [idInput, setIdInput] = useState('');
+ const... | Unknown | - ๋ถํ์ํ ์ฃผ์์ฒ๋ฆฌ๋ ์ญ์ ํด์ฃผ์ธ์!
- ๋๋ถ์ด์ className ์์ฒด๋ฅผ '์'์ผ๋ก ์ง์ ํ๋ ๊ฒ์ ์ข์ ๋ค์ด๋ฐ์ ์๋ ๊ฒ ๊ฐ์ต๋๋ค. ์ด๋ค ๋ค์ด๋ฐ์ด ์ ํฉํ ์ง ๊ณ ๋ฏผํ์
์ , ํด๋น ์์๊ฐ ๋ฌด์์ธ์ง๋ฅผ ์ ๋ํ๋ด๋ ๋ค์ด๋ฐ์ผ๋ก ์์ ํด์ฃผ์ธ์.
- ํ๋ฌ์ค! ์ฌ๊ธฐ์๋ ์ฌ์ฉํ์ง ์์๋ ๋๋ ์ผํญ์ฐ์ฌ์๊ฐ ์จ์ด์๋ค์! ํ์ธํด์ฃผ์ธ์ |
@@ -0,0 +1,101 @@
+@use '../../../../styles/mixin.scss' as mixin;
+@use '../../../../styles/color.scss' as clr;
+
+.feeds {
+ position: relative;
+ top: 77px;
+ width: 60%;
+ margin-bottom: 80px;
+ background: #fff;
+
+ .top_menu {
+ @include mixin.flex($justify: space-between, $align: center);
+ height: 82... | Unknown | ์ด๋ ๊ฒ ๊ฐ ์์์ background color๋ฅผ ๊ฐ๊ฐ ๋ค ๋ฃ์ด์ฃผ์ ์ด์ ๊ฐ ์์ผ์ค๊น์? |
@@ -0,0 +1,92 @@
+{
+ "stories": [
+ { "imgUrl": "images/joonyoung/stories/story1.jpg", "username": "Enna" },
+ { "imgUrl": "images/joonyoung/stories/story2.jpg", "username": "Jesy" },
+ { "imgUrl": "images/joonyoung/stories/story3.jpg", "username": "Denial" },
+ { "imgUrl": "images/joonyoung/stories/story... | Unknown | mockData king ์ค์๋๐ ์ ๋ง ๊ฐ์ฌํฉ๋๋ค. ์ธ๋ถ ๋ด์ฉ์ ์์๋ก ๋ณ๊ฒฝํ ํ, ๋ฐ์ดํฐ์ ํ์์ข ๋น๋ ค๋ค ์ฐ๊ฒ ์ต๋๋ค ๊ฐ์ฌํฉ๋๋ค! |
@@ -0,0 +1,12 @@
+.header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ position: fixed;
+ width: calc(430px - 48px);
+ height: 64px;
+ padding: 0 24px;
+ background-color: black;
+ color: #fff;
+ z-index: 1000;
+} | Unknown | ํผ๊ทธ๋ง ์์ width๊ฐ 430px์ด์๊ณ , ์ ์ padding์ด 24์์ด์ ์ด๋ฐ calc ์ฝ๋๊ฐ ๋์์ต๋๋ค..
โ๐ป๋ณดํต ์ด๋ ๊ฒ ์ฒ๋ฆฌํ์๋์ง, ํน์ ๋ ์ ์ฐํ ๋ฐฉ์์ด ์๋์ง ๊ถ๊ธํฉ๋๋ค. |
@@ -4,13 +4,15 @@
"version": "0.0.0",
"type": "module",
"scripts": {
- "dev": "vite",
+ "dev": "vite --host",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
"test": "vitest"
},
"depend... | Unknown | ๊ต์ฅํ ์ฌ์ํ์ง๋ง ์ปค๋ฐ ๋ฉ์์ง ๊ด๋ จ ๋ฆฌ๋ทฐ ๋จ๊ฒจ๋ด
๋๋ค..! ์ ๋ ํจํค์ง ๊ด๋ จ ์ค์น๋ chore๋ฅผ ์ฌ์ฉํฉ๋๋ค..! ์ด๊ฒ ์๋ฒฝํ๊ฒ ์ ํํ ์ง๋ ๊ฒ์ฆํด๋ณด์ง ์์์ผ๋, ์ฐธ๊ณ ํด๋ณด๋ฉด ์ข์ ๊ฒ ๊ฐ์์!
[์ข์ ์ปค๋ฐ ๋ฉ์์ง ์์ฑ๋ฒ](https://velog.io/@iamjm29/Git-%EC%A2%8B%EC%9D%80-%EC%BB%A4%EB%B0%8B-%EB%A9%94%EC%8B%9C%EC%A7%80-%EC%9E%91%EC%84%B1%EB%B2%95)
[AngularJS Commit Convention](https://gist.github.com/stephenparish/... |
@@ -0,0 +1,12 @@
+.header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ position: fixed;
+ width: calc(430px - 48px);
+ height: 64px;
+ padding: 0 24px;
+ background-color: black;
+ color: #fff;
+ z-index: 1000;
+} | Unknown | ๋๋ฐ ์ ์ด์ ์์์ง..? ๐ |
@@ -0,0 +1,18 @@
+package racingcar.view;
+
+import camp.nextstep.edu.missionutils.Console;
+
+public class InputView {
+ private static final String ASK_CAR_NAMES = "๊ฒฝ์ฃผํ ์๋์ฐจ ์ด๋ฆ์ ์
๋ ฅํ์ธ์.(์ด๋ฆ์ ์ผํ(,) ๊ธฐ์ค์ผ๋ก ๊ตฌ๋ถ)";
+ private static final String ASK_TURN = "์๋ํ ํ์๋ ๋ชํ์ธ๊ฐ์?";
+
+ public static String readCarNames() {
+ ... | Java | ๋ฉ์์ง ๊ด๋ฆฌ์ ๋ํด์ static์ด ์ข์์ง enum์ด ์ข์์ง ์ด์ผ๊ธฐ ๋๋ ๋ณด๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค. ํญ์ ์ด๋ค๊ฒ ๋์์ง ๊ณ ๋ฏผํด์ ๋งค๋ฒ ์ธ๋๋ง๋ค ํ๋ฒ์ ์ด๋ ๊ฒ ํ๋ฒ์ ์ ๋ ๊ฒ ํ์๊ฑฐ๋ ์. |
@@ -0,0 +1,18 @@
+package racingcar.view;
+
+import camp.nextstep.edu.missionutils.Console;
+
+public class InputView {
+ private static final String ASK_CAR_NAMES = "๊ฒฝ์ฃผํ ์๋์ฐจ ์ด๋ฆ์ ์
๋ ฅํ์ธ์.(์ด๋ฆ์ ์ผํ(,) ๊ธฐ์ค์ผ๋ก ๊ตฌ๋ถ)";
+ private static final String ASK_TURN = "์๋ํ ํ์๋ ๋ชํ์ธ๊ฐ์?";
+
+ public static String readCarNames() {
+ ... | Java | ์ ๋ System.out.print~์ฌ์ฉํ๋ ๋ถ๋ถ์ ์ ๋ถ ์ถ๋ ฅ์ผ๋ก ์ฌ์ฉ์์๊ฒ ๋ณด์ฌ์ง๋ ๋ถ๋ถ์ด๋ผ๊ณ ์๊ฐํด์ ๋ชจ๋ OutputView์ ์์ฑํ๊ณ ์์ต๋๋ค. ์ฌ์ค ์ฒจ์ ์ ๋ InputView์ ์จ๋ ๋ ์ง ๊ณ ๋ฏผํ๋๋ฐ ์ด ๋ถ๋ถ์ ๋ํด์๋ ์ด๋ป๊ฒ ์๊ฐํ์๋์ง ๊ถ๊ธํฉ๋๋ค. |
@@ -0,0 +1,38 @@
+package racingcar.view;
+
+import java.util.stream.Collectors;
+import racingcar.domain.RacingCar;
+import racingcar.domain.RacingCars;
+import racingcar.domain.Winner;
+
+public class OutputView {
+ private static final String RACE_RESULT_MESSAGE = "\n์คํ ๊ฒฐ๊ณผ";
+ private static final String DISTA... | Java | Winnerํด๋์ค์ getWinner()์์ ์๋ ์ฐ์ฐ์ด ๋๋ ๊ฒฐ๊ณผ๋ฅผ ๋ฆฌํดํ๋ฉด getter๋ฅผ ์ฌ์ฉํ์ง ์๊ณ ๋ ๊ฒฐ๊ณผ๋ฅผ ๋ฐ์์ฌ ์ ์๋ค๊ณ ์๊ฐํ๋๋ฐ ์ด๋ป๊ฒ ์๊ฐํ์๋์? |
@@ -0,0 +1,17 @@
+package racingcar.domain;
+
+import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;
+
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.ValueSource;
+
+class CarNameTest {
+ @Parameterized... | Java | assertThatCode๋ฅผ ์ด์ฉํด์ ์์ธ๊ฐ ๋ฐ์ํ์ง ์๊ณ ์ฌ๋ฐ๋ฅด๊ฒ ๋๋์ง ํ๋ฒ ํ
์คํธ ํด๋ณด๋ ๊ฒ๋ ์ถ์ฒ ๋๋ฆฝ๋๋ค. |
@@ -0,0 +1,22 @@
+package racingcar.domain;
+
+public enum ErrorMessage {
+ ERROR("[ERROR] "),
+ INVALID_NAME_LENGTH(ERROR + "์ฐจ๋ ์ด๋ฆ์ 1-5๊ธ์ ์ฌ์ด์ฌ์ผ ํฉ๋๋ค."),
+ INVALID_NAME_TYPE(ERROR + "์ฐจ๋ ์ด๋ฆ์ ํน์๋ฌธ์๋ฅผ ํฌํจํ ์ ์์ต๋๋ค."),
+ DUPLICATED_NAME(ERROR + "์ฐจ๋ ์ด๋ฆ์ ์ค๋ณต๋ ์ ์์ต๋๋ค."),
+ INVALID_RACING_CARS_SIZE(ERROR + "๊ฒฝ์ฃผ์๋ ์ต์ 2๋์... | Java | ERROR์ ๋ณํจ ์์ ๊ฒ ๊ฐ์๋ฐ ์์๋ก ๋๊ณ ์์ฑ์ ๋ถ๋ถ์์
this.message = "ERROR" + message๋ก ํ๋ค๋ฉด ๋ฉ์์ง ์์ฑํ ๋ ์ค๋ณต์ ํผํ๋๋ฐ ๋์ ๋ ๊ฒ ๊ฐ์ต๋๋ค. |
@@ -0,0 +1,63 @@
+package racingcar.domain;
+
+import static racingcar.domain.ErrorMessage.CANT_FIND_CAR;
+import static racingcar.domain.ErrorMessage.DUPLICATED_NAME;
+import static racingcar.domain.ErrorMessage.INVALID_RACING_CARS_SIZE;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class Ra... | Java | return์ ๋ฐ๋ก ์์ฑํ๋ฉด ๊ฐ๋
์ฑ์ด ์กฐ๊ธ ๋จ์ด์ ธ ๋ณด์ผ๊น์?
์ด ๋ฉ์๋ ์ฒ๋ผ ํ๋ฒ๋ง ์ฌ์ฉํ๋ ๋ณ์๋ผ๋ฉด ๋ณ์๋ก ์ง์ ํ์ง ์๊ณ ๋ฐ๋ก ์์ฑํด๋ ๋ ๊ฒ ๊ฐ์๋ฐ...
์ด๋ฌ๋ฉด ๊ฐ๋
์ฑ์ด ๋จ์ด์ ธ ๋ณด์ด๊ธฐ๋ ํ ๊ฒ ๊ฐ์ ๊ณ ๋ฏผ์ด ๋์ ์ฌ์ญค๋ด
๋๋ค. |
@@ -0,0 +1,51 @@
+package racingcar.domain;
+
+import static racingcar.domain.ErrorMessage.INVALID_NAME_LENGTH;
+import static racingcar.domain.ErrorMessage.INVALID_NAME_TYPE;
+
+import java.util.Objects;
+import java.util.regex.Pattern;
+
+public class CarName {
+ private static final int MAX_LENGTH = 5;
+ priva... | Java | ์ ๊ทํํ์์ ๋ฌธ์์ง์ ํ ํ {1,5}์ ์ฌ์ฉํ๋ฉด ๊ธ์ ์ ์ ํ ํ๋๋ฐ๋ ๋์์ด ๋ ๊ฑฐ์์. |
@@ -0,0 +1,35 @@
+package racingcar.domain;
+
+import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
+import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;
+
+import java.util.List;
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+import org.junit... | Java | 2๋ ์ด์์ธ ๊ฒฝ์ฐ / ์ด๋ฆ ์ค๋ณต๋๋ฉด ์๋๋ ๊ฒฝ์ฐ์ ๋ํด ๋ฉ์๋๋ฅผ ๋๋ ์ ํ
์คํธ ํด๋ ์ข์๊ฑฐ๊ฐ์ด๋ค |
@@ -0,0 +1,17 @@
+package racingcar.domain;
+
+import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;
+
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.ValueSource;
+
+class TurnTest {
+ @ParameterizedTes... | Java | ์ ๋ validate ๋ก์ง์ ๋ํด์
1. ์ซ์๋ง ์
๋ ฅ ๋ฐ์์ผํ๋ ๋ณ์์ ๋ฌธ์ ์
๋ ฅ๋๋ ๊ฒฝ์ฐ -> input์์ ๊ฒ์ฆ
2. 1ํ ๋ฏธ๋ง์ผ๋ก ์
๋ ฅ๋ฐ๋ ๋ฉ์๋ ๊ด๋ จ ๊ฒ์ฆ -> turn๋ฉ์๋์์ ๊ฒ์ฆ ํ๋ ๋ฐฉ์์ผ๋ก ํญ์ ์์ฑํด ์๋๋ฐ ์ด๋ถ๋ถ์ ๋ํด์ ์ด๋ป๊ฒ ์๊ฐํ๋์ง ๊ถ๊ธํฉ๋๋ค ! |
@@ -0,0 +1,18 @@
+package racingcar.view;
+
+import camp.nextstep.edu.missionutils.Console;
+
+public class InputView {
+ private static final String ASK_CAR_NAMES = "๊ฒฝ์ฃผํ ์๋์ฐจ ์ด๋ฆ์ ์
๋ ฅํ์ธ์.(์ด๋ฆ์ ์ผํ(,) ๊ธฐ์ค์ผ๋ก ๊ตฌ๋ถ)";
+ private static final String ASK_TURN = "์๋ํ ํ์๋ ๋ชํ์ธ๊ฐ์?";
+
+ public static String readCarNames() {
+ ... | Java | ์ ๋ ์ด๋ฒ์ ํ๋ฆฌ์ฝ์ค๋ฅผ ์งํํ๋ฉด์ ๋๋ฆ์ ๊ธฐ์ค์ ์ธ์๋ดค์ต๋๋ค!
1. enum์ผ๋ก ์ฌ์ฉํ ๋งํผ ์์์ ๊ฐ์๊ฐ ์ถฉ๋ถํ์ง? ์ต์ 3๊ฐ ์ด์
2. ํ๋ก๊ทธ๋จ์ด ํ์ฅ๋๋ค๋ฉด ํด๋น enum ์ ์์๊ฐ ์ถ๊ฐ๋ ๊ฐ๋ฅ์ฑ์ด ์๋์ง?
3. ๋ค๋ฅธ ํด๋์ค์์๋ ์ฌ์ฉ๋ ๊ฐ๋ฅ์ฑ์ด ์๋์ง? |
@@ -0,0 +1,18 @@
+package racingcar.view;
+
+import camp.nextstep.edu.missionutils.Console;
+
+public class InputView {
+ private static final String ASK_CAR_NAMES = "๊ฒฝ์ฃผํ ์๋์ฐจ ์ด๋ฆ์ ์
๋ ฅํ์ธ์.(์ด๋ฆ์ ์ผํ(,) ๊ธฐ์ค์ผ๋ก ๊ตฌ๋ถ)";
+ private static final String ASK_TURN = "์๋ํ ํ์๋ ๋ชํ์ธ๊ฐ์?";
+
+ public static String readCarNames() {
+ ... | Java | ์ ๋ ์ฒ์์ 1์ฃผ์ฐจ ๋ฏธ์
์ ์งํํ ๋๋ ์ฌ์ฉ์์๊ฒ ๋ณด์ด๋ ๋ถ๋ถ์ด๋ผ๊ณ ์๊ฐํ์ฌ OutputView์ ์์ฑํ์๋๋ฐ ๋ง์ ๋ถ๋ค ์ฝ๋๋ฅผ ๋ณด๋ค๋ณด๋ ์
๋ ฅ์ ์์ฒญํ๋ ๋ฉ์์ง๋ InputView์์ ์ฒ๋ฆฌํ์๋๋ผ๊ตฌ์. ๊ทธ๋ฆฌ๊ณ ๊ฒฐ์ ์ ์ผ๋ก ์ฐํ
์ฝ์์ ์ ๊ณตํ ์๊ตฌ์ฌํญ ๋ถ๋ถ์ ๋ณด์๋ฉด ์
๋ ฅ์ ์๊ตฌํ๋ ๋ฉ์์ง๋ฅผ InputView์์ ์ฌ์ฉํ๋๊ฑธ ๋ณด์ค ์ ์์ต๋๋ค.
<img width="914" alt="image" src="https://github.com/parksangchu/java-racingcar-6/assets/142131857/87aa54ff-07c6-4c03-87fe-331d6ab... |
@@ -0,0 +1,22 @@
+package racingcar.domain;
+
+public enum ErrorMessage {
+ ERROR("[ERROR] "),
+ INVALID_NAME_LENGTH(ERROR + "์ฐจ๋ ์ด๋ฆ์ 1-5๊ธ์ ์ฌ์ด์ฌ์ผ ํฉ๋๋ค."),
+ INVALID_NAME_TYPE(ERROR + "์ฐจ๋ ์ด๋ฆ์ ํน์๋ฌธ์๋ฅผ ํฌํจํ ์ ์์ต๋๋ค."),
+ DUPLICATED_NAME(ERROR + "์ฐจ๋ ์ด๋ฆ์ ์ค๋ณต๋ ์ ์์ต๋๋ค."),
+ INVALID_RACING_CARS_SIZE(ERROR + "๊ฒฝ์ฃผ์๋ ์ต์ 2๋์... | Java | enum ์์ฑ์์ ๋ํ ์ดํด๊ฐ ๋ถ์กฑํ๋๊ฒ ๊ฐ์ต๋๋ค ! ์ข์ ์กฐ์ธ ๊ฐ์ฌํฉ๋๋ค ใ
ใ
|
@@ -0,0 +1,63 @@
+package racingcar.domain;
+
+import static racingcar.domain.ErrorMessage.CANT_FIND_CAR;
+import static racingcar.domain.ErrorMessage.DUPLICATED_NAME;
+import static racingcar.domain.ErrorMessage.INVALID_RACING_CARS_SIZE;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class Ra... | Java | ์ ๊ฐ 3์ฃผ์ฐจ ๋ฏธ์
์ ํ ๋ ๊ฒช์๋ ์๋ก์ฌํญ์ด ๋ฉ์๋๋ด ๋ชจ๋ ์ฝ๋๋ฅผ ์ถ์ฝ์ ์ํค๋ค๋ณด๋ ๋์ค์ ์ ๊ฐ ๊ทธ ์ฝ๋๋ฅผ ๋ณด์์๋ ๋ฌด์จ ์ฝ๋์ธ์ง ํ๋์ ์๊ธฐ๊ฐ ํ๋ค๋๊ตฐ์ ใ
ใ
๊ทธ๋์ 4์ฃผ์ฐจ๋๋ถํฐ๋ ์ด๋์ ๋ ์ ์ ํด์ ์ถ์ฝ์ ํด๋ณด๋ ๊ฐ๋
์ฑ์ด ํจ์ฌ ๋์์ก์๋ ๊ฒฝํ์ด ์์ด์ ์ด๋ฒ์๋ ์ด๋ฐ ๋ฐฉ์์ผ๋ก ์งํ์ ํด๋ดค์ต๋๋ค! |
@@ -0,0 +1,38 @@
+package racingcar.view;
+
+import java.util.stream.Collectors;
+import racingcar.domain.RacingCar;
+import racingcar.domain.RacingCars;
+import racingcar.domain.Winner;
+
+public class OutputView {
+ private static final String RACE_RESULT_MESSAGE = "\n์คํ ๊ฒฐ๊ณผ";
+ private static final String DISTA... | Java | ๋ฐ์์จ ๋ฐ์ดํฐ๋ฅผ ์ด๋ค์์ผ๋ก ์ฒ๋ฆฌํ ์ง ๊ฒฐ์ ํ๋ ๊ฒ์ OutputView์ ์ฑ
์์ด๋ผ๊ณ ์๊ฐํด์ ํด๋น ๋ฐฉ์์ผ๋ก ์งํํ์ต๋๋ค~
3์ฃผ์ฐจ ๊ณตํต ํผ๋๋ฐฑ์์๋ view์์ ์ฌ์ฉํ๋ ๋ฐ์ดํฐ๋ getter๋ฅผ ์ฌ์ฉํ๋ผ๊ณ ์ธ๊ธ์ด ๋์ด์๊ตฌ์!
<img width="619" alt="image" src="https://github.com/parksangchu/java-racingcar-6/assets/142131857/99c1b2c6-7c6d-49ee-8154-e9d7c306bd0b"> |
@@ -0,0 +1,17 @@
+package racingcar.domain;
+
+import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;
+
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.ValueSource;
+
+class CarNameTest {
+ @Parameterized... | Java | ์ฒ์ ๋ณด๋ ๋ฉ์๋์๋๋ฐ ํ๋ฒ ์ฌ์ฉํด๋ณด๊ฒ ์ต๋๋ค! ๊ฐ์ฌํฉ๋๋ค ใ
ใ
|
@@ -0,0 +1,35 @@
+package racingcar.domain;
+
+import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
+import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;
+
+import java.util.List;
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+import org.junit... | Java | ์ฝ๋๋ฅผ ์ค์ด๋ ค๊ณ ๋๋ฌด ์์ฌ์ ๋ด๋ค๋ณด๋ ๊ทธ๋ง ... ใ
์๋ฌด๋๋ ๋ฐ๋ก ํ
์คํธํ๋๊ฒ ๊ฐ๋
์ฑ ์ธก๋ฉด์์๋ ์ข์๊ฑฐ ๊ฐ์ต๋๋ค |
@@ -0,0 +1,17 @@
+package racingcar.domain;
+
+import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;
+
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.ValueSource;
+
+class TurnTest {
+ @ParameterizedTes... | Java | ์ ๋ ์๋๋ ๊ทธ๋ฐ ๋ฐฉ์์ผ๋ก ๊ฒ์ฆ์ ์งํํด์ค๋ค๊ฐ ์ด๋ฒ์ 'InputView์์ domain์์ ์ฐ์ผ ๋ฐ์ดํฐ ํํ๋ฅผ ์๋๊ฒ ๋ง์๊น?'ํ๋ ์๋ฌธ์ด ๋ค์ด ํด๋น ๋ฐฉ์์ผ๋ก ์งํ์ ํด๋ดค์ต๋๋ค. ๊ทธ๋ฆฌ๊ณ 'RacingCar'์ ๊ฐ์ ํด๋น ํ๋ก๊ทธ๋จ์ ๋๋ฉ์ธ์์ ์ฐ์ด๋ ๊ฐ์ฒด๋ฅผ ์์ฑํด์ ๋๊ธฐ๋ ๊ฒ๋ง ์๋๋ผ๋ฉด int์ ๊ฐ์ ๊ธฐ๋ณธ๊ฐ ํํ๋ inputView์์ ๊ฒ์ฆํด๋ ๊ด์ฐฎ๊ฒ ๋ค๋ผ๋ ๊ฒฐ๋ก ์ ๋์ต๋๋ค. |
@@ -0,0 +1,11 @@
+package baseball.util;
+
+import java.util.Random;
+
+public class RamdomNumberGenerator {
+ private static final Random RANDOM = new Random();
+
+ public static Integer generate() {
+ return RANDOM.nextInt(9) + 1;
+ }
+} | Java | ๋ฌด์์์ ์ซ์๋ฅผ ์์ฑํ๋ ํด๋์ค๋ฅผ ๋ฐ๋ก ๋นผ์ ํ
์คํธ๋ฅผ ์ฉ์ดํ๊ฒ ํ ์ ์๊ฒ ํ ๊ฒ ์ข๋ค์! |
@@ -0,0 +1,101 @@
+package baseball.domain;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class NumericBalls implements Iterable {
+ private List<NumericBall> numericBalls;
+
+ public NumericBalls() {
+ numericBalls = new ArrayList<>();
+ }
+
+ publi... | Java | ๋ฆฌ์คํธ์ ๋ฃ๊ณ ๋งต์ ๋ค์ ๋ฃ๋ ๊ฒ๋ณด๋ค ์ฒ์๋ถํฐ ํ๋๋ฅผ ๋งต์ผ๋ก ์ ์ธํ๊ณ ๋งต์ ์ซ์์ ์ธ๋ฑ์ค๋ฅผ ๋น๊ตํ๋ฉด ํจ์จ์ด ๋ ์ข์ ๊ฒ ๊ฐ์์. |
@@ -0,0 +1,23 @@
+package baseball.view;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Scanner;
+
+public class InputView {
+ private static final Scanner SCANNER = new Scanner(System.in);
+ public static List<Integer> inputNumbers() {
+ System.out.println("์ซ์๋ฅผ ์
๋ ฅํด ์ฃผ์ธ์ : ");
+ List<Integer>... | Java | ๊ฐ์ฒด๋ฅผ ์์๋ก ์ ์ธํ๋ฉด ์ฝ๋๊ฐ ํจ์ฌ ๊ฐํธํด์ง์ง๋ง, final์์๋ ๊ฐ์ด ๋ฐ๋ ์ ์์ด ๊ด๋ จ์ด์๊ฐ ์์ ์๋ ์์ต๋๋ค. ์ ์ํ๊ณ ์ฌ์ฉํด์ฃผ์ธ์:) |
@@ -3,28 +3,50 @@ import './Login.scss';
import Login_Button from './Login_Button/Login_Button';
class Login extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ id: 'a',
+ pw: 0,
+ };
+ }
+
+ handleInput = e => {
+ const { value, name } = e.target;
+ this.setSta... | JavaScript | this.state ... ์ด๊ฑฐ ๋๋ฌด ๊ธฐ๋๊น ์ด๊ฒ๋ ๋น๊ตฌ์กฐํ ํ ๋นํ์๋ ๊ฒ ๊ฐ๋
์ฑ์ด ์ข์ ๊ฒ ๊ฐ์์! |
@@ -1,14 +1,51 @@
import React, { Component } from 'react';
+import Comment from './Comment/Comment';
import './Feeds.scss';
class Feeds extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ comment: '',
+ comments: [],
+ idnumber: 1,
+ };
+ }
+
+ componentDidMoun... | JavaScript | ์ฌ๊ธฐ form ํ๊ทธ๋ก ๊ฐ์ธ์๊ณ onSubmit ์ด๋ฒคํธ์ฃผ์๋ฉด ์ํฐํค ๋๋ฅผ ๋ ์คํ๋๋ ๋ฉ์๋ ๋ฐ๋ก ์ ๋ง๋์
๋ pressButton ๋ฉ์๋ ํ๋๋ง์ผ๋ก ๋๊ธ ์ถ๊ฐ์ํฌ ์ ์์ด์! |
@@ -3,28 +3,50 @@ import './Login.scss';
import Login_Button from './Login_Button/Login_Button';
class Login extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ id: 'a',
+ pw: 0,
+ };
+ }
+
+ handleInput = e => {
+ const { value, name } = e.target;
+ this.setSta... | JavaScript | ๋ง์ํ์ ๋๋ก ๋ฐ๊ฟจ์ต๋๋ค! |
@@ -1,14 +1,51 @@
import React, { Component } from 'react';
+import Comment from './Comment/Comment';
import './Feeds.scss';
class Feeds extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ comment: '',
+ comments: [],
+ idnumber: 1,
+ };
+ }
+
+ componentDidMoun... | JavaScript | form์ ์ด๋ฐ ๊ธฐ๋ฅ์ด ์๋ ์ค ์ฒ์์์์ต๋๋ค! ๋๋ถ์ ์๋ก์ด ์ง์์ ์ป์์ต๋๋ค. ์ ๋ง ๊ฐ์ฌํด์! |
@@ -3,28 +3,50 @@ import './Login.scss';
import Login_Button from './Login_Button/Login_Button';
class Login extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ id: 'a',
+ pw: 0,
+ };
+ }
+
+ handleInput = e => {
+ const { value, name } = e.target;
+ this.setSta... | JavaScript | idValue๋ฅผ ๋๊ฒจ์ฃผ๋ ๊ฑธ๋ก ๋ณด์ด๋๋ฐ idfunc๋ผ๋ ์ด๋ฆ์ ๋ง์น ํจ์๊ฐ์์ ์ ํฉํ์ง ์์๋ณด์
๋๋ค!
pwfunc, colorfunc ๋ชจ๋ ๋ง์ฐฌ๊ฐ์ง์
๋๋ค!
๊ทธ๋ฆฌ๊ณ colorfunc๋ผ๋ ๊ฐ์ id๋ pwํตํด์ ๊ณ์ฐ ๊ฐ๋ฅํด๋ณด์ด๋๋ฐ ๊ทธ๋ฌ๋ฉด idValue๋ pwValue๋ง Props๋ก ๋ฐ๊ณ , colorfunc์์ ๊ณ์ฐ ํ๋ ๊ฐ์ LoginButton ์ปดํฌ๋ํธ์์ propsํตํด์ ๋ฐ๋ก ๊ณ์ฐํด์ ์ฌ์ฉํด๋ ๋ฌด๋ฐฉํด๋ณด์
๋๋ค! |
@@ -1,14 +1,51 @@
import React, { Component } from 'react';
+import Comment from './Comment/Comment';
import './Feeds.scss';
class Feeds extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ comment: '',
+ comments: [],
+ idnumber: 1,
+ };
+ }
+
+ componentDidMoun... | JavaScript | api์ฃผ์๊ฐ data์์ ๋ค์ด์๋ ํํ๋ ๋น์ ์์ ์ธ ๊ฒ ๊ฐ์ต๋๋ค!
api์ฃผ์๋ ์ผ๋ฐ์ ์ผ๋ก ๋ฐฑ์๋์์ ์ ์กํด์ฃผ์ง ์์ต๋๋ค!
comment์ ๋ณด๋ feed์ ๋ณด๋ฅผ ๋ถ๋ฆฌ์์ผ๋์ผ์
์ ๊ทธ๋ฐ ๊ฒ ๊ฐ์๋ฐ, feed์์ comment์ ๋ณด๋ฅผ ๊ทธ๋ฅ ๋ค ๋ฃ์ด์ฃผ์๋ฉด ๋ ๊ฒ ๊ฐ์ต๋๋ค!
```
{
id: 1,
profilesrc: '/images/jaesangChoi/profile1.jpeg',
mainfeedsrc:
'https://images.unsplash.com/photo-1623659993428-0c5504a16ca5?ixid=Mnw... |
@@ -1,14 +1,51 @@
import React, { Component } from 'react';
+import Comment from './Comment/Comment';
import './Feeds.scss';
class Feeds extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ comment: '',
+ comments: [],
+ idnumber: 1,
+ };
+ }
+
+ componentDidMoun... | JavaScript | get method๋ ๊ธฐ๋ณธ๊ฐ์ด๋ผ์ ๋ฐ๋ก ๊ธฐ์
์ํด์ฃผ์
๋ ๋ฉ๋๋ค! |
@@ -1,14 +1,51 @@
import React, { Component } from 'react';
+import Comment from './Comment/Comment';
import './Feeds.scss';
class Feeds extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ comment: '',
+ comments: [],
+ idnumber: 1,
+ };
+ }
+
+ componentDidMoun... | JavaScript | ๋๊ธ์ ๋์ค์ ์ญ์ ๋ ์๋ ์์ผ๋๊น id๋ฅผ length๋ก ์ฌ์ฉํ๋ฉด ์ญ์ ํ ๋ค์ ์ถ๊ฐ๋๋ ๊ฒฝ์ฐ ๋์ผํ id๋ฅผ ๊ฐ์ง ๋๊ธ์ด ์๊ธธ ๊ฒ ๊ฐ์ต๋๋ค! |
@@ -1,14 +1,51 @@
import React, { Component } from 'react';
+import Comment from './Comment/Comment';
import './Feeds.scss';
class Feeds extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ comment: '',
+ comments: [],
+ idnumber: 1,
+ };
+ }
+
+ componentDidMoun... | JavaScript | ํจ์๋ return๋ฌธ ๋ฐ๋ก ์์ผ๋ฉด ๋๊น์ง ๋ค ์ฝ๊ณ ๋์ ์์์ ์ข
๋ฃ๋๊ธฐ๋๋ฌธ์ ์์๋ก return ํค์๋๋ฅผ ์ ์ ํ์๋ ์์ด๋ณด์
๋๋ค! |
@@ -1,14 +1,51 @@
import React, { Component } from 'react';
+import Comment from './Comment/Comment';
import './Feeds.scss';
class Feeds extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ comment: '',
+ comments: [],
+ idnumber: 1,
+ };
+ }
+
+ componentDidMoun... | JavaScript | ์ฌ๊ธฐ๋ alt๋ฅผ ํ๊ธ๋ก ์ ๊ณ ๋ค๋ฅธ ๊ณณ์ ์์ด๋ก ์ ์ผ์ ์ด์ ๊ฐ ์์ผ์ค๊น์?? ์์ด๋ก ์ ์ด์ฃผ์๋๊ฒ ์ข์๋ณด์
๋๋ค!
ํ๊ธ์ด ๋ ์ข์ง๋ง,, ๋ง๊ตญ ๊ณต์ฉ์ด๊ฐ ์์ด๊ธฐ ๋๋ฌธ์ ๋ณดํธ์ฑ์ ์ํด์ ๐ |
@@ -1,14 +1,51 @@
import React, { Component } from 'react';
+import Comment from './Comment/Comment';
import './Feeds.scss';
class Feeds extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ comment: '',
+ comments: [],
+ idnumber: 1,
+ };
+ }
+
+ componentDidMoun... | JavaScript | t๋ผ๋ ๋ณ์๋ช
์ ๊ฐ์ง๊ณ ๋ ์ฌ๊ธฐ์ ํ ๋น๋ ๊ฐ์ด ๋ญ์ผ์ง ์ ํ ์ ์ถ๊ฐ ์๋๋ ๊ฒ ๊ฐ์ต๋๋ค!
comments ๋ฐฐ์ด์์ ํ๋ํ๋์ ์์๋ค์ด๋๊น comment๋ผ๊ณ ์ด๋ฆ์ง์ด์ฃผ๋๊ฒ ์ข์ง ์์๊น์?
```suggestion
{comments.map(comment => {
``` |
@@ -1,14 +1,51 @@
import React, { Component } from 'react';
+import Comment from './Comment/Comment';
import './Feeds.scss';
class Feeds extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ comment: '',
+ comments: [],
+ idnumber: 1,
+ };
+ }
+
+ componentDidMoun... | JavaScript | ๋ง์ฐฌ๊ฐ์ง๋ก pressButton์ด๋ผ๋ ์ด๋ฆ๋ง ๋ณด๊ณ ๋ ์ ํ ์ ์ถ๊ฐ ์๋ฉ๋๋ค!
pressButton์ด๋ผ๋๊ฑด ๋ฐ์ํ๋ ์์ ์ด์ง ํจ์๊ฐ ํ๊ณ ์๋ ๋์์ด ์๋๊ธฐ ๋๋ฌธ์ ํจ์์ ์ญํ ์ ๋์ฌํ์ผ๋ก ๋ช
ํํ๊ฒ addComment ๋ฑ์ผ๋ก ์ด๋ฆ์ง์ด์ฃผ๋๊ฒ ์ข์๋ณด์
๋๋ค! |
@@ -5,15 +5,49 @@ import Main_right from './Main_right/Main_right';
import './Main.scss';
class Mainjaesang extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ feedslist: [],
+ };
+ }
+
+ callApi = () => {
+ fetch('http://localhost:3000/data/JaesangChoi/FeedsData.json')... | JavaScript | feedslist์์ ํ๋์ ์์๋ค์ธ๋ฐ flist๋ผ๋ ๋ณ์๋ช
์ ์ ํฉํ์ง ์์๊ฒ ๊ฐ์ต๋๋ค! ์ฐจ๋ผ๋ฆฌ feed๋ฑ์ด ์ข ๋ ์ ํฉํ๊ณ ์๋ฏธ๊ฐ ๋๋ฌ๋ ๋ณด์ด๋ค์! |
@@ -5,15 +5,49 @@ import Main_right from './Main_right/Main_right';
import './Main.scss';
class Mainjaesang extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ feedslist: [],
+ };
+ }
+
+ callApi = () => {
+ fetch('http://localhost:3000/data/JaesangChoi/FeedsData.json')... | JavaScript | ๋ฉ์ธ ์ฝํ
์ธ ๊ตฌํ์ ์๋ฏธํ๋ ๊ฑฐ๋ผ๋ฉด div tag๋ณด๋ค๋ main tag๊ฐ ์ข ๋ ์ ํฉํ์ง ์์๊น์? |
@@ -1,31 +1,15 @@
-
-
-body {
- margin: 0px;
- overflow: hidden;
-
+main {
+ display: flex;
+ justify-content: center;
+ gap: 20px;
+ padding-top: 54px;
+ box-sizing: border-box;
+
+ .bold_comment {
+ font-weight: bold;
+ }
+
+ .grey_comment {
+ color: grey;
+ }
}
-
-
-
-.main {
- display: flex... | Unknown | ์ด๋ฏธ display:block์ธ ์์์ธ๋ฐ width:100% ๋ฅผ ๋ถ์ฌํ ์ด์ ๊ฐ ์์ด๋ณด์
๋๋ค! |
@@ -1,31 +1,15 @@
-
-
-body {
- margin: 0px;
- overflow: hidden;
-
+main {
+ display: flex;
+ justify-content: center;
+ gap: 20px;
+ padding-top: 54px;
+ box-sizing: border-box;
+
+ .bold_comment {
+ font-weight: bold;
+ }
+
+ .grey_comment {
+ color: grey;
+ }
}
-
-
-
-.main {
- display: flex... | Unknown | height:100vh๋ก ๋ถ๋ชจํ๊ทธ์ ํฌ๊ธฐ๋ฅผ ๊ณ ์ ๊ฐ์ผ๋ก ์ ํ๋๊ฑด ์ข์ง์์ต๋๋ค!
๋ถ๋ชจํ๊ทธ์ ๊ณ ์ ๋์ด๊ฐ์ ์ฃผ๋๊ฑด ์คํฌ๋กค์ด ํ์ํ ๊ฒฝ์ฐ๋ฅผ ์ ์ธํ๊ณ ๋ ์ง์ํ๊ณ ์์ต๋๋ค!
์์ ์ฌ๋ฌ ์์ํ๊ทธ๋ค์ด ๋ค์ด์ฌํ
๋ฐ ๊ทธ ํฌ๊ธฐ๋งํผ ์์ฐ์ค๋ฝ๊ฒ ๋์ด๋๋๋ก height๊ฐ์ ์ฃผ์ง ์๋๊ฒ ์ข์๋ณด์
๋๋ค! |
@@ -1,9 +1,25 @@
import React, { Component } from 'react';
-import Recommendation_list from './Recommendation_list/Recommendation_list';
+import RecommendationList from './Recommendation_list/Recommendation_list';
+import RECOMMENDATION_DATA from './RecommendationData';
import './Main_right.scss';
class Main_right... | JavaScript | ์์๋ฐ์ดํฐ๋ ๋๋ฌธ์ + snake_case ์ฌ์ฉํด์ฃผ์ธ์! |
@@ -1,9 +1,25 @@
import React, { Component } from 'react';
-import Recommendation_list from './Recommendation_list/Recommendation_list';
+import RecommendationList from './Recommendation_list/Recommendation_list';
+import RECOMMENDATION_DATA from './RecommendationData';
import './Main_right.scss';
class Main_right... | JavaScript | camelCase ์ฌ์ฉํด์ฃผ์ธ์! ์ง๊ธ์ pascalCase๋ฅผ ์ฌ์ฉํ๊ณ ๊ณ์๋ค์! |
@@ -1,9 +1,25 @@
import React, { Component } from 'react';
-import Recommendation_list from './Recommendation_list/Recommendation_list';
+import RecommendationList from './Recommendation_list/Recommendation_list';
+import RECOMMENDATION_DATA from './RecommendationData';
import './Main_right.scss';
class Main_right... | JavaScript | camelCase ์ฌ์ฉํด์ฃผ์ธ์! |
@@ -1,31 +1,15 @@
-
-
-body {
- margin: 0px;
- overflow: hidden;
-
+main {
+ display: flex;
+ justify-content: center;
+ gap: 20px;
+ padding-top: 54px;
+ box-sizing: border-box;
+
+ .bold_comment {
+ font-weight: bold;
+ }
+
+ .grey_comment {
+ color: grey;
+ }
}
-
-
-
-.main {
- display: flex... | Unknown | main.scss์์ mainํ๊ทธ์ height: 100vh๋ฅผ ์ค ์ด์ ๊ฐ ํ๋ฉด ์ ์ฒด๋ฅผ ๋ฒ์๋ฅผ ๊ฐ๊ฒ ํด์ฃผ๋ ค๊ณ ์ฌ์ฉํ์ต๋๋ค.
๊ทธ ์ด์ ๋ Main_right์ ๋ฐ์ค๊ฐ Nav์ฒ๋ผ ๊ณ ์ ๋๊ฑธ ๊ตฌํํ๋ ค๊ณ ํ๊ณ ๊ทธ ๋ฐฉ๋ฒ์ผ๋ก position:sticky๊ฐ ๋ ์ฌ๋๊ธฐ ๋๋ฌธ์
๋๋ค.
sticky๋ก ํ๋ฉด์ ๊ณ์ ๊ณ ์ ์ํค๊ธฐ ์ํด์ ํ๋ฉด ์ ์ฒด์ ๋ํด์ ๋ฒ์๋ฅผ ๊ฐ์ ธ์ผํ๋๋ฐ Main_right๋ mainํ๊ทธ์ ์์์ด๊ธฐ ๋๋ฌธ์
mainํ๊ทธ๊ฐ ํ๋ฉด์ ์ฒด์ ๋ฒ์๋ฅผ ๊ฐ์ ธ์ผ ํ์ต๋๋ค.
๊ทธ๋์ main์ height:100vh๋ฅผ ์คฌ์ต๋๋ค์... height๋ฅผ auto๋ก ์ค์ ํ๋ฉด position:sti... |
@@ -1,31 +1,15 @@
-
-
-body {
- margin: 0px;
- overflow: hidden;
-
+main {
+ display: flex;
+ justify-content: center;
+ gap: 20px;
+ padding-top: 54px;
+ box-sizing: border-box;
+
+ .bold_comment {
+ font-weight: bold;
+ }
+
+ .grey_comment {
+ color: grey;
+ }
}
-
-
-
-.main {
- display: flex... | Unknown | ๋ผ์ด์ง์ ๊ณ์ค ๋ ์ฌ์ญค๋ณด๊ธธ ์ํ๊ฑฐ ๊ฐ์ต๋๋ค.
๋๋ถ์ position:sticky์ ๋ํด์ ์ฐฉ๊ฐํ๋๊ฒ ์์ ํ ์กํ์ต๋๋ค.
๋์ด์ position์ ๋๋ ต์ง ์๋ค์!!! |
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="UTF-8" />
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <title>react-shopping-products</title>
+ <script type="module" crossorigin src=... | Unknown | dist ํด๋๊ฐ git ignore๋์ง ์์๊ตฐ์ฉ |
@@ -0,0 +1,10 @@
+/**
+ * generateBasicToken - Basic auth๋ฅผ ์ํ ํ ํฐ์ ๋ง๋๋ ํจ์์
๋๋ค.
+ * @param {string} userId - USERNAME์
๋๋ค.
+ * @param {string} userPassword - PASSWORD์
๋๋ค.
+ * @returns {string}
+ */
+export function generateBasicToken(userId: string, userPassword: string): string {
+ const token = btoa(`${userId}:${userPas... | TypeScript | ์ฌ์ธํ jsdocs ๐๐๐๐ |
@@ -0,0 +1,95 @@
+import { CartItemType, ProductType } from '../types';
+import { generateBasicToken } from './auth';
+
+const API_URL = import.meta.env.VITE_API_URL;
+const USER_ID = import.meta.env.VITE_USER_ID;
+const USER_PASSWORD = import.meta.env.VITE_USER_PASSWORD;
+
+/**
+ * ๊ณตํต ์์ฒญ์ ์ฒ๋ฆฌํ๋ ํจ์
+ * @param {string} e... | TypeScript | ๊ณตํต ๋ก์ง์ ๋ฌถ์ด์ฃผ๋ ๊ฒ ๋๋ฌด ์ข์ต๋๋ค~! |
@@ -0,0 +1,95 @@
+import { CartItemType, ProductType } from '../types';
+import { generateBasicToken } from './auth';
+
+const API_URL = import.meta.env.VITE_API_URL;
+const USER_ID = import.meta.env.VITE_USER_ID;
+const USER_PASSWORD = import.meta.env.VITE_USER_PASSWORD;
+
+/**
+ * ๊ณตํต ์์ฒญ์ ์ฒ๋ฆฌํ๋ ํจ์
+ * @param {string} e... | TypeScript | ์ฅ๋ฐ๊ตฌ๋์ 100๊ฐ ๋๊ฒ ๋ด์ ์ ์๋ case๊ฐ ์กด์ฌํ ๊ฒ ๊ฐ์์~! |
@@ -0,0 +1,50 @@
+.loaderContainer {
+ height: 60px;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.loader {
+ width: 60px;
+ display: flex;
+ justify-content: space-evenly;
+}
+
+.ball {
+ list-style: none;
+ width: 12px;
+ height: 12px;
+ border-radius: 50%;
+ background-color: ... | Unknown | ๊ท์ฌ์ด ์ ๋๋ฉ์ด์
์ ๋ง๋ค์๊ตฐ์ฉ ๐๐๐ |
@@ -0,0 +1,15 @@
+export const productCategories = {
+ all: '์ ์ฒด',
+ fashion: 'ํจ์
',
+ beverage: '์๋ฃ',
+ electronics: '์ ์์ ํ',
+ kitchen: '์ฃผ๋ฐฉ์ฉํ',
+ fitness: 'ํผํธ๋์ค',
+ books: '๋์',
+} as const;
+
+export const sortOptions = { priceAsc: '๋ฎ์ ๊ฐ๊ฒฉ์', priceDesc: '๋์ ๊ฐ๊ฒฉ์' } as const;
+
+export const FIRST_FETCH_PAGE = 0;
+... | TypeScript | ์์ํ ๐๐๐ |
@@ -0,0 +1,32 @@
+import React, { createContext, useState, useCallback, ReactNode } from 'react';
+import ErrorToast from '../components/ErrorToast/ErrorToast';
+
+export interface ToastContextType {
+ showToast: (message: string) => void;
+}
+
+export const ToastContext = createContext<ToastContextType | undefined>(u... | Unknown | ๋ณ๋์ Provider๋ก ๋ง๋ค์ด ์ค ๊ฒ ๋๋ฌด ์ข๋ค์ |
@@ -0,0 +1,95 @@
+import { CartItemType, ProductType } from '../types';
+import { generateBasicToken } from './auth';
+
+const API_URL = import.meta.env.VITE_API_URL;
+const USER_ID = import.meta.env.VITE_USER_ID;
+const USER_PASSWORD = import.meta.env.VITE_USER_PASSWORD;
+
+/**
+ * ๊ณตํต ์์ฒญ์ ์ฒ๋ฆฌํ๋ ํจ์
+ * @param {string} e... | TypeScript | ๋ง์์... ์์๋ฐฉํธ์ด์๋๋ฐ ๊ทธ๋ฅ ๊น๋จน๊ณ ๋์ด๊ฐ๋ค์ ใ
ใ
|
@@ -0,0 +1,95 @@
+import { CartItemType, ProductType } from '../types';
+import { generateBasicToken } from './auth';
+
+const API_URL = import.meta.env.VITE_API_URL;
+const USER_ID = import.meta.env.VITE_USER_ID;
+const USER_PASSWORD = import.meta.env.VITE_USER_PASSWORD;
+
+/**
+ * ๊ณตํต ์์ฒญ์ ์ฒ๋ฆฌํ๋ ํจ์
+ * @param {string} e... | TypeScript | ๊ทธ๋ฐ๋ฐ.. ์ด๋ฒ ์ฅ๋ฐ๊ตฌ๋ api๋ 20๊ฐ๋ง ๋ด์ ์ ์๊ฒ ๋ง๋ค์ด์ ธ์๋๋ผ๊ตฌ์..
์ง๊ธ api ๊ตฌํ์ฌํญ์ ๋ง์ถ์ง, ์๋๋ฉด ๋ฏธ๋์ ๋ณ๊ฒฝ์๋ ์ฉ์ดํ๊ฒ ์ฝ๋๋ฅผ ๋ฐ๊ฟ์ง๋ ์๊ฐํด ๋ด์ผํ ๋ฌธ์ ์ธ ๊ฒ ๊ฐ์์.
์ด ๋ถ๋ถ์ ๋ฐ๊ฟ์ผ ํ๋ค๋ฉด
์์
>if (key === 'category' && value === 'all')
์ด ์ฝ๋์์๋ default๋ก ๋ค์ด๊ฐ ์ ์๋ sort=id,asc๋ ์๊ฐํด๋ด์ผ ํ ๊ฒ ๊ฐ๊ณ ์ |
@@ -0,0 +1,21 @@
+import { SelectHTMLAttributes, PropsWithChildren } from 'react';
+import styles from './Select.module.css';
+
+interface Props extends PropsWithChildren<SelectHTMLAttributes<HTMLSelectElement>> {
+ options: Record<string, string>;
+}
+
+const Select = ({ options, defaultValue, children, ...props }: P... | Unknown | entries๋ผ๋ ํจ์๋ ์์ผ๋ ์ฐพ์๋ณด์๋ฉด ์ข์ ๊ฒ ๊ฐ์์..!
``` js
Object.entries(options).map([optionEn,optionKo])=>{
...
}
``` |
@@ -0,0 +1,44 @@
+package christmas.controller;
+
+import christmas.domain.event.EventCalculator;
+import christmas.domain.date.ReservationDate;
+import christmas.domain.order.OrderMenuParser;
+import christmas.view.InputView;
+import christmas.view.OutputView;
+
+public class ChristmasController {
+ public void run... | Java | ํ ๋ฉ์๋์์ ๋๋ฌด ๋ณต์กํด ๋ณด์ด๋ค์ ๋ฉ์๋๋ฅผ ๋ถ๋ฆฌํ๋ฉด ๋ ์ข์๊ฑฐ ๊ฐ์์! |
@@ -0,0 +1,22 @@
+package christmas.domain.event;
+
+import christmas.constant.ChristmasConfig;
+
+public class ChristmasEvent {
+ private final int reservationDate;
+
+ public ChristmasEvent(int reservationDate) {
+ this.reservationDate = reservationDate;
+ }
+
+ public int calculateDiscount() {
+ ... | Java | ๊ฐ ์ด๋ฒคํธ ํด๋์ค์์ ๋ ์ง๋ฅผ ๊ฒ์ฆํ๋ ๊ฒ๋ ์ข์๋ฐ ๊ฐ๊ฐ์ ์ด๋ฒคํธ ๊ธฐ๊ฐ์ ํฌํจ๋๋์ง ์ฒ๋ฆฌํ๋ ๋ถ๋ถ์ ReservationDate ํด๋์ค์์ ์ฒ๋ฆฌํด๋ ์ข์๊ฑฐ ๊ฐ์์! |
@@ -2,15 +2,18 @@
import jakarta.servlet.http.HttpServletRequest;
import java.util.ArrayList;
+import java.util.stream.Collectors;
import nextstep.app.domain.Member;
import nextstep.app.domain.MemberRepository;
+import nextstep.security.access.NullRoleHierarchy;
+import nextstep.security.access.RoleHierarchy;
+im... | Java | ์ ์ถ๊ฐํด์ฃผ์
จ๋ค์ ๐ |
@@ -0,0 +1,13 @@
+package nextstep.security.access;
+
+import java.util.Collection;
+import nextstep.security.core.GrantedAuthority;
+
+public final class NullRoleHierarchy implements RoleHierarchy {
+
+ @Override
+ public Collection<GrantedAuthority> getReachableGrantedAuthorities(
+ Collection<Grante... | Java | `<? extends GrantedAuthority>`๋ก ์ง์ ๋์ด์์ ์ด์ ๊ฐ ์ด๋ป๊ฒ ๋ ๊น์? |
@@ -4,19 +4,22 @@
import java.util.Collection;
import java.util.Collections;
import java.util.Set;
+import nextstep.security.access.RoleHierarchy;
import nextstep.security.authentication.Authentication;
import nextstep.security.authorization.AuthorizationDecision;
import nextstep.security.authorization.Authorizat... | Java | `RoleHierarchy`๋ฅผ ๋ฐ๋ก ๋ ํ์๊ฐ ์์ ๊ฒ ๊ฐ์์.
`authorityAuthorizationManager`์์ ์ฒ๋ฆฌํ๊ฒ ๋๋ฉด ๋ ํ
๋ฐ `SecuredAuthorizationManager`๊ฐ ๊ฐ์ง ํ์๊ฐ ์์๊น์? |
@@ -1,38 +1,53 @@
package nextstep.security.authorization.web;
import java.util.Collection;
+import java.util.Set;
+import nextstep.security.access.RoleHierarchy;
import nextstep.security.authentication.Authentication;
import nextstep.security.authentication.AuthenticationException;
import nextstep.security.auth... | Java | ```suggestion
private final RoleHierarchy roleHierarchy = new NullRoleHierarchy();
```
๋ถ๋ณ์ด๋ฉด ์ข์ ๊ฒ ๊ฐ๋ค์ :) |
@@ -1,38 +1,53 @@
package nextstep.security.authorization.web;
import java.util.Collection;
+import java.util.Set;
+import nextstep.security.access.RoleHierarchy;
import nextstep.security.authentication.Authentication;
import nextstep.security.authentication.AuthenticationException;
import nextstep.security.auth... | Java | ๊ธฐ๋ฅ์ผ๋ก ์ฌ์ฉํ์ง ์๋ ์ถ๋ ฅ๋ฌธ์ธ ๊ฒ ๊ฐ์์. |
@@ -0,0 +1,122 @@
+package nextstep.security.access;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Set;
+import nextstep.security.core.GrantedAuth... | Java | ์ ์ค๊ณํด์ฃผ์ ํด๋์ค์ ๊ธฐ๋ฅ ๋ช
์ธ๋ฅผ ํ
์คํธ๋ก ํ๋ฒ ์ง๋ณด๋๊ฑด ์ด๋จ๊น์? ํ
์คํธ๊ฐ ์คํจ ์ผ์ด์ค๋ฅผ ๋ณดํธํด์ฃผ๊ธฐ๋ ํ์ง๋ง ๊ธฐ๋ฅ์ ํํํด์ฃผ๋ ๋ช
์ธ์๊ฐ ๋ ์๋ ์์ต๋๋ค. |
@@ -0,0 +1,122 @@
+package nextstep.security.access;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Set;
+import nextstep.security.core.GrantedAuth... | Java | ```suggestion
private final Map<String, Set<GrantedAuthority>> rolesReachableInOneOrMoreStepsMap;
```
์ฌ๊ธฐ๋ ์ด๋ ๊ฒ ์์ ํ ์ ์๊ฒ ๋ค์~ |
@@ -0,0 +1,122 @@
+package nextstep.security.access;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Set;
+import nextstep.security.core.GrantedAuth... | Java | ```suggestion
}
if (roleName.equals(lowerRole.getAuthority())) {
throw new RuntimeException();
}
```
else if๊ฐ ๊ฐ๋
์ฑ์ด ๋๋ค๋ ์๊ฒฌ์ด ์์ ์ ์์ง๋ง ๊ฐ์ธ์ ์ผ๋ก๋ if ํ์ else, else if๋ ์ปจํ
์คํธ๋ฅผ ๊ณ์ ๋ค๊ณ ์ฝ๋๋ฅผ ์ฝ๊ฒ ๋ง๋๋ ์์ธ์ด๋ผ ๊ทธ๋ฅ if ์ฒ๋ฆฌํ๋ ๊ฒ์ด ๋ ๋ซ๋ค๋ ์๊ฐ์
๋๋ค. |
@@ -0,0 +1,13 @@
+package nextstep.security.access;
+
+import java.util.Collection;
+import nextstep.security.core.GrantedAuthority;
+
+public final class NullRoleHierarchy implements RoleHierarchy {
+
+ @Override
+ public Collection<GrantedAuthority> getReachableGrantedAuthorities(
+ Collection<Grante... | Java | ๊ธฐ์กด ์คํ๋ง์ํ๋ฆฌํฐ ์ฝ๋์์ ๊ฐ์ ธ์จ ๋ถ๋ถ์ธ๋ฐ,
์๊ฐํด๋ณด๋ ์ ํฌ ๊ตฌ์กฐ์์ ๋ถํ์ํ๋ค์,, ์์ ํด๋๊ฒ ์ต๋๋ค |
@@ -0,0 +1,93 @@
+package nextstep.security.access;
+
+import nextstep.security.core.GrantedAuthority;
+import nextstep.security.core.SimpleGrantedAuthority;
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+
+import java.util.Collection;
+import java.util.Set;
+
+import static org.assertj... | Java | ์ํ์ฐธ์กฐ ์์ธ ํ
์คํธ๊น์ง ์ ์ถ๊ฐํด์ฃผ์
จ๋ค์ ๐ |
@@ -0,0 +1,93 @@
+package nextstep.security.access;
+
+import nextstep.security.core.GrantedAuthority;
+import nextstep.security.core.SimpleGrantedAuthority;
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+
+import java.util.Collection;
+import java.util.Set;
+
+import static org.assertj... | Java | ํ
์คํธ๊ฐ 27์์ ์คํจํด๋ 28๋ผ์ธ์ ๋ํ assertion๊น์ง ํผ๋๋ฐฑ๋ฐ์ ์ ์๊ฒ `assertAll`๋ฅผ ํ์ฉํด ๋ณผ ์๋ ์๊ฒ ๋ค์ :) |
@@ -1,7 +1,14 @@
package christmas;
+import christmas.controller.ChristmasController;
+import christmas.exception.ExceptionHandler;
+import christmas.exception.RetryExceptionHandler;
+
public class Application {
public static void main(String[] args) {
- // TODO: ํ๋ก๊ทธ๋จ ๊ตฌํ
+ ExceptionHandler handle... | Java | ๋ฉ์๋๋ ๋์ฌ๋ก ํ๋ ๊ฒ์ด ์ข๋ค๊ณ ์๊ฐํ๋๋ฐ,
service() ๋ ์ ๋นํ๋ค ๋ผ๋ ์๋ฏธ๋ผ๊ณ ํด์! ๋ฌผ๋ก , ์๋น์ค ํ๋ค~ ๋ผ๋ ๋๋์ธ ๊ฑด ์ดํดํ์ง๋ง
execute()๋ operate() ์ ๊ฐ์ ๋์์ ๊ฐ์กฐํ๋ ๋์ฌ๋ฅผ ์ฌ์ฉํ๋ ๊ฑด ์ด๋จ๊น ํ๋ ๊ฐ์ธ์ ์๊ฒฌ์
๋๋ค! |
@@ -0,0 +1,25 @@
+package christmas.constant;
+
+public enum Badge {
+ NONE("์์", 0),
+ STAR("๋ณ", 5_000),
+ TREE("ํธ๋ฆฌ", 10_000),
+ SANTA("์ฐํ", 20_000);
+
+
+ private final String badgeName;
+ private final long prize;
+
+ Badge(String badgeName, long prize){
+ this.badgeName = badgeName;
+ ... | Java | ์ด ๋ถ๋ถ ์ฐธ ๊ณ ๋ฏผ ๋ง์ด ํ๋๋ฐ์,
์ ๋ "์์" ๋ฐฐ์ง๋ฅผ ๋ง๋ ๋ค ๊ณ ๋ฏผํด๋ณด๋
๋๋ฉ์ธ ์ชฝ์์ ์ถ๋ ฅ ๋ก์ง์ ์์์ผํ๋ ๊ฒ ๊ฐ์์
์์ ๋ฐฐ์ง๋ฅผ ์ญ์ ํ๊ณ , Dto์ ๋น์ด์๋ badgeName ๊ฐ์ ๋ฃ๋ ์์ผ๋ก ๊ตฌํํ ํ OutputView์์ ์ ๋ฌ๋ฐ์ ์ด๋ฒคํธ ๋ฐฐ์ง ๊ฐ์ด ๋น์ด์๋ String์ด๋ฉด ์์ ๋ ์์ผ๋ก ์ฒ๋ฆฌํ์ต๋๋ค.
์์ง๋์ ์ด๋ป๊ฒ ์๊ฐํ์๋์? |
@@ -0,0 +1,41 @@
+package christmas.constant;
+
+public enum Menu {
+ YANGSONGSOUP("์์ก์ด์ํ", 6000, MenuType.APPETIZER),
+ TAPAS("ํํ์ค", 5500, MenuType.APPETIZER),
+ CAESAR_SALAD("์์ ์๋ฌ๋", 8000, MenuType.APPETIZER),
+
+ T_BONE_STEAK("ํฐ๋ณธ์คํ
์ดํฌ", 55000, MenuType.MAIN),
+ BBQ_RIB("๋ฐ๋นํ๋ฆฝ", 54000, MenuType.MAIN),
+ ... | Java | MenuType์ static import ํ๋ฉด ์ข ๋ ์งง๊ฒ ์ฝ๋๋ฅผ ์์ฑํ ์ ์์๊ฑฐ ๊ฐ์์! |
@@ -0,0 +1,74 @@
+package christmas.controller;
+
+import christmas.constant.Menu;
+import christmas.domain.BenefitStorage;
+import christmas.dto.BenefitResult;
+import christmas.domain.Customer;
+import christmas.domain.EventPlanner;
+import christmas.dto.OrderMenu;
+import christmas.exception.ExceptionHandler;
+impor... | Java | ์ฌ์ํ์ง๋ง ๋ค์ด๋ฐ์ `OrderedMenu` ๋ก ํ๋ฉด ์ด๋จ๊น์? |
@@ -0,0 +1,74 @@
+package christmas.controller;
+
+import christmas.constant.Menu;
+import christmas.domain.BenefitStorage;
+import christmas.dto.BenefitResult;
+import christmas.domain.Customer;
+import christmas.domain.EventPlanner;
+import christmas.dto.OrderMenu;
+import christmas.exception.ExceptionHandler;
+impor... | Java | `customer = new Customer(getDate(), getMenu());`
๋ก ํ๋ฒ์ ํด๋ ์ข์ ๊ฑฐ ๊ฐ์์.
`getDate()` ๋ `getMenu()` ๋ ๋ค ๋ฉ์๋ ์ด๋ฆ์ผ๋ก ๋ญ๋ฅผ ํ๋์ง ์ ํํ ์ ์ ์์ด๋ณด์
๋๋ค. |
@@ -0,0 +1,55 @@
+package christmas.domain;
+
+import christmas.constant.Badge;
+import christmas.constant.Menu;
+import christmas.domain.promotion.ChristmasPromotion;
+import java.util.Arrays;
+import java.util.HashMap;
+
+public class BenefitStorage {
+
+ private final long beforeDiscountAmount;
+ private final... | Java | Map ํ์
์ผ๋ก ์ธ์คํด์ค ๋ณ์๋ฅผ ๊ฐ์ง๋ฉด ์ถํ
์ธ๋ถ ๊ตฌํ ์๋ฃ๊ตฌ์กฐ๊ฐ ๋ฐ๋ ๋ ๋ฅ๋์ ์ผ๋ก ๋์ฒํ ์ ์์๊ฑฐ ๊ฐ์์! |
@@ -0,0 +1,55 @@
+package christmas.domain;
+
+import christmas.constant.Badge;
+import christmas.constant.Menu;
+import christmas.domain.promotion.ChristmasPromotion;
+import java.util.Arrays;
+import java.util.HashMap;
+
+public class BenefitStorage {
+
+ private final long beforeDiscountAmount;
+ private final... | Java | ์ด์ฐ๋ณด๋ฉด Dto์ ๊ฐ๊น์ด ์ฑ๊ฒฉ์ ๊ฐ์ง๋ ํด๋์ค์ธ๋ฐ
๋๋ฉ์ธ ๋ก์ง์ ๋ค ๋ฃ์ด๋ ๋๋์ ๋ฐ์์ต๋๋ค.
๊ฒฐ๊ตญ ์ถ๋ ฅ๋ ํ์ํ ์๋ฃ๋ค์ ๋ค ๊ฐ์ง๊ณ ์์ด์
๋๋ฉ์ธ์ ๋ค๋ฅธ ๋ฐฉ์์ผ๋ก ๋ถ๋ฆฌํด๋ณด๋ ๊ฒ์ ๊ณ ๋ คํด๋ณด๋ฉด ์ด๋จ๊น์? |
@@ -0,0 +1,71 @@
+package christmas.domain;
+
+import christmas.constant.MenuType;
+import christmas.constant.PromotionType;
+import christmas.domain.promotion.ChristmasPromotion;
+import christmas.domain.promotion.DdayPromotion;
+import christmas.domain.promotion.GiftPromotion;
+import christmas.domain.promotion.Speci... | Java | ๋ณ์ ๋ช
์ Map ์ ์ฌ์ฉํ๋ ๊ฒ๋ณด๋ค๋ `PromotionsAppliedToEachMenu` ์ ๊ฐ์ด ์ฌ์ฉํ๋ ๊ฒ์ ์ด๋จ๊น์? |
@@ -0,0 +1,43 @@
+package christmas.domain.promotion;
+
+import christmas.constant.PromotionItem;
+import christmas.constant.PromotionType;
+import java.util.Arrays;
+
+public class DdayPromotion extends ChristmasPromotion{
+
+ private static final int START_DATE = 1;
+ private static final int END_DATE = 25;
+ ... | Java | ๋งค์ง๋๋ฒ๋ฅผ ์์๋ก ๋๋๊ฑด ์ด๋จ๊น์? |
@@ -0,0 +1,39 @@
+package christmas.domain.promotion;
+
+import christmas.constant.PromotionItem;
+import christmas.constant.PromotionType;
+import java.util.Arrays;
+
+public class GiftPromotion extends ChristmasPromotion{
+
+ private static final long PRICETHRESHOLD = 120000;
+ private static final int START_DA... | Java | `PRICE_THRESHOLD` ์ ๊ฐ์ด ๋๋ ์ฃผ๋ฉด ๊ฐ๋
์ฑ์ด ๋ ์ข์์ง ๊ฒ ๊ฐ์ต๋๋ค! |
@@ -0,0 +1,38 @@
+package christmas.domain.promotion;
+
+import christmas.constant.PromotionItem;
+import christmas.constant.PromotionType;
+import java.util.Arrays;
+
+public class SpecialPromotion extends ChristmasPromotion{
+
+ private static final int INIT_DISCOUNT_AMOUNT = 1000;
+ private static final int MI... | Java | ์๊ฒ๋ ๋งค์ง๋๋ฒ!
ํน์ 1~31 ๊ฐ ์ค 7๋ก ๋๋์์ ๋ ๋๋จธ์ง๊ฐ 3์ธ ๋ ์ง๋ก ์ด๊ธฐํํด์ค๋ ์ข์ ๊ฑฐ ๊ฐ์์ |
@@ -0,0 +1,38 @@
+package christmas.domain.promotion;
+
+import christmas.constant.PromotionItem;
+import christmas.constant.PromotionType;
+import java.util.Arrays;
+
+public class SpecialPromotion extends ChristmasPromotion{
+
+ private static final int INIT_DISCOUNT_AMOUNT = 1000;
+ private static final int MI... | Java | ๊ณต๋ฐฑ๋ ์ฝ๋ฉ์ปจ๋ฒค์
์ด๋ผ, ๋ค๋ฅธ ํด๋์ค ํ์ผ๊ณผ ๋ง์ถฐ์ฃผ๋๊ฒ ์ด๋จ๊น์? |
@@ -0,0 +1,47 @@
+package christmas.domain.promotion;
+
+import christmas.constant.PromotionItem;
+import christmas.constant.PromotionType;
+import java.time.LocalDate;
+import java.time.DayOfWeek;
+import java.util.Arrays;
+
+public class WeekDayPromotion extends ChristmasPromotion{
+
+ private static final int STA... | Java | ๋ด๋ถ ์์๋ก ๋๋ ๊ฒ๋ณด๋ค, ์์ฑ๋ ๋ ์์ ์์ ๊ฐ์ผ๋ก ์ด๊ธฐํ ์ํค๊ณ
๊ฐ์ฒด๋ฅผ ์ฑ๊ธํค์ผ๋ก ๊ด๋ฆฌํ๋ ๊ฒ๋ ์ข์ ๊ฒ ๊ฐ์์ |
@@ -0,0 +1,7 @@
+package christmas.exception;
+
+import java.util.function.Supplier;
+
+public interface ExceptionHandler {
+ <T> T getResult(Supplier<T> supplier);
+} | Java | `Supplier` ๋ผ๋ ๋ฌธ๋ฒ์ ์ฒ์๋ณด๋ค์! ํจ์ํ ํ๋ก๊ทธ๋๋ฐ? ์ธ๊ฐ ๋ณด๋ค์ ใ
ใ
๋ฐฐ์๊ฐ๋๋ค. |
@@ -0,0 +1,28 @@
+package christmas.exception;
+
+import christmas.view.OutputView;
+import java.util.function.Supplier;
+
+public class RetryExceptionHandler implements ExceptionHandler{
+
+ @Override
+ public <T> T getResult(Supplier<T> supplier) {
+ while (true) {
+ try {
+ ret... | Java | ์ด๋ ๊ฒ ํ๋ฉด try-catch๋ฌธ์ ์ค๋ณต ๋ก์ง์ ๋บ ์ ์๊ฒ ๊ตฐ์.! |
@@ -0,0 +1,119 @@
+package christmas.validator;
+
+import christmas.constant.Menu;
+import christmas.constant.MenuType;
+import christmas.exception.ErrorCode;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+public class InputValidator {
+
+ private static int START_DATE = 1;
+ private ... | Java | ํด๋น ๋ฉ์๋๋ Map์ ๋ฐํํ๊ธฐ ๋ณด๋ค๋ void ํ์์ผ๋ก ์์ธ๋ฅผ ๋์ง ๊ฒ ๊ฐ์ ๋ค์ด๋ฐ์ด๋ผ ๋๊ปด์ ธ์.
์ญํ ์ ๊ฒ์ฆ ๋ฐ ๋ฐํ ๋๊ฐ๋ฅผ ํ๋ ๊ฒ ๊ฐ์๋ฐ
๊ฐ ์ญํ ์ ๋ง๋ ๋ฉ์๋๋ก ๋๋ ๋ณด๋ ๊ฒ์ ์ด๋ป๊ฒ ์๊ฐํ์๋์? |
@@ -0,0 +1,119 @@
+package christmas.validator;
+
+import christmas.constant.Menu;
+import christmas.constant.MenuType;
+import christmas.exception.ErrorCode;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+public class InputValidator {
+
+ private static int START_DATE = 1;
+ private ... | Java | ์กฐ๊ฑด๋ฌธ์ ์กฐ๊ฑด์ ํ๋์ ๋ฉ์๋๋ก ๋นผ๋ ๊ฒ๋ ์ข์ ๊ฒ ๊ฐ์ต๋๋ค. |
@@ -0,0 +1,119 @@
+package christmas.validator;
+
+import christmas.constant.Menu;
+import christmas.constant.MenuType;
+import christmas.exception.ErrorCode;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+public class InputValidator {
+
+ private static int START_DATE = 1;
+ private ... | Java | null ์ ์ง์ ๋ค๋ฃจ๋ ๊ฒ๋ณด๋ค,
Menu ๋ด์์ ์ด๋ฆ์ ๋ฐ์์ Menu์ ์ ๋ฌด๋ฅผ ์ฒ๋ฆฌํ๋ ๋ฉ์๋๋ฅผ ๋ง๋๋ ๊ฒ์ ์ด๋จ๊น์? |
@@ -0,0 +1,119 @@
+package christmas.validator;
+
+import christmas.constant.Menu;
+import christmas.constant.MenuType;
+import christmas.exception.ErrorCode;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+public class InputValidator {
+
+ private static int START_DATE = 1;
+ private ... | Java | ์ด ๋ถ๋ถ์์ Exception์ ๋์ ธ์ฃผ๋ ๊ฒ๋ ์ข์ ๊ฒ ๊ฐ์์! |
@@ -0,0 +1,44 @@
+package christmas.view;
+
+import christmas.constant.Badge;
+import christmas.constant.OutputMessage;
+import christmas.domain.promotion.ChristmasPromotion;
+import java.util.HashMap;
+
+public class BenefitsView {
+
+ public static String giftMenuOutputStatement(boolean giftMenu){
+ if(gift... | Java | if ๋ฌธ ์ {} ๋ก ๊ฐ์ธ์ฃผ๋๊ฒ ์ฝ๋ฉ ์ปจ๋ฒค์
์ผ๋ก ์๊ณ ์์ต๋๋ค! |
@@ -0,0 +1,74 @@
+package christmas.view;
+
+import christmas.constant.Badge;
+import christmas.constant.Menu;
+import christmas.constant.OutputMessage;
+import christmas.domain.promotion.ChristmasPromotion;
+import christmas.dto.BenefitResult;
+import christmas.dto.OrderMenu;
+import java.util.HashMap;
+import java.ut... | Java | ์์ธ๋ฅผ ์ง์ ๋ฐ๋ ๊ฒ๋ณด๋ค
์์ธ๋ฅผ ๋์ง๋ ์ชฝ์์ e.getMessage() ๋ก String ๊ฐ์ ๋์ ธ์ฃผ๋ฉด
๋ฉ์๋๊ฐ ์ข ๋ ๋ฒ์ฉ์ฑ์ด ์์ ๊ฒ ๊ฐ์ต๋๋ค. |
@@ -0,0 +1,27 @@
+package christmas.constant;
+
+public enum OutputMessage {
+
+ RESERVATION_DATE("12์ %d์ผ์ ์ฐํ
์ฝ ์๋น์์ ๋ฐ์ ์ด๋ฒคํธ ํํ ๋ฏธ๋ฆฌ ๋ณด๊ธฐ!"),
+ ORDER_MENU_PREFIX("<์ฃผ๋ฌธ ๋ฉ๋ด>%n%s"),
+ ORDER_MENU("%s %d๊ฐ\n"),
+ BEFORE_DISCOUNT_AMOUNT("<ํ ์ธ ์ ์ด์ฃผ๋ฌธ ๊ธ์ก>%n%,d์\n"),
+ GIVEAWAY_MENU("<์ฆ์ ๋ฉ๋ด>%n%s"),
+ DOES_NOT_EXIST("์์... | Java | ๊ฐํ๋ฌธ์๋ฅผ System.lineseparator() ๋ก ์ฒ๋ฆฌํ๋๊ฑธ ์ถ์ฒ๋๋ฆฝ๋๋ค! ์ด์์ฒด์ ๋ณ๋ก ๊ฐํ๋ฌธ์ ํํ์ด ์์ดํ ์ ์๊ฑฐ๋ ์! |
@@ -0,0 +1,55 @@
+package christmas.domain;
+
+import christmas.constant.Badge;
+import christmas.constant.Menu;
+import christmas.domain.promotion.ChristmasPromotion;
+import java.util.Arrays;
+import java.util.HashMap;
+
+public class BenefitStorage {
+
+ private final long beforeDiscountAmount;
+ private final... | Java | ์ด ๋ถ๋ถ์ Map์ผ๋ก ์ ์ธํ๋ฉด ๋คํ์ฑ์ ์ข ๋ ํ์ฉํ์ค ์ ์์๊ฑฐ์์! |
@@ -0,0 +1,26 @@
+package christmas.domain.promotion;
+
+import christmas.constant.PromotionItem;
+import christmas.constant.PromotionType;
+import java.util.List;
+
+public abstract class ChristmasPromotion {
+
+ protected List<Integer> period;
+ protected PromotionItem targetItems;
+ protected long discountA... | Java | ์ด ๋ถ๋ถ์ ์ถ์ ํด๋์ค๋ก ๊ตฌํํ์ ์ด์ ๋ฅผ ์์์์๊น์?? ์ ๊ฐ ์ถ์ ํด๋์ค์ ๋ํด ์ต์ํ์ง ์์์์! |
@@ -0,0 +1,17 @@
+package christmas.dto;
+
+import christmas.constant.Badge;
+import christmas.domain.promotion.ChristmasPromotion;
+import java.util.HashMap;
+
+public record BenefitResult(
+
+ long beforeDiscountAmount,
+ boolean giftMenu,
+ HashMap<ChristmasPromotion, Long> promotionResult,
+ ... | Java | ๋ ์ฝ๋๋ฅผ ํ์ฉํ์
จ๋ค์. ์ด ๋ถ๋ถ์ ๋ฉ๋ชจํด๋์๋ค๊ฐ ์ ๋ ์ ์ฉํด๋ณด๊ฒ ์ต๋๋ค! ์ข์ ์ฝ๋ ๊ฐ์ฌํฉ๋๋ค! |
@@ -0,0 +1,9 @@
+package christmas.util;
+
+public class Parser {
+
+ public static int stringToInteger(String input) {
+ return Integer.parseInt(input);
+ }
+
+} | Java | ์ฌ์ํ ์ปจ๋ฒํ
์ด๋ผ๋ ๊ฐ์ฒด๋ก ๋ง๋ค์ด์ ํ์ฉํ์ ๊ฒ ์ข๋ค์! |
@@ -0,0 +1,119 @@
+package christmas.validator;
+
+import christmas.constant.Menu;
+import christmas.constant.MenuType;
+import christmas.exception.ErrorCode;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+public class InputValidator {
+
+ private static int START_DATE = 1;
+ private ... | Java | ์ค๋์ด ๋ง์ํ์ ๊ฒ ์ฒ๋ผ Menu์ ์ ๋ฌด๋ฅผ ์ฒ๋ฆฌํ๋ ๋ฉ์๋๋ฅผ ๊ตฌํํ์๊ฑฐ๋, Optional ๊ฐ์ฒด๋ฅผ ํ์ฉํ์๋๊ฑธ ์ถ์ฒ๋๋ฆฝ๋๋ค! |
@@ -0,0 +1,44 @@
+package christmas.view;
+
+import christmas.constant.Badge;
+import christmas.constant.OutputMessage;
+import christmas.domain.promotion.ChristmasPromotion;
+import java.util.HashMap;
+
+public class BenefitsView {
+
+ public static String giftMenuOutputStatement(boolean giftMenu){
+ if(gift... | Java | ์ด ๋ถ๋ถ์ ๋ณ๋ ๋ฉ์๋๋ก ๋นผ์ ์ธ๋ดํธ๋ฅผ ์ค์ฌ๋ณด๋๊ฒ ์ด๋จ๊น์?? ์ธํ
๋ฆฌ์ ์ด์์ ํด๋น ๋ถ๋ถ์ ๋๋๊ทธํ ๋ค cmd+option+m ์ ์
๋ ฅํ์๋ฉด ๋ฉ์๋๋ก ์ถ์ถํ ์ ์์ต๋๋ค! |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.