code stringlengths 41 34.3k | lang stringclasses 8
values | review stringlengths 1 4.74k |
|---|---|---|
@@ -0,0 +1,154 @@
+package oncall.view;
+
+import static oncall.exception.ExceptionMessage.DUPLICATED_NICKNAME;
+import static oncall.exception.ExceptionMessage.INVALID_DAY_OF_MONTH;
+import static oncall.exception.ExceptionMessage.INVALID_MONTH_DAY_INPUT;
+import static oncall.exception.ExceptionMessage.INVALID_MONTH_... | Java | ๋ง์ง๋ง์ Parser์ Validator๋ฅผ ์์ฑํด์ ํ์ฑ๊ณผ ๊ฒ์ฆ์ ๋ถ๋ฆฌํ๋ ค๊ณ ํ์์ผ๋ ๋ฏธ์ฒ ๋ฆฌํฉํ ๋ง ํ์ง ๋ชปํ์ต๋๋ค. ํผ๋๋ฐฑ ๊ฐ์ฌ๋๋ฆฝ๋๋ค. |
@@ -0,0 +1,56 @@
+package oncall.domain;
+
+import java.time.DayOfWeek;
+import java.time.LocalDate;
+import java.time.temporal.TemporalAdjusters;
+import java.util.ArrayList;
+import java.util.List;
+
+public class Worker {
+ private static final int INCREASE_DATE = 1;
+ private static final int OFFSET = 1;
+ ... | Java | ์ํ ๋น์์๋ EmergencyWorker ๊ฐ์ฒด๋ก ๋ณํํ๊ธฐ ์ ์ ์ ์ฅํด๋๊ณ ๋ณํํ๋๋ก ํ์์ต๋๋ค. ํผ๋๋ฐฑ ๊ฐ์ฌ๋๋ฆฝ๋๋ค ๋ํ๋! |
@@ -0,0 +1,154 @@
+package oncall.view;
+
+import static oncall.exception.ExceptionMessage.DUPLICATED_NICKNAME;
+import static oncall.exception.ExceptionMessage.INVALID_DAY_OF_MONTH;
+import static oncall.exception.ExceptionMessage.INVALID_MONTH_DAY_INPUT;
+import static oncall.exception.ExceptionMessage.INVALID_MONTH_... | Java | InputView๋ฅผ ํ์ธํด๋ณด๋ validate๊ด๋ จ ํจ์๋ ์ ๋ถ ์์ฑ๋์ด์๋๋ผ๊ณ ์ ๊ทธ๋์ ๊ฒ์ฆํ๋ ๋ก์ง์ ๋ฐ๋ก ๊ด๋ฆฌํ๋ ๊ฒ์ด ๋ ๊ฐ๋
์ฑ์ด ์ข์ ๊ฒ ๊ฐ๋ค๋ ์๊ฐ์ด ๋ญ๋๋ค
์๋ฅผ ๋ค๋ฉด ๊ฐ ๋๋ฉ์ธ์ ๋ํ validate ํด๋์ค๋ฅผ ๋ง๋ค์ด์ ๊ด๋ฆฌํด๋ ๋๊ณ ์! ํ๋ก๊ทธ๋จ์ด ์ปค์ง๋ค ๋ณด๋ฉด ๊ฐ ๋ชจ๋ธ์ ๋ํ ๊ฒ์ฆ ์์๋ค์ด ๋ ์๊ธธ ์ ์๊ณ ์ค๋ฅ๊ฐ ๋ฐ์ํ๋ฉด ์ด๊ฑฐ ๊ด๋ จ ํจ์๊ฐ ๋ญ์์ง,,ํ๊ณ ์ฐพ์๋ณด๋ ์๊ฐ๋ ์ ์ฝํ ์ ์๊ณ ์! |
@@ -1,7 +1,73 @@
package com.ll.nbe342team8.domain.book.book.controller;
-import org.springframework.web.bind.annotation.RestController;
+import com.ll.nbe342team8.domain.book.book.dto.BookPatchRequestDto;
+import com.ll.nbe342team8.domain.book.book.dto.BookResponseDto;
+import com.ll.nbe342team8.domain.book.book.en... | Java | - ์ ๋ฐ์ ์ผ๋ก ์
๋ ฅ ๋ฐ๋ Parameter์ ๋ํ ๊ฒ์ฆ์ด ์๋ค์. (์๋ฅผ ๋ค์ด, getAllBooks์ pageSize ๊ฐ์ผ๋ก -100์ ๋๊ธฐ๋ฉด ์ด๋ป๊ฒ ๋ ๊น์?) |
@@ -1,7 +1,73 @@
package com.ll.nbe342team8.domain.book.book.controller;
-import org.springframework.web.bind.annotation.RestController;
+import com.ll.nbe342team8.domain.book.book.dto.BookPatchRequestDto;
+import com.ll.nbe342team8.domain.book.book.dto.BookResponseDto;
+import com.ll.nbe342team8.domain.book.book.en... | Java | ์๋ง ์บ๋ฉ์ผ์ด์ค๋ฅผ ์ ์ฐ๋ ์ด์ ๊ฐ ์์๊น์?
์ด๊ฑฐ ๋๋ฌธ์ `@PathVariable` ์ด๋
ธํ
์ด์
๋ค์ ๋ถํ์ํ ์์ฑ๊ฐ์ด ๊ฐ์ด ๋ถ์ด๋ฒ๋ ธ๋ค์. |
@@ -1,7 +1,73 @@
package com.ll.nbe342team8.domain.book.book.controller;
-import org.springframework.web.bind.annotation.RestController;
+import com.ll.nbe342team8.domain.book.book.dto.BookPatchRequestDto;
+import com.ll.nbe342team8.domain.book.book.dto.BookResponseDto;
+import com.ll.nbe342team8.domain.book.book.en... | Java | ๊ทธ๋ฅ required=false ์ต์
์ ๋นผ๋ฉด ๊ตณ์ด ๋ถ๊ธฐ์ฒ๋ฆฌ๋ฅผ ์ํด๋ ๋์ง ์์๊น์? |
@@ -1,7 +1,73 @@
package com.ll.nbe342team8.domain.book.book.controller;
-import org.springframework.web.bind.annotation.RestController;
+import com.ll.nbe342team8.domain.book.book.dto.BookPatchRequestDto;
+import com.ll.nbe342team8.domain.book.book.dto.BookResponseDto;
+import com.ll.nbe342team8.domain.book.book.en... | Java | ์ ๋ฉ์๋์์๋ `long` ์ ์ฐ๊ณ , ์ฌ๊ธฐ์๋ `Long` ์ ์ฐ๋๋ฐ ํน์ ๋์ ๊ตฌ๋ถํ๋ ๋ด๋ถ์ ์ธ ์ปจ๋ฒค์
์ด ์กด์ฌํ๋๊ฑธ๊น์? |
@@ -0,0 +1,50 @@
+package com.ll.nbe342team8.domain.book.book.dto;
+
+import com.ll.nbe342team8.domain.book.category.entity.Category;
+import jakarta.validation.constraints.AssertTrue;
+import jakarta.validation.constraints.DecimalMin;
+import jakarta.validation.constraints.Min;
+import jakarta.validation.constraints.P... | Java | - Controller ์์ `@Valid` ๋ฅผ ์ ์ฐ๊ณ ์์ด์, Validation ์ด ์ํ๋์ง ์์ ๊ฒ์ผ๋ก ๋ณด์ฌ์.
- Dto๋ ๊ฐ๋ณ์ผ ํ์๊ฐ ์๊ณ , (์๋ง ์ด ํ
์คํธ๋ฅผ ๋ณด๊ณ ์ ๊ฐ ๋งํ๊ฒ ์ง๋ง) ๋ชจ๋ ์๋ฐ๋ก ๋์ด๊ฐ๋ฉด์ ๋ฐ์ดํฐ์ ๋ถ๋ณ์ฑ์ด ์์ฃผ ์ค์ํ ์ด์๋ก ๋ ์ค๋ฅธ ์ํฉ์ด์์.`@Data` ๋์ , Record๋ก ๋์ฒดํด ์ฃผ์ธ์. |
@@ -0,0 +1,50 @@
+package com.ll.nbe342team8.domain.book.book.dto;
+
+import com.ll.nbe342team8.domain.book.category.entity.Category;
+import jakarta.validation.constraints.AssertTrue;
+import jakarta.validation.constraints.DecimalMin;
+import jakarta.validation.constraints.Min;
+import jakarta.validation.constraints.P... | Java | Float์ ์ ํ๋ ๋ฌธ์ ๋ก ๊ถ์ฅ๋์ง ์์ต๋๋ค. Double๋ก ๋์ฒดํด ์ฃผ์ธ์. |
@@ -0,0 +1,50 @@
+package com.ll.nbe342team8.domain.book.book.dto;
+
+import com.ll.nbe342team8.domain.book.category.entity.Category;
+import jakarta.validation.constraints.AssertTrue;
+import jakarta.validation.constraints.DecimalMin;
+import jakarta.validation.constraints.Min;
+import jakarta.validation.constraints.P... | Java | status๋ฅผ ์ซ์๊ฐ ์๋ Enum ์ผ๋ก ๊ด๋ฆฌํ ์ ์์๊น์? |
@@ -0,0 +1,56 @@
+package com.ll.nbe342team8.domain.book.book.dto;
+
+import com.ll.nbe342team8.domain.book.book.entity.Book;
+import com.ll.nbe342team8.domain.book.category.entity.Category;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.... | Java | ์ด๋ค ๊ณณ์์๋ record๋ฅผ ์ฐ๊ณ , ์ด๋ค ๊ณณ์์๋ @Data ๋ฅผ ์ฐ๋๊ฑธ ๋ณด๋, ํ ๋ด ์ปจ๋ฒค์
์ด ์ ํํ๊ฒ ํ์ ๋์ง ์์ ๊ฒ ๊ฐ์์. |
@@ -1,40 +1,108 @@
package com.ll.nbe342team8.domain.book.book.entity;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.ll.nbe342team8.domain.book.book.dto.BookPatchRequestDto;
import com.ll.nbe342team8.domain.book.category.entity.Category;
+import com.ll.nbe342team8.domain.book.review.entity.Review... | Java | ์์์๋ `@Column` ์ ์ฐ๋๋ฐ, ์ ์ฌ๊ธฐ๋ถํฐ๋ ์์๊น์? |
@@ -1,40 +1,108 @@
package com.ll.nbe342team8.domain.book.book.entity;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.ll.nbe342team8.domain.book.book.dto.BookPatchRequestDto;
import com.ll.nbe342team8.domain.book.category.entity.Category;
+import com.ll.nbe342team8.domain.book.review.entity.Review... | Java | (์ข ์ฑ๋ฆฐ์งํ ๋ถ๋ถ์ด์์.)
์ผ์ผํ ๋ฐ๋ณต๋ฌธ ์ ์ฐ๊ณ update ํ ์ ์์๊น์? |
@@ -1,23 +0,0 @@
-package com.ll.nbe342team8.domain.book.book.review.entity;
-
-import com.ll.nbe342team8.global.jpa.entity.BaseTime;
-import jakarta.persistence.Entity;
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Getter;
-import lombok.NoArgsConstructor;
-
-@Entity
-@Getter
-@Builder
-@No... | Java | ์ ๊ณต๋ฐฑ๋ค๋ ์ปจ๋ฒค์
์ ๋ง๊ฒ ์ ๋ฆฌํด์ฃผ์ธ์ ใ
ใ
|
@@ -1,9 +1,113 @@
package com.ll.nbe342team8.domain.book.book.service;
+import com.ll.nbe342team8.domain.book.book.dto.BookPatchRequestDto;
+import com.ll.nbe342team8.domain.book.book.dto.BookResponseDto;
+import com.ll.nbe342team8.domain.book.book.dto.ExternalBookDto;
+import com.ll.nbe342team8.domain.book.book.ent... | Java | ๊ทธ๋ฅ `sortType.getOrder` ๋ก๋ ๋์ฒด๊ฐ ๋๊ฒ ๋ค์. |
@@ -1,9 +1,113 @@
package com.ll.nbe342team8.domain.book.book.service;
+import com.ll.nbe342team8.domain.book.book.dto.BookPatchRequestDto;
+import com.ll.nbe342team8.domain.book.book.dto.BookResponseDto;
+import com.ll.nbe342team8.domain.book.book.dto.ExternalBookDto;
+import com.ll.nbe342team8.domain.book.book.ent... | Java | ๋ชจ๋ ๋ก์ง ์ ์ฒด์ pageSize์ ์ ํ์ด ์๋๋ฐ์.
๊ทธ๋ ๋ค๋ฉด ๋ง์ฝ ์ ๊ฐ pageSize=10000000 ์ ๋ฃ์ผ๋ฉด ์ด๋ป๊ฒ ๋ ๊น์? |
@@ -1,9 +1,113 @@
package com.ll.nbe342team8.domain.book.book.service;
+import com.ll.nbe342team8.domain.book.book.dto.BookPatchRequestDto;
+import com.ll.nbe342team8.domain.book.book.dto.BookResponseDto;
+import com.ll.nbe342team8.domain.book.book.dto.ExternalBookDto;
+import com.ll.nbe342team8.domain.book.book.ent... | Java | + (์ฝ๊ฐ ์ฑ๋ฆฐ์ง)
Spring ์ Page ๋ ์ค์ DB ์ฟผ๋ฆฌ์์ ์ด๋ป๊ฒ ๋๋์ง ์์๋์? ๊ทธ๊ฒ์ด ์ด๋ป๊ฒ ๋์ํ ๊น์? |
@@ -1,9 +1,113 @@
package com.ll.nbe342team8.domain.book.book.service;
+import com.ll.nbe342team8.domain.book.book.dto.BookPatchRequestDto;
+import com.ll.nbe342team8.domain.book.book.dto.BookResponseDto;
+import com.ll.nbe342team8.domain.book.book.dto.ExternalBookDto;
+import com.ll.nbe342team8.domain.book.book.ent... | Java | ์ ์ด์ ์
๋ ฅ ๊ฐ์์ id๊ฐ notnull ์์ validate ํ๋๊ฒ ๋ง์ง ์์๊น์?
๊ธฐ๋ณธ์ ์ธ validation ์ service ๋ ์ด์ด์์ ์ํํ๊ฒ ํ์ง ๋ง์์ฃผ์ธ์. |
@@ -0,0 +1,38 @@
+package com.ll.nbe342team8.domain.book.book.service;
+
+import com.ll.nbe342team8.domain.book.book.dto.ExternalBookDto;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+import org.springframework.web.reactive.function.client.WebClient;
+
+@Se... | Java | UriComponentBuilder ์ฌ์ฉ |
@@ -0,0 +1,38 @@
+package com.ll.nbe342team8.domain.book.book.service;
+
+import com.ll.nbe342team8.domain.book.book.dto.ExternalBookDto;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+import org.springframework.web.reactive.function.client.WebClient;
+
+@Se... | Java | Apache Commons StringUtils ์ฌ์ฉ์ ํด ๋ณด์ธ์.
`StringUtils.isEmpty(isbn13)` |
@@ -1,18 +1,47 @@
package com.ll.nbe342team8.domain.book.category.entity;
+import com.ll.nbe342team8.domain.book.book.entity.Book;
import com.ll.nbe342team8.global.jpa.entity.BaseEntity;
+import jakarta.persistence.CascadeType;
import jakarta.persistence.Entity;
+import jakarta.persistence.OneToMany;
+import jakar... | Java | ํด๋น ์นดํ
๊ณ ๋ฆฌ์ ์ฑ
์ด ํ 6๋ง๊ฑด ์๋ค๊ณ ํด ๋ด
์๋ค. ๊ทธ๋ฌ๋ฉด ์นดํ
๊ณ ๋ฆฌ๋ฅผ ์ญ์ ํ๊ฒ ๋๋ฉด ๋ฐ์ดํฐ 6๋ง๊ฑด์ด ๊ฐ์ด ์ญ์ ๋ ํ
๋ฐ์. ์ข ๋ถ์์ ํ์ง ์์๊น์? |
@@ -0,0 +1,81 @@
+package com.ll.nbe342team8.domain.book.review.controller;
+
+import com.ll.nbe342team8.domain.book.book.entity.Book;
+import com.ll.nbe342team8.domain.book.book.service.BookService;
+import com.ll.nbe342team8.domain.book.review.dto.ReviewResponseDto;
+import com.ll.nbe342team8.domain.book.review.entit... | Java | ๋ชจ๋ Response Code๊ฐ 200์ธ๊ฐ์?
HttpStatus ์ ๋ํด ์์ธํ ์์๋ณด๊ณ , ํ์ํ StatusCode๋ฅผ ์ถ๊ฐํด ์ฃผ์ธ์. |
@@ -0,0 +1,81 @@
+package com.ll.nbe342team8.domain.book.review.controller;
+
+import com.ll.nbe342team8.domain.book.book.entity.Book;
+import com.ll.nbe342team8.domain.book.book.service.BookService;
+import com.ll.nbe342team8.domain.book.review.dto.ReviewResponseDto;
+import com.ll.nbe342team8.domain.book.review.entit... | Java | Controller๊ฐ ๋์๋ Service๊ฐ ๋์๋, Builder ๋ก์ง์ ์ธ๋ถ์์ ์ฌ์ฉํ์ง ์์์ผ๋ฉด ์ข๊ฒ ์ต๋๋ค.
Builder๊ฐ ์ค์์ ์ฌ์ง๋ฅผ ์ค์ฌ์ฃผ๊ธด ํ์ง๋ง, ์ฝ๋์ ๊ธธ์ด๋ฅผ ์ธ๋ก๋ก ๋๋ฆฌ๋ ๋จ์ ์ด ์๊ณ , Builder๋ฅผ ์ธํ
ํ๋ ๋ก์ง ๋๋ฌธ์ ๋ค๋ฅธ ๋ก์ง์ ๊ฐ๋
์ฑ์ด ๋๋น ์ง๋ ๋จ์ ์ด ์์ด์. |
@@ -0,0 +1,22 @@
+package com.ll.nbe342team8.domain.book.review.type;
+
+import org.springframework.data.domain.Sort;
+
+public enum SortType {
+ CREATE_AT_DESC("createDate", Sort.Direction.DESC), // ์ต๊ทผ ๋ฑ๋ก์
+ CREATE_AT_ASC("createDate", Sort.Direction.ASC), // ๊ณผ๊ฑฐ ๋ฑ๋ก์
+ RATING_DESC("rating", Sort.Direction.DE... | Java | ๋น์ทํ ์ฝ๋๊ฐ ์๋ ๊ฒ ๊ฐ์๋ฐ์, ๋ฌถ์ ์ ์์๊น์? |
@@ -0,0 +1,21 @@
+import styled from "styled-components";
+import { flexCenter } from "@/styles/common";
+import { Product } from "@/types/products";
+import ItemCartMemo from "@/components/ItemCard";
+
+const ItemCardList = ({ products }: { products: Product[] }) => {
+ return (
+ <ItemCardWrapper>
+ {product... | Unknown | key ๊ฐ์ ์ด๋ ๊ฒ ๋๋ค์ผ๋ก ๊ด๋ฆฌ๋ฅผ ํ์
จ๊ตฐ์ ! ์ ๋ key ๊ฐ์ ๋ํ ๊ณ ๋ฏผ์ด ์์๋๋ฐ ๋ณดํต ์ด ๋ฐฉ๋ฒ์ด ๋ณดํธ์ ์ผ๋ก ์ฌ์ฉ๋๋ ๋ฐฉ๋ฒ์ธ์ง ๊ถ๊ธํฉ๋๋ค ๐ |
@@ -0,0 +1,21 @@
+import styled from "styled-components";
+import { flexCenter } from "@/styles/common";
+import { Product } from "@/types/products";
+import ItemCartMemo from "@/components/ItemCard";
+
+const ItemCardList = ({ products }: { products: Product[] }) => {
+ return (
+ <ItemCardWrapper>
+ {product... | Unknown | ๋ฆฌ๋ทฐ์ด์๊ฒ ๋ฌผ์ด๋ดค๋๋ UUID๋ฅผ ์ถ์ฒํ์๋๋ผ๊ตฌ์! ์ฌ๋ฐ์ด์ฒ๋ผ 'product-id' ๋ฅผ ์ฌ์ฉํด์ ๋์ ์ธ id๋ฅผ ์์ฑํด์ฃผ๋ ๊ฒ๋ ์ ๋ง ์ข์ ๊ฒ ๊ฐ์์ ๊ทธ๋ ๊ฒ ๋ฐ๊ฟ๋ณด๋ ค๊ตฌ์! ๊ฐ์ฌํฉ๋๋ค |
@@ -0,0 +1,62 @@
+package baseball;
+
+
+import java.util.List;
+
+public class GameUtil {
+
+ public void runGame() {
+
+ if (runOnlyOnceGame()) {
+ showMenu();
+ }
+ }
+
+ public boolean runOnlyOnceGame() {
+
+ Computer computer = new Computer();
+ List<Integer> compute... | Java | Util ์ด๋ผ๋ ์ด๋ฆ์ ํด๋์ค๋ ์ ํฉํ์ง ์์ ๊ฒ ๊ฐ์์ :)
`์ ํธ ํด๋์ค`๋ ๋ณดํต ์ค์ฉ์ฑ์ด๋ ์ ์ฉ์ฑ์ ์ค์ ์ ๋ ์ ์ ๋ฉ์๋๋ค์ ๋ชจ์๋๊ณ ์ฌ๋ฌ ๊ณณ์์ ํธ์ถํ๋ ํ์์ผ๋ก ์ฌ์ฉํ๋ฉฐ ์ฌ๋ฌ ๊ณณ์์ ํธ์ถํ๊ธฐ ๋๋ฌธ์ ์ ํธ ํด๋์ค๋ ๊ณตํต์ ์ธ ๋ก์ง์ ๋ค๋ฃจ๋๋ก ๋ง๋ค์ด์ผํ๋ฉฐ ํฉ๋๋ค.
๊ฐ์ธ์ ์ผ๋ก๋ ์ค์ ๋ก๋ ์ด๋ฌํ ์ ํธ ํด๋์ค์ ๋ฉ์๋๋ฅผ ๋ณ๊ฒฝํ์ ๋ ์ํฅ์ด ๋๋ฌด ํฌ๊ธฐ ๋๋ฌธ์ ์ต๋ํ ์ฌ์ฉ์ ์ง์ํ๋ ๊ฒ์ ์ ํธํฉ๋๋ค :) |
@@ -0,0 +1,62 @@
+package baseball;
+
+
+import java.util.List;
+
+public class GameUtil {
+
+ public void runGame() {
+
+ if (runOnlyOnceGame()) {
+ showMenu();
+ }
+ }
+
+ public boolean runOnlyOnceGame() {
+
+ Computer computer = new Computer();
+ List<Integer> compute... | Java | ํ์ผ ๋ง์ง๋ง์ ์ํฐ(๊ฐํ๋ฌธ์)๋ฅผ ๋ฃ์ด์ฃผ์ธ์ :)
์ด์ ๋ ๋ฆฌ๋ทฐ๋ฅผ ์งํํ ๋ ๊นํ๋ธ์์ ๊ฒฝ๊ณ ๋ฉ์์ง๋ฅผ ์ง์ฐ๊ณ ํน์ ๋ชจ๋ฅด๋ ํ์ผ ์ฝ๊ธฐ ์ค๋ฅ์ ๋๋นํ๊ธฐ ์ํจ์
๋๋ค.
์ข ๋ ์๊ณ ์ถ์ผ์๋ฉด ์ฐธ๊ณ ๋งํฌ๋ฅผ ๋ณด์
๋ ์ฌ๋ฐ์ ๊ฒ ๊ฐ๋ค์ :)
Intellij ๋ฅผ ์ฌ์ฉํ์ค ๊ฒฝ์ฐ์Preferences -> Editor -> General -> Ensure line feed at file end on save ๋ฅผ ์ฒดํฌํด์ฃผ์๋ฉดํ์ผ ์ ์ฅ ์ ๋ง์ง๋ง์ ๊ฐํ๋ฌธ์๋ฅผ ์๋์ผ๋ก ๋ฃ์ด์ค๋๋ค!
https://minz.dev/19https://stackoverflow.com/questions/... |
@@ -0,0 +1,62 @@
+package baseball;
+
+
+import java.util.List;
+
+public class GameUtil {
+
+ public void runGame() {
+
+ if (runOnlyOnceGame()) {
+ showMenu();
+ }
+ }
+
+ public boolean runOnlyOnceGame() {
+
+ Computer computer = new Computer();
+ List<Integer> compute... | Java | - ํต์ฌ ๋ก์ง์ ๊ตฌํํ๋ ์ฝ๋์ UI๋ฅผ ๋ด๋นํ๋ ๋ก์ง์ ๊ตฌ๋ถํ๋ค.
- UI ๋ก์ง์ InputView, ResultView์ ๊ฐ์ ํด๋์ค๋ฅผ ์ถ๊ฐํด ๋ถ๋ฆฌํ๋ค.
ํ๋ก๊ทธ๋๋ฐ ์๊ตฌ์ฌํญ ์ค์ ์์ ๊ฐ์ ์๊ตฌ์ฌํญ์ด ์์๋๋ฐ์. ์ด ๋ถ๋ถ์ ์ด๋ป๊ฒ ๊ตฌํํ ์ง ์๊ฐํด๋ณด์๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค. |
@@ -0,0 +1,61 @@
+package baseball;
+
+import java.util.List;
+
+public class Referee {
+
+ public int countBall(List<Integer> list1, List<Integer> list2) {
+
+ int count = 0;
+ int strike = countStrike(list1, list2);
+
+ for (Integer number : list1) {
+ count = getCount(list2, count,... | Java | Referee ํด๋์ค์ ์ธ์คํด์ค๋ ์ด๋ค ์ํ(๋ด๋ถ ํ๋)๋ ๊ฐ์ง์ง ์๊ธฐ ๋๋ฌธ์ ์ด ํด๋์ค์ ๋ชจ๋ ๊ฐ์ฒด๋ค์ ๋์ผํ ๊ฐ์ฒด์ด๊ฒ ๋ค์ !
๋๋ฌด ๋ง์ ์ํ๋ฅผ ๊ฐ์ง๋ ๊ฒ์ ์ข์ ์ค๊ณ๊ฐ ์๋์ง๋ง, ์๋ฌด๊ฒ๋ ๊ฐ์ง์ง ์๋ ๋ฐฉ์ ๋ํ ๋ฐ๋์งํ ์ค๊ณ๋ ์๋๋๋ค.
์ ์ ํ ์ํ๋ฅผ ๊ฐ์ง ๊ฐ์ฒด๋ฅผ ์ค๊ณํด๋ณด๋ฉด ์ข์ ๊ฒ ๊ฐ์์.
๋ค๋ฅธ ํด๋์ค๋ค์๋ ํจ๊ป ์ ์ฉ๋๋ ํผ๋๋ฐฑ์ผ ๊ฒ ๊ฐ์ต๋๋ค :) |
@@ -0,0 +1,61 @@
+package baseball;
+
+import java.util.List;
+
+public class Referee {
+
+ public int countBall(List<Integer> list1, List<Integer> list2) {
+
+ int count = 0;
+ int strike = countStrike(list1, list2);
+
+ for (Integer number : list1) {
+ count = getCount(list2, count,... | Java | ์์์ ์ซ์๋ฅผ ์ฌ์ฉํ๋ ๋งค์ง๋๋ฒ๋์์ค ์ฝ๋๋ฅผ ์ฝ๊ธฐ ์ด๋ ต๊ฒ ๋ง๋๋๋ฐ์ !
์ด ๋ถ๋ถ์ ์ด๋ป๊ฒ ๊ฐ์ ํ ์ ์์๊น์? ๊ด๋ จ ๋งํฌ ๋จ๊ฒจ๋๊ฒ ์ต๋๋ค :)
https://www.slipp.net/questions/356 |
@@ -0,0 +1,60 @@
+package baseball;
+
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+
+import java.util.Arrays;
+import java.util.List;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class RefereeTest {
+
+ @Test
+ @DisplayName("๋ ๊ฐ์ ๋ฆฌ์คํธ์์ ๋ช ๊ฐ์ ์ซ์๊ฐ ๊ฐ์์ง ํ์ธ")... | Java | ํด๋น ํ
์คํธ ๋ฉ์๋์์ ์์ธ๋ฅผ ์ ์ธ์ ํ๋ ํน๋ณํ ์ด์ ๊ฐ ์๋ค๋ฉด ์ง์์ฃผ์ธ์ :)
ํ
์คํธ ๋ฉ์๋์ ์์ธ ์ ์ธ์ ํจ์ผ๋ก ์จ`ํด๋น ํ
์คํธ๊ฐ ์คํจํ ์๋ ์๋ค`๋ผ๋ ๋๋์ ์ฃผ๋ ๊ฒ ๊ฐ์ต๋๋ค. |
@@ -0,0 +1,61 @@
+package baseball;
+
+import java.util.List;
+
+public class Referee {
+
+ public int countBall(List<Integer> list1, List<Integer> list2) {
+
+ int count = 0;
+ int strike = countStrike(list1, list2);
+
+ for (Integer number : list1) {
+ count = getCount(list2, count,... | Java | ํต์ฌ ๋ก์ง์ ํ๋ฉด(์ฝ์ ์ถ๋ ฅ)์ ๋ํ ์๊ตฌ์ฌํญ์ด ์์ฌ์๋ค์!
๋ง์ฝ ํ๋ฉด ์๊ตฌ์ฌํญ์ด ๋ณํ๊ฒ ๋๋ค๋ฉด ์ด๋ป๊ฒ ๋ ๊น์?
ํ๋ฉด์ ์๊ตฌ์ฌํญ์ด ๋ฐ๋์์ง๋ง ๊ฐ๋ฐ์๊ฐ ์์ ํด์ผํ๋ ๋ถ๋ถ์ ๋๋ฉ์ธ์ ํต์ฌ ๋ก์ง์
๋๋ค.
์๋ ์๊ตฌ์ฌํญ์ ๋ฐ์ํด์ผํ๋ ์ด์ ์ค ํ๋๊ฐ ๋ ์ ์๊ฒ ๋ค์ :)
> ํต์ฌ ๋ก์ง์ ๊ตฌํํ๋ ์ฝ๋์ UI๋ฅผ ๋ด๋นํ๋ ๋ก์ง์ ๊ตฌ๋ถํ๋ค. |
@@ -0,0 +1,56 @@
+package baseball;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Scanner;
+
+public class ScannerUtil {
+
+ public List<Integer> makeScannerNumbers() {
+ System.out.print("์ซ์๋ฅผ ์
๋ ฅํ์ธ์: ");
+
+ ListUtil listUtil = new ListUtil();
+
+ List<Integer> integer... | Java | Scanner๋ ๋งค์ฐ ๋น์ผ ์์์
๋๋ค. ๋ฏธ๋ฆฌ ์์ฑํด๋๊ณ ์ฌํ์ฉํ๋๋ก ํด๋ณด๋ฉด ์ด๋จ๊น์ ?
static ๋ฉ์๋๋ฅผ ํ์ฉํด๋ณด๋ฉด ์ข์ ๊ฒ ๊ฐ์์. |
@@ -0,0 +1,72 @@
+# Domain Documentation
+
+## ๋๋ฉ์ธ ๊ณ์ธต์ ํด๋์ค(๊ฐ์ฒด) ๊ตฌ์กฐ๋
+
+<img width="609" alt="image" src="https://github.com/woowacourse-precourse/javascript-lotto-6/assets/87177577/24677451-b9f5-4c62-919f-f6dc3342bebf"/>
+
+๋จ, `PromotionResult`์ ๊ฒฝ์ฐ ๊ฐ์ฒด๊ฐ ์๋ ๊ฒฐ๊ณผ๋ฌผ๋ก์จ ์กด์ฌํ๋ฉฐ ํด๋น ๋ฐ์ดํฐ๋ `PromotionResultService`์์ ์์ฑํฉ๋๋ค.
+
+<br/>
+
+... | Unknown | ๊น๋ํ documentation ๋ฐฐ์ฐ๊ณ ๊ฐ๋๋ค :) |
@@ -0,0 +1,132 @@
+import { FORMAT_MESSAGE, OUTPUT_MESSAGE } from './module';
+
+describe('๋ฉ์์ง ํฌ๋งท ํ
์คํธ', () => {
+ describe('orderMenus ํ
์คํธ', () => {
+ test.each([
+ {
+ description: '์ถ๋ ฅ ๊ฒฐ๊ณผ๋ "ํผ์ 2๊ฐ - ์ฝ๋ผ 1๊ฐ" ์ด๋ค.',
+ input: [
+ ['ํผ์', 2],
+ ['์ฝ๋ผ', 1],
+ ],
+ output: '... | JavaScript | input, output์ผ๋ก ๋ฌถ์ด์ testCase๋ฅผ ์ฌ๋ฌ๊ฐ์ง ์ค์ ํ๋ ๋ฐฉ๋ฒ๋ ์์๊ตฐ์, ์ข์ ๋ฐฉ๋ฒ ๋ฐฐ์ฐ๊ณ ๊ฐ๋๋ค. |
@@ -0,0 +1,84 @@
+import { PROMOTION_DATE_INFO } from '../promotionSystem.js';
+import { SYMBOLS } from '../symbols.js';
+
+export const INPUT_MESSAGE = Object.freeze({
+ visitDate: `${PROMOTION_DATE_INFO.month}์ ์ค ์๋น ์์ ๋ฐฉ๋ฌธ ๋ ์ง๋ ์ธ์ ์ธ๊ฐ์? (์ซ์๋ง ์
๋ ฅํด ์ฃผ์ธ์!)\n`,
+ orderMenus:
+ '์ฃผ๋ฌธํ์ค ๋ฉ๋ด๋ฅผ ๋ฉ๋ด์ ๊ฐ์๋ฅผ ์๋ ค ์ฃผ์ธ์. (e.g. ํด์ฐ๋ฌผํ์คํ-2,๋ ๋์์ธ... | JavaScript | freeze๋ ๊ฐ์ฒด ์์ ํจ์๋ฅผ ๋ฃ์ด์ return๊ฐ์ผ๋ก ๋ฐ์ ์ ์๋ค๋ ๊ฒ๋ ์๊ฒ ๋์์ต๋๋ค.
์์ฉํ๋ค๋ฉด ๋ง์ด ๊ฐ๋จํ ์ฝ๋๋ฅผ ์์ฑํด ๋ณผ ์ ์์์ ๊ฒ ๊ฐ์ต๋๋ค
์ข์ ์ ๋ณด ๊ฐ์ฌํฉ๋๋ค! |
@@ -0,0 +1,49 @@
+import InputView from '../views/InputView.js';
+import OutputView from '../views/OutputView.js';
+import PromotionResultService from '../service/PromotionResultService.js';
+import ErrorHandler from '../errors/ErrorHandler/module.js';
+
+/**
+ * @module ChristmasPromotionController
+ * ํฌ๋ฆฌ์ค๋ง์ค ํ๋ก๋ชจ์
์ด๋ฒคํธ ... | JavaScript | [Nit] ์ทจํฅ์์ ๊ฐ๋ฆฌ๋ ์์ญ์ด๋ผ๊ณ ์๊ฐํ๋๋ฐ ์ฝ๋ฐฑ ๋์ ์ ๋์ this binding์ ์ฌ์ฉํ์ ์ด์ ๊ฐ ์์ผ์ ๊ฐ์? |
@@ -0,0 +1,132 @@
+import { FORMAT_MESSAGE, OUTPUT_MESSAGE } from './module';
+
+describe('๋ฉ์์ง ํฌ๋งท ํ
์คํธ', () => {
+ describe('orderMenus ํ
์คํธ', () => {
+ test.each([
+ {
+ description: '์ถ๋ ฅ ๊ฒฐ๊ณผ๋ "ํผ์ 2๊ฐ - ์ฝ๋ผ 1๊ฐ" ์ด๋ค.',
+ input: [
+ ['ํผ์', 2],
+ ['์ฝ๋ผ', 1],
+ ],
+ output: '... | JavaScript | ๊ตฌ์กฐ๋ถํด๋ฅผ ์ด์ฉํด `description`์ ๋ฒ๋ฆฌ๊ณ `input`, `output`๋ง ๊ฐ์ ธ์ค๋ ๊ฒ ์ข์ ๊ฒ ๊ฐ๋ค์!
๊ทธ๋ฐ๋ฐ ํ
์คํธ ์ผ์ด์ค๊ฐ ํ๋์ธ ๊ฒ ๊ฐ์๋ฐ `test.each()`๋ฅผ ์ฌ์ฉํ์ ์ด์ ๊ฐ ์๋์ง ๊ถ๊ธํฉ๋๋ค. |
@@ -0,0 +1,49 @@
+import InputView from '../views/InputView.js';
+import OutputView from '../views/OutputView.js';
+import PromotionResultService from '../service/PromotionResultService.js';
+import ErrorHandler from '../errors/ErrorHandler/module.js';
+
+/**
+ * @module ChristmasPromotionController
+ * ํฌ๋ฆฌ์ค๋ง์ค ํ๋ก๋ชจ์
์ด๋ฒคํธ ... | JavaScript | ์ปจํธ๋กค๋ฌ ๋ชจ๋์ด ์งง๊ณ ์ฝ๊ธฐ ํธํ ๊ฒ ๊ฐ์์! |
@@ -0,0 +1,31 @@
+import { PROMOTION_MENU_TABLE } from '../../constants/promotionSystem.js';
+
+/**
+ * @module MenuSearcher
+ * ๋ฉ๋ด ํ
์ด๋ธ์ ์กด์ฌํ๋ ๋ฉ๋ด๋ฅผ ์ฐพ๊ธฐ ์ํ ๋ชจ๋
+ */
+const MenuSearcher = Object.freeze({
+ /**
+ * @param {string} menuName - ๋ฉ๋ด ์ด๋ฆ
+ * @param {string} category - ๋ฉ๋ด ์นดํ
๊ณ ๋ฆฌ
+ * @returns {undefined | string}... | JavaScript | ๋นํธ์ธ ๋ฉ์๋ ํ์ฉ๐๐๐ |
@@ -0,0 +1,53 @@
+import { PROMOTION_DATE_INFO } from '../../constants/promotionSystem.js';
+
+// constant.js๋ ํ
์คํธ ์ฝ๋ ๋ฐ module.js์์๋ง ์ฌ์ฉ
+export const INITIAL_PROMOTION_BENEFIT_RESULT = Object.freeze({
+ xmasBenefitAmount: 0,
+ weekDayBenefitAmount: 0,
+ weekendBenefitAmount: 0,
+ specialBenefitAmount: 0,
+ giftAmo... | JavaScript | ๋๋ฉ์ธ๋ง๋ค ์์ ํ์ผ์ ๋ง๋ค์ด์ ์ฌ์ฉํ๊ณ ๊ณ์๋๋ฐ, ์ด๋ฏธ ์๋ `constants` ๋๋ ํ ๋ฆฌ์ ์์๋ฅผ ๋ฌถ์ด๋์ง ์์ผ์๋ ์ด์ ๊ฐ ์๋์ง ๊ถ๊ธํด์. ๋ง์ฝ ์๋ก์ด ๊ฐ๋ฐ์๊ฐ ๋ค์ด์จ๋ค๋ฉด, `constants`์ ๋ชจ๋ ์์๊ฐ ๋ค์ด ์์ ๊ฑฐ๋ผ๊ณ ๊ธฐ๋ํ ๊ฒ ๊ฐ์๋ฐ์. ์ค์ํ ์์๋ค์ด `domain` ์์ ์๋ ํ์ ๋๋ ํ ๋ฆฌ์ ๋ค์ด์์ด์ ํผ๋์ ์ค ์ ์์ ๊ฒ ๊ฐ์ต๋๋ค. ํ
์คํธ ์ฝ๋ ํ์ผ๋ ๋ง์ฐฌ๊ฐ์ง๋ผ๊ณ ์๊ฐํด์๐
.
์์๋ ํ
์คํธ ํ์ผ ๋ชจ๋ ํน์ ๋๋ ํ ๋ฆฌ ์์ ๋ฌถ์ผ๋ฉด ์ฌ์ฉ์ด๋ ๊ด๋ฆฌ๊ฐ ๋ ์์ํ ๊ฒ ๊ฐ์๋ฐ ์ด๋ป๊ฒ ์๊ฐํ์๋์? ๋ ๊ทธ๋ ๊ฒ ํ๋ฉด `domain`์ ํ์ ๋๋ ํ ๋ฆฌ๋ค์ ... |
@@ -0,0 +1,49 @@
+import InputView from '../views/InputView.js';
+import OutputView from '../views/OutputView.js';
+import PromotionResultService from '../service/PromotionResultService.js';
+import ErrorHandler from '../errors/ErrorHandler/module.js';
+
+/**
+ * @module ChristmasPromotionController
+ * ํฌ๋ฆฌ์ค๋ง์ค ํ๋ก๋ชจ์
์ด๋ฒคํธ ... | JavaScript | ์ด๋ฆ์ ํตํด ์๋ฏธ๋ฅผ ๋ช
ํํ๊ฒ ํ์
ํ ์ ์๋ ๊ฒฝ์ฐ์๋ ์ฃผ์์ด ์์ด๋ ๊ด์ฐฎ์ง ์์๊น์? |
@@ -0,0 +1,143 @@
+import MenuSearcher from '../MenuSearcher/module.js';
+import { PROMOTION_DATE_INFO } from '../../constants/promotionSystem.js';
+import {
+ DAY_OF_BENEFIT_CONDITION,
+ BENEFIT_DATE_INFO,
+ INITIAL_PROMOTION_BENEFIT_RESULT,
+ MINIMUM_TOTAL_ORDER_AMOUNT,
+ BENEFIT_AMOUNT_INFO,
+ MINIMUM_ORDER_AM... | JavaScript | [Nit] ํน๋ณ ํ ์ธ ์ผ์๋ `Date`๋ก ๊ด๋ฆฌํ๋ค๋ฉด ํ์ฑ ๋ก์ง์ `Date` ๊ฐ์ฒด์ ๋ง๊ฒ ์ ์ธ์ ์ผ๋ก ๊ด๋ฆฌ ํ ์ ์์ง ์์๊น์? ์๋๋ฉด ๋ฉ๋ชจ๋ฆฌ์ ์ด์ ์ ๋
ธ๋ฆฌ์ ๊ฑด๊ฐ์? |
@@ -0,0 +1,63 @@
+export const PROMOTION_DATE_INFO = Object.freeze({
+ year: 2023,
+ month: 12,
+});
+
+export const PROMOTION_MENU_TABLE = Object.freeze({
+ ์ ํผํ์ด์ : [
+ {
+ name: '์์ก์ด์ํ',
+ price: 6_000,
+ },
+ {
+ name: 'ํํ์ค',
+ price: 5_500,
+ },
+ {
+ name: '์์ ์๋ฌ๋',
+ ... | JavaScript | `Badge` ๊ฐ์ ๊ฒฝ์ฐ์๋ `EventBadgeMaker` ๋ชจ๋๊ณผ ๊ฐ์ ๋๋ ํ ๋ฆฌ์ ์กด์ฌํ๋๋ฐ ๋ฉ๋ด๋ ๊ฐ์ ๋ชจ๋์ ์๋ค๋ฉด ์ด๋จ๊น์? |
@@ -0,0 +1,277 @@
+import { PROMOTION_DATE_INFO } from '../../constants/promotionSystem';
+import {
+ BENEFIT_AMOUNT_INFO,
+ MINIMUM_ORDER_AMOUNT_FOR_GIFT,
+ INITIAL_PROMOTION_BENEFIT_RESULT,
+ MINIMUM_TOTAL_ORDER_AMOUNT,
+} from './constant';
+import DecemberPromotionPlan from './module';
+
+describe('12์ ์ด๋ฒคํธ ๊ณํ์ ... | JavaScript | `'ํฌ๋ฆฌ์ค๋ง์ค๊ฐ ์ง๋ ์ดํ'`์ `'ํฌ๋ฆฌ์ค๋ง์ค ์ '`์ ๊ธฐ์ค์ผ๋ก ํ
์คํธ๋ฅผ ์งํํ๊ณ ์๋๋ฐ์. ์ด ๋ง๋๋ก๋ผ๋ฉด `'ํฌ๋ฆฌ์ค๋ง์ค ๋น์ผ'`์ ๋ํ ํ
์คํธ๊ฐ ํ์ํ์ง ์์๊น์?
์ค์ ๊ตฌํ ๋ก์ง๋๋ก๋ผ๋ฉด ํฌ๋ฆฌ์ค๋ง์ค ๋น์ผ์๋ ์ด๋ฒคํธ ํํ์ด ์ ์ฉ๋๊ธฐ ๋๋ฌธ์ `'ํฌ๋ฆฌ์ค๋ง์ค ์ ์๋ ํ ์ธ์ด ์ ์ฉ๋๋ค'` ์ชฝ์ ํ
์คํธ์ ํฌํจ๋๊ฒ ์ง๋ง, `'ํฌ๋ฆฌ์ค๋ง์ค ์ '`์ด๋ผ๋ ๋ง์ด `'ํฌ๋ฆฌ์ค๋ง์ค ๋น์ผ'`์ ํฌํจํ์ง ์์์์. ๊ทธ๋์ ์ข ๋ ๋ช
ํํ ๋ป์ ์ ๋ฌํ ์ ์๊ฒ๋ ์์ฑํ๋ฉด ๋ ์ข์ ๊ฒ ๊ฐ์์!
์ ๋ ์ด๋ฐ ์์ผ๋ก ์์ฑํ๋๋ฐ ๋์์ด ๋์ค๊น ํด์ ์ฌ๋ ค๋ด
๋๋ค.
```javascript
descri... |
@@ -0,0 +1,53 @@
+import { PROMOTION_DATE_INFO } from '../../constants/promotionSystem.js';
+
+// constant.js๋ ํ
์คํธ ์ฝ๋ ๋ฐ module.js์์๋ง ์ฌ์ฉ
+export const INITIAL_PROMOTION_BENEFIT_RESULT = Object.freeze({
+ xmasBenefitAmount: 0,
+ weekDayBenefitAmount: 0,
+ weekendBenefitAmount: 0,
+ specialBenefitAmount: 0,
+ giftAmo... | JavaScript | P5- ํ์ฑ ๋ก์ง์ด ์ ํธ๋ฆฌํฐ ํจ์๋ก ๋น ์ง ์ ์์ ๊ฒ ๊ฐ์์! |
@@ -0,0 +1,48 @@
+import { addCalculation } from '../../utils/number.js';
+
+/**
+ * @module PromotionReceipt
+ * ์ด ํํ ๊ธ์ก ๋ฐ ์์ ์ง์ถ ๊ธ์ก์ ๋ฌถ์ด ํ๋ก๋ชจ์
๊ฒฐ๊ณผ์ ๋ํ ์์์ฆ์ ํํํ ๋ชจ๋
+ */
+const PromotionReceipt = Object.freeze({
+ /**
+ *
+ * @param {{promotionBenefitResult : import('../../utils/jsDoc.js').PromotionBenefitResult, tota... | JavaScript | ์ค ์ด๊ฑฐ ์ ๋ฐํ๋ค์ใ
ใ
ใ
`sort` ๊ฐ์ ๋ฉ์๋์์๋ ๋ณํํด์ ์ธ ์ ์๊ฒ ์ด์! |
@@ -0,0 +1,47 @@
+import MenuSearcher from './module.js';
+
+describe('๋ฉ๋ด ์ฐพ๊ธฐ ํ
์คํธ', () => {
+ describe('findByMenuName ํ
์คํธ', () => {
+ test.each([
+ {
+ menuName: 'ํฐ๋ณธ์คํ
์ดํฌ',
+ category: '์คํ
์ดํฌ',
+ expectedMenu: { name: 'ํฐ๋ณธ์คํ
์ดํฌ', price: 55000 },
+ },
+ {
+ menuName: '์ด์ฝ์ผ์ดํฌ',
+... | JavaScript | ์์ฆ ๋ค์ด ํ
์คํธ์ฝ๋๋ฅผ ์งค๋ `boolean ๋ฐํ ํจ์`์ ๋ํ test suite ๋ถ๋ฆฌ์ ๋ํด ์๊ฐ์ ํ๊ฒ ๋๋๋ผ๊ตฌ์.
_`toBeTruthy`์ `toBeFalsy` matcher๋ ์กด์ฌํ๋๋ฐ ๋ฐํ๊ฐ์ด `boolean`์ธ ๊ฒฝ์ฐ์๋ test suite๋ฅผ ๋ถ๋ฆฌํ๋๊ฒ ๋ง๋?_ ๋ผ๋ ์๊ฐ์ด ๋ค์ด์์! matcher๋ ๋ ๋ช
์์ ์ผ๋ก ์ฝํ๊ณ ํ๋ผ๋ฏธํฐ ํ
์คํธ์ ํ๋ผ๋ฏธํฐ๋ ์ข ๋ ๊ฐ๋ณ๊ฒ ๋ค๋ฃฐ ์๋ ์์๊ฒ ๊ฐ๊ตฌ์.
์ง์๋ ์๊ฒฌ์ ์ด๋ ์ ๊ฐ์? |
@@ -0,0 +1,277 @@
+import { PROMOTION_DATE_INFO } from '../../constants/promotionSystem';
+import {
+ BENEFIT_AMOUNT_INFO,
+ MINIMUM_ORDER_AMOUNT_FOR_GIFT,
+ INITIAL_PROMOTION_BENEFIT_RESULT,
+ MINIMUM_TOTAL_ORDER_AMOUNT,
+} from './constant';
+import DecemberPromotionPlan from './module';
+
+describe('12์ ์ด๋ฒคํธ ๊ณํ์ ... | JavaScript | `test.each()`๋ฅผ ์ฌ์ฉํ๊ณ ์์ง๋ง ์ฝ๋๊ฐ ์ค๋ณต๋๊ณ ์๊ณ , ๋ผ์ธ ์๊ฐ ๋๋ฌด ๊ธด ๊ฒ ๊ฐ์์. "ํ๋์ ํจ์์ ๋ผ์ธ ์๊ฐ 15๋ฅผ ๋์ง ์์์ผ ํ๋ค"๋ ์๊ตฌ ์ฌํญ์ด ์๋ ๊ฒ์ฒ๋ผ, ํ
์คํธ ์ฝ๋๋ ๋ผ์ธ ์๊ฐ ๋๋ฌด ๊ธธ๋ฉด ์ฝ๊ธฐ๊ฐ ํ๋ค ๊ฒ ๊ฐ์์.
์ด๋ฐ ์์ผ๋ก ๋ณ๊ฒฝํ๋ฉด ๋ผ์ธ ์๋ ํ ์ค์ผ ์ ์๋๋ฐ ๊ณ ๋ คํด๋ณด์๋ ๊ฑด ์ด๋จ๊น์?
```javascript
test.each([3, 10, 17, 24 ...])(
'12์ %d์ผ์ ํน๋ณ ํ ์ธ ์ด๋ฒคํธ๊ฐ ์ ์ฉ๋๋ค',
(visitDate) => {
// given
const expected = BENEFIT... |
@@ -0,0 +1,143 @@
+import MenuSearcher from '../MenuSearcher/module.js';
+import { PROMOTION_DATE_INFO } from '../../constants/promotionSystem.js';
+import {
+ DAY_OF_BENEFIT_CONDITION,
+ BENEFIT_DATE_INFO,
+ INITIAL_PROMOTION_BENEFIT_RESULT,
+ MINIMUM_TOTAL_ORDER_AMOUNT,
+ BENEFIT_AMOUNT_INFO,
+ MINIMUM_ORDER_AM... | JavaScript | ๋ง์ ๋ถ๋ถ์์ ์ผํญ ์ฐ์ฐ์๋ฅผ ์ฌ์ฉํ๊ณ ๊ณ์๋๋ฐ, `if`๋ฌธ์ ์ฌ์ฉํ์ง ์์ผ์๋ ์ด์ ๊ฐ ์๋์ง ๊ถ๊ธํฉ๋๋ค. |
@@ -0,0 +1,48 @@
+import { addCalculation } from '../../utils/number.js';
+
+/**
+ * @module PromotionReceipt
+ * ์ด ํํ ๊ธ์ก ๋ฐ ์์ ์ง์ถ ๊ธ์ก์ ๋ฌถ์ด ํ๋ก๋ชจ์
๊ฒฐ๊ณผ์ ๋ํ ์์์ฆ์ ํํํ ๋ชจ๋
+ */
+const PromotionReceipt = Object.freeze({
+ /**
+ *
+ * @param {{promotionBenefitResult : import('../../utils/jsDoc.js').PromotionBenefitResult, tota... | JavaScript | ์ด ์ ํ๋ฆฌ์ผ์ด์
์ด ์ถ๋ ฅํ๋ ๋ฐ์ดํฐ๋ฅผ ๋ชจ๋ฅด๋ ์ฌ๋์ด ๋ณธ๋ค๋ฉด, `benefitAmount`์ `totalBenefitAmount`๋ฅผ ํท๊ฐ๋ คํ ๊ฒ ๊ฐ์์. ์ด ํํ ๊ธ์ก์์ ์ฆ์ ๋ฉ๋ด์ ๊ธ์ก์ ๋บ ๊ฐ์ ์ด ํ ์ธ ๋ฐ์ ๊ธ์ก์ด๋๊น `discountedAmount`๋ผ๊ณ ํํํ ์ ์์ง ์์๊น์? |
@@ -0,0 +1,132 @@
+import { FORMAT_MESSAGE, OUTPUT_MESSAGE } from './module';
+
+describe('๋ฉ์์ง ํฌ๋งท ํ
์คํธ', () => {
+ describe('orderMenus ํ
์คํธ', () => {
+ test.each([
+ {
+ description: '์ถ๋ ฅ ๊ฒฐ๊ณผ๋ "ํผ์ 2๊ฐ - ์ฝ๋ผ 1๊ฐ" ์ด๋ค.',
+ input: [
+ ['ํผ์', 2],
+ ['์ฝ๋ผ', 1],
+ ],
+ output: '... | JavaScript | ํ
์คํธ ์ผ์ด์ค๊ฐ ์ถฉ๋ถํ ๋ ์๊ธธ ์ ์๋ค๊ณ ์๊ฐํด์ each๋ฅผ ์ฌ์ฉํ๊ฑฐ๋ ์๊ณ , ํ
์คํธ ์ผ์ด์ค๋ฅผ ๋ณ์๋ช
๊ณผ ํจ๊ป ์ฌ์ฉํ๊ธฐ ํธํด์ ์ฌ์ฉํ๋๊ฒ๋ ์์ต๋๋ค.
์ ๊ฐ description์ ๊ตณ์ด ๋ ์ด์ ๋ ๋ฐ์ดํฐ๊ฐ ์ค๋ฐ๊ฟ์ด ์์ด์ ํ๋ฉด์์ ๋ง์ด ๊นจ์ ธ์ ๊ทธ๊ฑธ ์ข ๋ ๊ฐ์ ํ๊ณ ์ ์ถ๊ฐํ์ต๋๋ค! |
@@ -0,0 +1,53 @@
+import { PROMOTION_DATE_INFO } from '../../constants/promotionSystem.js';
+
+// constant.js๋ ํ
์คํธ ์ฝ๋ ๋ฐ module.js์์๋ง ์ฌ์ฉ
+export const INITIAL_PROMOTION_BENEFIT_RESULT = Object.freeze({
+ xmasBenefitAmount: 0,
+ weekDayBenefitAmount: 0,
+ weekendBenefitAmount: 0,
+ specialBenefitAmount: 0,
+ giftAmo... | JavaScript | ์๋ก์ด ๊ฐ๋ฐ์๊ฐ ๋ค์ด์ค๋ฉด ๊ทธ ๋ถ์ด ์ค์ค๋ก ํ๋จํ ๊ฒ ์๋๋ผ ํ๋ก์ ํธ์ ๋ํ ์ค๋ช
์ ์ถฉ๋ถํ ์ธ์์ธ๊ณ ๋ฐ๋๊ฒ ๋จผ์ ๋ผ๊ณ ์๊ฐํฉ๋๋ค.
์ ๊ฐ ๋ฐ๋ก ๊ด๋ฆฌํ ์ด์ ๋ ์์๋ฅผ ๊ธฐ์กด์๋ ํ
์คํธ์ฝ๋์ ์์ค ์ฝ๋์์ ์ฌ ์ฌ์ฉ๋๋ ๊ฐ๋ค์ ๊ด๋ฆฌํ๊ณ ์ ์์์ ๊ด๋ จ๋ ๋๋ฉ์ธ์์ ๊ด๋ฆฌ๋ฅผ ํ์ฌ ์ฝ๋ ์์ง์ฑ์ ๊ฐํ ํ์์ต๋๋ค.
์ด๋ฒ ๋ฏธ์
์ ๊ฒฝ์ฐ ์์ ๊ฐ์ด ๋๋ฌด ๋ง์ด ๋ฐ์ํด์ ๋ก์ง ๋ด๋ถ๋ฅผ ํ์
ํ๊ธฐ ์ด๋ ค์ ์๊ณ (๋ฌผ๋ก ์ด ๋ถ๋ถ์ ๋ ๋ถ๋ฆฌ๋ฅผ ํ๋ค๋ฉด ๊ฐ์ ๊ฐ๋ฅํ์๊ฑฐ๋ผ๊ณ ์๊ฐํด์.) ์ธ์คํด์ค์ ์๋ช
์ฃผ๊ธฐ๊ฐ ๋์ฒด๋ก ์งง์ ํ์ ํจ์ํ ๋ชจ๋๋ก ๊ฐ์ ์ ํ์ต๋๋ค.
๊ทธ ๊ณผ์ ์์ ๋๋ฉ์ธ static ์์๋ฅผ ์ด๋ป๊ฒ ๊ด๋ฆฌํ ๊น... |
@@ -0,0 +1,49 @@
+import InputView from '../views/InputView.js';
+import OutputView from '../views/OutputView.js';
+import PromotionResultService from '../service/PromotionResultService.js';
+import ErrorHandler from '../errors/ErrorHandler/module.js';
+
+/**
+ * @module ChristmasPromotionController
+ * ํฌ๋ฆฌ์ค๋ง์ค ํ๋ก๋ชจ์
์ด๋ฒคํธ ... | JavaScript | mvc๋ฅผ ์์๋ ๋ถ๋ค์ ์ฝ๊ฒ ์ดํดํ์๊ฒ ์ง๋ง controller์ ์ญํ ์ ์ดํดํ์์ง ๋ชปํ๋ ๋ถ๋ค๋ ์์๊ฑฐ๋ผ ์๊ฐํด์ ์ฃผ์์ ๋จ๊ฒผ์ต๋๋ค.
๋ํ, ์ฝ๋์ ์ผ๊ด์ฑ์ ์ด์ ๋ ์์๋๊ฑฐ ๊ฐ์ต๋๋ค! |
@@ -0,0 +1,277 @@
+import { PROMOTION_DATE_INFO } from '../../constants/promotionSystem';
+import {
+ BENEFIT_AMOUNT_INFO,
+ MINIMUM_ORDER_AMOUNT_FOR_GIFT,
+ INITIAL_PROMOTION_BENEFIT_RESULT,
+ MINIMUM_TOTAL_ORDER_AMOUNT,
+} from './constant';
+import DecemberPromotionPlan from './module';
+
+describe('12์ ์ด๋ฒคํธ ๊ณํ์ ... | JavaScript | ์ ํ
์คํธ์ ๋ชฉ์ ์ 25์ผ์ด ์ด๋ฒคํธ ์ข
๋ฃ ์์ ์ด๋ผ ๊ทธ ๊ฒฝ๊ณ ๊ฐ๋ค์ ์ด๋ฒคํธ ์ ์ฉ ์ฌ๋ถ๋ฅผ ํ
์คํธํ๋๊ฒ ๊ฐ์ฅ ์ค์ํ๋ค๊ณ ์๊ฐํด์ ์ ๋ ๊ฒ ํ
์คํธ๋ฅผ ์งํํ์ต๋๋ค.
์์ฑ์๋์ ์๊ฒฌ๋ ์ ๋ ๋ง๋ค๊ณ ์๊ฐํด์. ๋ค๋ง, ์ ๋ ํ์ฌ ํ
์คํธ ์ฝ๋๊ฐ ๊ธด ์ํฉ์์ 1~25์ผ์ ๋ชจ๋ ํ
์คํธํ๋๊ฒ ๋น์ฉ์ด ๋๋ฌด ํฌ๋ค๊ณ ์๊ฐํด์ ๋ค์๊ณผ ๊ฐ์ด ํ
์คํธ๋ฅผ ์งํํ์ต๋๋ค! |
@@ -0,0 +1,277 @@
+import { PROMOTION_DATE_INFO } from '../../constants/promotionSystem';
+import {
+ BENEFIT_AMOUNT_INFO,
+ MINIMUM_ORDER_AMOUNT_FOR_GIFT,
+ INITIAL_PROMOTION_BENEFIT_RESULT,
+ MINIMUM_TOTAL_ORDER_AMOUNT,
+} from './constant';
+import DecemberPromotionPlan from './module';
+
+describe('12์ ์ด๋ฒคํธ ๊ณํ์ ... | JavaScript | ์ด๊ฑด ์์ฑ์๋์ด api ์คํ์ ์๋ชป ์ดํดํ๊ณ ๊ณ์ ๊ฑฐ ๊ฐ์์..! ์ ๋ ๊ฐ์ํ ํ ์ ์์์ผ๋ฉด ์ข์๊ฒ ์ง๋ง, ํ์ฌ ํ์ํ ์ ๋ณด๊ฐ visitDate, orderMenuInfo, totalOrderAmount ์ด 3๊ฐ์ง ์ ๋ณด๊ฐ ํ์ํด์ ์ด์ฉ์ ์์ด ์ ๋ ๊ฒ ์ฝ๋๋ฅผ ์ง ๊ฒ ์
๋๋ค..!
๋ํ ์ ๋ ์คํ๋ ค ๊ฐ์ฒด๋ก ๋ํ๋ด๋๊ฒ ์ฝ๊ฐ์ ๋ณต์ก๋๊ฐ ์ฌ๋ผ๊ฐ์ง์ธ์ ๋ ๋ช
์์ ์ผ๋ก ํ
์คํธ ์คํ์ ์ ๊ณตํด์ ๊ฐ๋
์ฑ์ด ๋ ๋๋ค๊ณ ์๊ฐํ๋ ์
์ฅ์ด๋ผ ์ฐธ๊ณ ํด์ฃผ์๋ฉด ์ข์๊ฑฐ ๊ฐ์์ !! |
@@ -0,0 +1,143 @@
+import MenuSearcher from '../MenuSearcher/module.js';
+import { PROMOTION_DATE_INFO } from '../../constants/promotionSystem.js';
+import {
+ DAY_OF_BENEFIT_CONDITION,
+ BENEFIT_DATE_INFO,
+ INITIAL_PROMOTION_BENEFIT_RESULT,
+ MINIMUM_TOTAL_ORDER_AMOUNT,
+ BENEFIT_AMOUNT_INFO,
+ MINIMUM_ORDER_AM... | JavaScript | if๋ฌธ์ ์ฌ์ฉํ๋ฉด early return์ผ๋ก 2๋ฒ return๋ฌธ์ ์ฌ์ฉํด์ผํ์ง๋ง 3ํญ ์ฐ์ฐ์๋ ๊ฐ์ด๊ธฐ ๋๋ฌธ์ return๋ฌธ์ ๊ฐ์ํ ํ ์ ์๊ธฐ ๋๋ฌธ์
๋๋ค! |
@@ -0,0 +1,35 @@
+package nextstep.subway.applicaion;
+
+import java.util.List;
+import nextstep.subway.applicaion.dto.PathResponse;
+import nextstep.subway.domain.Line;
+import nextstep.subway.domain.LineRepository;
+import nextstep.subway.domain.Path;
+import nextstep.subway.domain.PathFinder;
+import nextstep.subway... | Java | ๊ฒฝ๋ก๋ฅผ ์ฐพ๊ธฐ์ํด lines๋ผ๋ ์ ๋ณด๊ฐ ์๊ณ , ์ด ์ ๋ณด๋ฅผ ์ด์ฉํด ๊ฒฝ๋ก๋ฅผ ์ฐพ๋๋ฐ ์ด ๊ฒฝ๋ก๋ฅผ ์ฐพ๋ ์ฑ
์์ PathFinder๊ฐ ๊ฐ์ง๊ณ ์๊ณ ๊ทธ ๊ฒฐ๊ณผ ์ ๋ณด๋ Path๊ฐ ๊ฐ์ง๊ณ ์๋ค์!
๊ฐ์ฒด์งํฅ์์ ๊ฐ์ฒด๋ ์ํ์ ํ์๋ก ์ด๋ฃจ์ด์ ธ์๋ค๊ณ ํ๋๋ฐ์
๊ฒฝ๋ก๋ฅผ ์ฐพ๊ธฐ ์ํ ์ํ์ธ lines์ ํ์์ธ PathFinder๋ฅผ ํ๋์ ๊ฐ์ฒด๋ก ๋์ถํด๋ณผ ์๋ ์์๊น์?
๋ง์ฝ์ ์ด๋ ๊ฒ ๋ฆฌํฉํฐ๋ง ํ ๊ฒฝ์ฐ ๊ธฐ์กด์ ๋ง๋ค์ด ๋์๋ ํ
์คํธ๋ฅผ ํ์ฉํด์ ํ
์คํธ์ ๊ฒ์ฆ์ด๋ผ๋ ๋ณดํธ ์์ ๋ฆฌํฉํฐ๋ง์ ํด๋ณด์๋ ๊ฒ์ ๊ถํด๋๋ฆฝ๋๋ค! |
@@ -63,19 +63,19 @@ public void update(Station newUpStation, int minusDistance) {
}
public Section merge(Section section) {
- if (!isDownStation(section.upStation)) {
+ if (!hasDownStationAs(section.upStation)) {
throw new IllegalArgumentException("ํฉ์น๋ ค๋ ๊ตฌ๊ฐ์ ์ํ์ญ์ด ํํ์ญ๊ณผ ๊ฐ์์ผ ํฉ๋๋ค.");
... | Java | ๋ณ๊ฒฝ๋ ๋ค์ด๋ฐ์ด ์๋ฏธ๋ฅผ ์กฐ๊ธ ๋ ์ ์ ๋ฌํ๋ ๊ฒ ๊ฐ์์ ๐ |
@@ -1,6 +1,7 @@
package nextstep.subway.domain;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
@@ -34,23 +35,30 @@ public void add(Section section) {
public void remove(Station station) {
validationRemoveStation(sta... | Java | ์ ์ ํ ์ฌ์ด์ฆ๋ก ๋ฉ์๋๋ฅผ ๋๋์ด ์ฃผ์
จ๋ค์ ๐ |
@@ -0,0 +1,48 @@
+package nextstep.subway.unit;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import nextstep.subway.domain.Line;
+import nextstep.subway.domain.Station;
+import org.springframework.test.util.ReflectionTestUtils;
+
+public class PathFixture {
+ /** (10... | Java | ํฝ์ค์ณ ๋ถ๋ฆฌ๋ฅผ ํตํด ํ
์คํธ ์ฝ๋ ๋ด ํจ๊ณผ์ ์ธ ์ค๋ณต ์ ๊ฑฐ ๐ |
@@ -0,0 +1,120 @@
+package nextstep.subway.acceptance;
+
+import static nextstep.subway.acceptance.LineSteps.์งํ์ฒ _๋
ธ์ _์์ฑ_์์ฒญ;
+import static nextstep.subway.acceptance.LineSteps.์งํ์ฒ _๋
ธ์ ์_์งํ์ฒ _๊ตฌ๊ฐ_์์ฑ_์์ฒญ;
+import static nextstep.subway.acceptance.PathSteps.๊ฒฝ๋ก_์กฐํ_์์ฒญ;
+import static nextstep.subway.acceptance.StationSteps.์งํ์ฒ ์ญ_์... | Java | ๋จ์ ํ
์คํธ์ ํฝ์ค์ณ ๊ด๋ฆฌ ๋ฐฉ๋ฒ์ฒ๋ผ ํด๋น ๊ฐ์ฒด๋ค์ ์ฌ์ฌ์ฉ์ด ํ์ํ ๊ฒฝ์ฐ ์ธ์ ํ
์คํธ์ฉ ํฝ์ค์ณ๋ฅผ ๋ง๋ค์ด์ ๊ด๋ฆฌํ ์ ๋ ์๊ฒ ๋ค์! |
@@ -0,0 +1,31 @@
+import {
+ ModalBody,
+ ModalButtonContainer,
+ ModalCloseButton,
+ ModalContainer,
+ ModalDescription,
+ ModalDimmedLayer,
+ ModalHeader,
+ ModalInputField,
+ ModalTitle,
+} from './index';
+
+interface ModalProp {
+ children: JSX.Element;
+}
+
+const Modal = ({ children }: ModalProp) => {
... | Unknown | ํน์ ์ด๋ฒ ๋ฏธ์
์์ Compound Component ์ฌ์ฉ์ ๋ํ ๊ณ ๋ฏผ์ด ์์ผ์
จ์๊น์?
์ง๊ธ Modal์ ์ธํฐํ์ด์ค๋ฅผ ๋ณด๋ฉด, ๋ชจ๋ ์ต์
๋ค์ด prop์ผ๋ก ๋ค์ด์ค๊ณ ์์ด์ ๊ด์ฌ์ฌ ๋ณ๋ก ๋๋์ด ํ์ธํ๋ ๋ฐ ์ค๋๊ฑธ๋ฆฌ๋ ๊ฒ ๊ฐ์์..! ์๋ฅผ ๋ค๋ฉด, ๋ชจ๋ฌ์ ์ธ์ ์ธ ์์์ธ size, position์ ๋ฌถ์ด์ ์๊ฐํด์ผ ๋ ๋ ๊ทธ ๋์ ํ ๋์ ํ์
ํ๊ธฐ ์ด๋ ค์ด ๊ฒ ๊ฐ์ต๋๋ค!
๋ง์ฝ props์ผ๋ก ๊ด๋ฆฌํ๋ค๋ฉด, ๊ด์ฌ์ฌ ๋ณ๋ก ์กฐ๊ธ ๋ญ์ณ๋ณด๋ฉด ์ด๋จ๊น์? ์๋ ์์ ์ฝ๋ ์ฒ๋ผ์!
```typescript
interface ModalProps {
isOpened: boole... |
@@ -0,0 +1,31 @@
+import {
+ ModalBody,
+ ModalButtonContainer,
+ ModalCloseButton,
+ ModalContainer,
+ ModalDescription,
+ ModalDimmedLayer,
+ ModalHeader,
+ ModalInputField,
+ ModalTitle,
+} from './index';
+
+interface ModalProp {
+ children: JSX.Element;
+}
+
+const Modal = ({ children }: ModalProp) => {
... | Unknown | ์ค.. ๋ฐ๋ค๊ฐ ๊ณต์ ํด ์ค createPortal์ ์ฌ์ฉํ์
จ๊ตฐ์! createPortal์ ์ฌ์ฉํ๋ฉด์ ์ป์ ์ธ์ฌ์ดํธ๋ ๋๋ ๋ฐ๊ฐ ์๋ค๋ฉด ๊ณต์ ํด์ฃผ์๋ฉด ์ ๋ง ์ข์ ๊ฒ ๊ฐ์์~~~
๋, Modal ์ปดํฌ๋ํธ์ UI ๋ก์ง์ ์ ๋ง ์ ๋๋ ์ ํ ๋์ ํ ๋ณด์ฌ์ ์ข์ต๋๋ค! |
@@ -0,0 +1,31 @@
+import {
+ ModalBody,
+ ModalButtonContainer,
+ ModalCloseButton,
+ ModalContainer,
+ ModalDescription,
+ ModalDimmedLayer,
+ ModalHeader,
+ ModalInputField,
+ ModalTitle,
+} from './index';
+
+interface ModalProp {
+ children: JSX.Element;
+}
+
+const Modal = ({ children }: ModalProp) => {
... | Unknown | ๋ชจ๋ฌ ๋ด๋ถ์ ๊ฐ ์น์
์ ์ปดํฌ๋ํธ๋ก ๋ถ๋ฆฌํ์ฌ ์ฌ์ฌ์ฉ ํ ์ ์ด ์ธ์์ ์
๋๋ค!
์ปดํฌ๋ํธ๋ฅผ ์ ๋๋์ด์ Alert, Confirm, Prompt์ ๊ฐ์ ์ถ๊ฐ์ ์ธ ์๊ตฌ์ฌํญ์ด ์๋ ํฐ ๋ฌธ์ ์์ด ๋์ํ ์ ์๊ฒ ๋ค์!! |
@@ -0,0 +1,31 @@
+import {
+ ModalBody,
+ ModalButtonContainer,
+ ModalCloseButton,
+ ModalContainer,
+ ModalDescription,
+ ModalDimmedLayer,
+ ModalHeader,
+ ModalInputField,
+ ModalTitle,
+} from './index';
+
+interface ModalProp {
+ children: JSX.Element;
+}
+
+const Modal = ({ children }: ModalProp) => {
... | Unknown | ๋ค ๋ง์์! Compound Component๋ฅผ ์ฌ์ฉํ๋ฉด, ์ฃผ์ด์ง alert, comfirm, prompt, ๊ทธ๋ฆฌ๊ณ ์ถํ ์ถ๊ฐ์ ์ผ๋ก ๋ฐ์ํ ์ ์๋ ์๊ตฌ์ฌํญ modal type์ ๋ง์ถฐ์ ์์ฝ๊ฒ ๋์์ด ๊ฐ๋ฅํ์ง ์์๊น ์๊ฐํ์ต๋๋ค!
๋ค๋ง, compound component์ ์ง์์ด ๋ถ์กฑํ๊ณ ์ฌ๊ธฐ์ ์์ ์๊ฐ์ด ๋ถ์กฑํด์ compound component์ ์ฅ์ ์ ์ ๋๋ก ์ด๋ฆฌ์ง ๋ชปํ๋ ๊ฒ ๊ฐ๋ค์!
interface๋ฅผ ์์ฑํ๊ณ docs๋ฅผ ์์ฑํ ๋ ์ ์ค์ค๋ก๋ ์์๊ฐ ํท๊ฐ๋ฆฌ๊ณ ์ด๋ป๊ฒ ์ ๋ ฌํด์ผ ์ข์์ง ๊ณ ๋ฏผ์ด์๋๋ฐ ๋ง์ํด ์ฃผ์ ๋๋ก ๊ด์ฌ์ฌ ๋ณ๋ก ๋ญ์ณ์ ์์ฑํ๋๊ฒ ์ข์... |
@@ -0,0 +1,31 @@
+import {
+ ModalBody,
+ ModalButtonContainer,
+ ModalCloseButton,
+ ModalContainer,
+ ModalDescription,
+ ModalDimmedLayer,
+ ModalHeader,
+ ModalInputField,
+ ModalTitle,
+} from './index';
+
+interface ModalProp {
+ children: JSX.Element;
+}
+
+const Modal = ({ children }: ModalProp) => {
... | Unknown | ์ฐ์ createPortal์ ์ด์ฉํด์ document.body๋ก ์์น๋ฅผ ์ฎ๊ฒจ์ฃผ๋ค ๋ณด๋ ๋ค๋ฅธ stack context๊ฐ ๋์ด์ z-Index ๊ด๋ฆฌ์ ์ ์ฉํ๋ค๋ ์ ์ด์์ด์!
๋ง์ฝ ์ฌ์ฉํ๋ ์ ์ ๊ฐ
```xml
<body>
<app>
<Modal />
<OtherComponent />
</app>
</body>
```
์ ๊ฐ์ด ์ฌ์ฉํ๋ค๊ณ ํ์ ๋, ์ ํฌ๊ฐ ์ ๊ณตํ๋ modal์ zindex๊ฐ 300 ์ด๊ณ , use์ OtherComponent์ zindex๊ฐ 500์ด๋ผ๋ฉด ์ด ๋์ ๊ฐ์ stack context์ ... |
@@ -0,0 +1,31 @@
+import {
+ ModalBody,
+ ModalButtonContainer,
+ ModalCloseButton,
+ ModalContainer,
+ ModalDescription,
+ ModalDimmedLayer,
+ ModalHeader,
+ ModalInputField,
+ ModalTitle,
+} from './index';
+
+interface ModalProp {
+ children: JSX.Element;
+}
+
+const Modal = ({ children }: ModalProp) => {
... | Unknown | ์ด๋ถ๋ถ์ ์ํด์ compound component๋ฅผ ์ ์ฉํ๋ ค๊ณ ํ๊ณ , ์ฅ์ ์ ์ ๋ชป์ด๋ ธ๋ค๊ณ ์๊ฐํ๋๋ฐ
์์ผ๊ฐ ์ ์๋๋ฅผ ์๋ฒฝํ ํ์
ํ์ ๊ฑธ ๋ณด๋, ๊ทธ๋ ์ง๋ง์ ์์๋ ๊ฒ ๊ฐ๋ค์! ๐ |
@@ -0,0 +1,31 @@
+import {
+ ModalBody,
+ ModalButtonContainer,
+ ModalCloseButton,
+ ModalContainer,
+ ModalDescription,
+ ModalDimmedLayer,
+ ModalHeader,
+ ModalInputField,
+ ModalTitle,
+} from './index';
+
+interface ModalProp {
+ children: JSX.Element;
+}
+
+const Modal = ({ children }: ModalProp) => {
... | Unknown | ์์ธํ ๊ณต์ ๊ฐ์ฌํฉ๋๋ค!! ์ฌ์ฉํด๋ณด์ง ์์์ง๋ง, ๋๋ถ์ ์ด๋ค ์ ์ฉํจ์ด ์๋ ์ง๋ ํ์คํ ์๊ฒ ๋ค์!! |
@@ -0,0 +1,31 @@
+import {
+ ModalBody,
+ ModalButtonContainer,
+ ModalCloseButton,
+ ModalContainer,
+ ModalDescription,
+ ModalDimmedLayer,
+ ModalHeader,
+ ModalInputField,
+ ModalTitle,
+} from './index';
+
+interface ModalProp {
+ children: JSX.Element;
+}
+
+const Modal = ({ children }: ModalProp) => {
... | Unknown | compound component ์ ์ฉ๋ง ์ํ์
จ์ง, ๊ฑฐ์ง ์ ์ฉ๋ ๊ฑฐ๋ ๋ค๋ฆ ์์ ์ ๋๋ก ์๋ฒฝํ ๋ถ๋ฆฌ์ธ ๊ฒ ๊ฐ์ต๋๋ค ใ
ใ
ใ
์ ์ฉํ๋ ค๊ณ ํ๋ฉด ์์ ๋ณ๋ก ์์ด ๊ธ๋ฐฉ ์ ์ฉ๋ ๊ฒ ๊ฐ๋ค์. |
@@ -0,0 +1,136 @@
+import Event from "../src/domain/Event.js";
+
+describe('์ด๋ฒคํธ ๊ด๋ฆฌ์ Event ํด๋์ค ํ
์คํธ', () => {
+ test.each([['0'], ['-25'], ['1.1'], ['32']])('1๋ถํฐ 31 ์ฌ์ด์ ์์ฐ์๊ฐ ์๋์ ์์ธ์ฒ๋ฆฌ', (input) => {
+ expect(() => {
+ const event = new Event(input);
+ event.date()
+ }).toThrow('[ERROR]');
+ });
+
+ test... | JavaScript | ๊ฐ ํ
์คํธ์ ๋ํด ๋จ์ผ ๊ฐ์ ์ฃผ๋ ๊ฒฝ์ฐ์ ๋ํด์๋ []๋ฅผ ํฌํจํ์ง ์์๋ ๋๋ ๊ฑธ๋ก ์๊ณ ์์ด์!! ํ ๋ฒ ํ์ธํด๋ณด์๋ฉด ์ข์ ๊ฒ ๊ฐ์์ |
@@ -0,0 +1,110 @@
+import {
+ priceFilter,
+ PRICE_REFINER,
+ merageFoodInfo,
+ BENEFITS_REFINER,
+ isNotApplicableBenefits
+} from "../src/constants/ViewRefiner.js";
+
+test('์ซ์๋ฅผ ์ฒ๋จ์๋ก ์๋ผ์ ๋ฌธ์๋ก ๋ณํ๋๋์ง ํ
์คํธ', () => {
+ const NUMBER = 1234567890;
+ const PRICE_STRING = '1,234,567,890';
+
+ expect(priceFilter(NUMBE... | JavaScript | ๋๋ฉ์ธ ๋ก์ง์ด๋ ํ์ค ๋ฌธ์ ์ ๋ํ ์์ฌ๊ฒฐ์ ์ ํ๋ ์ฝ๋๋ก ์๊ณ ์๋๋ฐ, ํน์ ํด๋น ํ
์คํธ๊ฐ ๋๋ฉ์ธ ๋ก์ง์ ๋ํ ํ
์คํธ์ธ์ง ์ฌ์ญ๊ณ ์ถ์ต๋๋น! |
@@ -1,7 +1,67 @@
-export default OutputView = {
- printMenu() {
- Console.print("<์ฃผ๋ฌธ ๋ฉ๋ด>");
- // ...
- }
- // ...
-}
+import { Console } from "@woowacourse/mission-utils";
+import { ANSWER } from "./constants/PlannerMesseage.js";
+import { PRICE_REFINER, BENEFITS_REFINER } from "./constants/ViewR... | JavaScript | **OutputView**๊ฐ ์ ๋ง ๊น๋ํ๊ฒ ์ ์ ๋ฆฌ๋์ด ์๋ ๊ฒ ๊ฐ์ต๋๋ค ! ๐๐ |
@@ -0,0 +1,81 @@
+import Supervisor from "../domain/Supervisor.js";
+import InputView from "../InputView.js";
+import OutputView from "../OutputView.js";
+
+class EventPlanner {
+ #supervisor;
+
+ constructor() {
+ this.#supervisor = new Supervisor();
+ }
+
+ async start() {
+ OutputView.printIntroduce();
+... | JavaScript | `getDate`์ `getMenu` ๋ฉ์๋์์ ์ฌ์
๋ ฅ ์์ฒญ์ ๋ํ `try catch` ๊ตฌ๋ฌธ์ด ์ค๋ณต๋์ด์ ์ฌ์ฉ๋๋ ๊ฒ ๊ฐ์์! ์ฌ์
๋ ฅ ์์ฒญ์ ๋ํ `try catch` ๊ตฌ๋ฌธ์ ํจ์๋ก ๋ถ๋ฆฌํ๋ ๋ฐฉ๋ฒ์ ๋ํด ๊ณ ๋ คํด๋ณด์๋ฉด ์ข์ ๊ฒ ๊ฐ์์! |
@@ -0,0 +1,84 @@
+import { dateValidator } from "../util/Validator.js";
+import {
+ DISCOUNT,
+ BADGE,
+ BENEFIT_MESSEAGE
+} from "../constants/BenefitStorage.js";
+
+class Event {
+ #date;
+
+ constructor(date) {
+ dateValidator(date);
+ this.#date = Number(date);
+ }
+
+ #week() {
+ const WEEK = ... | JavaScript | ์์ผ์ ๋ํ ๊ฐ๋ค์ ์์๋ก ์ ์ธํ๊ณ , ์์๋ฅผ ํ์ฉํ๋ฉด ๊ฐ๋
์ฑ ํฅ์์ ๋์๋ ๊ฒ ๊ฐ์์! |
@@ -0,0 +1,49 @@
+import { foodValidator } from "../util/Validator.js";
+import {
+ MENU,
+ NAME,
+ KNIFE
+} from "../constants/FoodStorage.js";
+
+class Food {
+ #name;
+
+ #quantity;
+
+ constructor(food) {
+ foodValidator(this.#enrollFood(food));
+ }
+
+ #enrollFood(food) {
+ const foodInfoArray = ... | JavaScript | ํ์
, ์ด๋ฆ, ํํฐํฐ ๋ฑ๋ฑ ๋ฐํํด์ฃผ๋ ํจ์๋ช
์ ๋ํด `get`์ ๋ถ์ฌ์ฃผ๋๊ฒ ๊ฐ๋
์ฑ ํฅ์์ ๋ ๋์์ด ๋์ง ์์๊น์?? |
@@ -0,0 +1,46 @@
+import { ERROR_DATE, ERROR_MENU } from "../constants/ErrorMesseage.js";
+import { MENU, KNIFE } from "../constants/FoodStorage.js";
+
+export const dateValidator = (date) => {
+ if (
+ date.includes(' ') ||
+ date.includes('.') ||
+ Number.isNaN(Number(date)) ||
+ !Number.isInteger(Number... | JavaScript | `if` ๋ฌธ ๋ด๋ถ์์ ๊ฒ์ฆํ๋ ๊ฒ๋ค์ด ๋๋ฌด ๋ง์์ ์คํ๋ ค ๊ฐ๋
์ฑ์ด ๋จ์ด์ ธ ๋ณด์ผ ์๋ ์์ ๊ฒ ๊ฐ์์,,!
์ด ๋ถ๋ถ์ ์ ๊ทํํ์์ ํ์ฉํ๋ค๋ฉด ๊ฐ๋
์ฑ ํฅ์์ ๋์์ด ๋ ์ ์์ ๊ฒ ๊ฐ์์! |
@@ -0,0 +1,110 @@
+import {
+ priceFilter,
+ PRICE_REFINER,
+ merageFoodInfo,
+ BENEFITS_REFINER,
+ isNotApplicableBenefits
+} from "../src/constants/ViewRefiner.js";
+
+test('์ซ์๋ฅผ ์ฒ๋จ์๋ก ์๋ผ์ ๋ฌธ์๋ก ๋ณํ๋๋์ง ํ
์คํธ', () => {
+ const NUMBER = 1234567890;
+ const PRICE_STRING = '1,234,567,890';
+
+ expect(priceFilter(NUMBE... | JavaScript | ํํ ๋ด์ญ์ map์์ ๊ด๋ฆฌ ํ๋ค๋ณด๋ ์ถ๋ ฅ ํํ๋ก ๋ณํํ๋ ๋ก์ง์ด ๋ค์ ๋ณต์กํด์ก์ต๋๋ค. ํด๋น ๋ก์ง์ ๊ทธ ์ญํ ์ ํด์ฃผ๋๋ฐ ์๊ฐ๋ณด๋ค ๋ณต์กํ๊ณ ์ค์๋ฅผ ๋ง์ด ํ ๋ถ๋ถ์ด๋ผ ํ
์คํธ๋ฅผ ์งํํ์ต๋๋ค! |
@@ -0,0 +1,81 @@
+import Supervisor from "../domain/Supervisor.js";
+import InputView from "../InputView.js";
+import OutputView from "../OutputView.js";
+
+class EventPlanner {
+ #supervisor;
+
+ constructor() {
+ this.#supervisor = new Supervisor();
+ }
+
+ async start() {
+ OutputView.printIntroduce();
+... | JavaScript | ๋ฆฌํฉํ ๋ง๋ ์ ์ฉํด๋ณด๋๋ก ํ๊ฒ ์ต๋๋ค! ๐ |
@@ -0,0 +1,84 @@
+import { dateValidator } from "../util/Validator.js";
+import {
+ DISCOUNT,
+ BADGE,
+ BENEFIT_MESSEAGE
+} from "../constants/BenefitStorage.js";
+
+class Event {
+ #date;
+
+ constructor(date) {
+ dateValidator(date);
+ this.#date = Number(date);
+ }
+
+ #week() {
+ const WEEK = ... | JavaScript | ์์ ์ฒ๋ฆฌ๋ ํ์์ง๋ง ์ง๊ธ ๋ค์ ๋ด๋ ํด๋์ค ๋ด์์ ์ ์ธํ ๋ถ๋ถ์ ๋ง์๋๋ก ๋ง์ด ์์ฌ์ด ๊ฒ ๊ฐ์ต๋๋คใ
์์ผ์ ์ด๋ฆ์ ํ๋ค์์ ํ ์ง๋ ๊ณ ๋ฏผ์ด์๋๋ฐ ๋ ๊ธ์๋ก๋ ์ถฉ๋ถํ ๊ฒ ๊ฐ์ ์ฝ์ด๋ฅผ ์ฌ์ฉํ์์ต๋๋ค. |
@@ -0,0 +1,49 @@
+import { foodValidator } from "../util/Validator.js";
+import {
+ MENU,
+ NAME,
+ KNIFE
+} from "../constants/FoodStorage.js";
+
+class Food {
+ #name;
+
+ #quantity;
+
+ constructor(food) {
+ foodValidator(this.#enrollFood(food));
+ }
+
+ #enrollFood(food) {
+ const foodInfoArray = ... | JavaScript | get์ ์ ํํ ์ธ์ ๋ถ์ฌ์ผ ํ ์ง ๊ณ ๋ฏผ์ด ๋ฉ๋๋ค. type ๋ฉ์๋์ ๊ฒฝ์ฐ type์ ๊ฐ์ ธ์ค๋ ๊ฒ์ด๋ get์ ๋ถ์ฌ์ผ ํ ์ง,
๋จ์ํ ํ๋ ๊ฐ์ ๊ฐ์ ธ์ค๋๊ฒ ์๋๋ผ ์์ฐํ ๋ก์ง์ด ๊ตฌํ ๋์ด ์์ผ๋ food.type() ์ฐ๋ก๋ ์๋ฏธ ์ ๋ฌํ ์ถฉ๋ถํ์ง ์์ง ํ๊ฐ๋ฆฌ๋ ๋ถ๋ถ์ธ ๊ฒ ๊ฐ์ต๋๋ค.ใ
ใ
|
@@ -0,0 +1,106 @@
+import Cashier from "../src/domain/Cashier.js";
+
+describe('Cashier ํด๋์ค ์ ํจ์ฑ ํ
์คํธ', () => {
+ test.each([
+ ['์ ๋ก์ฝ๋ผ-10'],
+ ['์ ๋ก์ฝ๋ผ-2,์ดํ์ธ-4'],
+ ['์ดํ์ธ-3,๋ ๋์์ธ-1,์ ๋ก์ฝ๋ผ-2']
+ ])('์๋ฃ๋ง ์ฃผ๋ฌธ์ ์์ธ์ฒ๋ฆฌ', (input) => {
+ expect(() => new Cashier(input)).toThrow('[ERROR');
+ });
+
+ test.each([
+ ['์์ด... | JavaScript | ํ
์คํธ ๊ผผ๊ผผํ๊ฑฐ ๋๋ฌด ์ข์ต๋๋ค! ๐ ๊ทธ๋ฐ๋ฐ ํ
์คํธ๋ฌธ๊ตฌ ์์์ ํ๋๋ก ํต์ผํ๋ฉด ์ข์ ๊ฒ ๊ฐ์์!
ํด๋น ๋ฌธ๊ตฌ์ฒ๋ผ `์์ธ๋ฅผ ๋ฐ์์ํค์ง ์๋๋ค`. ์ ๋ง์ถฐ์ `์์ธ์ฒ๋ฆฌ` -> `์์ธ๋ฅผ ๋ฐ์์ํจ๋ค` ๋ก ํต์ผํ๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค! |
@@ -0,0 +1,70 @@
+import Food from "./Food.js";
+import { ERROR_MENU } from "../constants/ErrorMesseage.js";
+import { merageFoodInfo } from "../constants/ViewRefiner.js";
+import { DISCOUNT, BENEFIT_MESSEAGE } from "../constants/BenefitStorage.js";
+import { NAME } from "../constants/FoodStorage.js";
+
+class Cashier ... | JavaScript | ํน์ ์ถ๋ ฅ๊ณผ ๊ด๋ จ๋ ํฌ๋งทํ
๋ถ๋ถ์ ๋๋ฉ์ธ์์ ์ฒ๋ฆฌํ ์ด์ ๊ฐ ์์ผ์ค๊น์? ๊ถ๊ธํฉ๋๋ค! ํฌ๋งทํ
ํด์ฃผ๋ ๊ฒ๋ ๋๋ฉ์ธ์ ์ญํ ์ด๋ผ๊ณ ์๊ฐํ์
จ๊ธฐ ๋๋ฌธ์ผ๊น์? |
@@ -1,7 +1,67 @@
-export default OutputView = {
- printMenu() {
- Console.print("<์ฃผ๋ฌธ ๋ฉ๋ด>");
- // ...
- }
- // ...
-}
+import { Console } from "@woowacourse/mission-utils";
+import { ANSWER } from "./constants/PlannerMesseage.js";
+import { PRICE_REFINER, BENEFITS_REFINER } from "./constants/ViewR... | JavaScript | ํด๋น๋ถ๋ถ messeage ๊ทธ๋ฅ ๋ฐ๋ก ์ถ๋ ฅํด๋ ๋ ๊ฒ ๊ฐ์ต๋๋ค! |
@@ -1,7 +1,67 @@
-export default OutputView = {
- printMenu() {
- Console.print("<์ฃผ๋ฌธ ๋ฉ๋ด>");
- // ...
- }
- // ...
-}
+import { Console } from "@woowacourse/mission-utils";
+import { ANSWER } from "./constants/PlannerMesseage.js";
+import { PRICE_REFINER, BENEFITS_REFINER } from "./constants/ViewR... | JavaScript | ์ ๋ชฉ ๋ถ๋ถ์ด๋ผ์ ๋ค ๋์ด์ฐ๊ธฐ๋ฅผ ํ์ ๊ฑธ๊น์? ๊ผผ๊ผผํฉ๋๋ค! ๐ |
@@ -0,0 +1,40 @@
+export const DISCOUNT = Object.freeze({
+ christmasDate : 25,
+ christmasBasic : 1000,
+ christmasAccumulation : 100,
+ weekday : 2023,
+ weekend : 2023,
+ special : 1000,
+ freebieItem : '์ดํ์ธ 1๊ฐ',
+ freebieStandard : 120000,
+ freebiePrice : 25000,
+ eventStandardAmount : 10000,
+ zero : 0... | JavaScript | ํด๋น ์ดํ์ธ์ string์ผ๋ก ๋ฃ๊ธฐ๋ณด๋ค ์ ์ธํด๋์ผ์ ์์ ์จ๋ ์ข์ ๊ฒ ๊ฐ์์! |
@@ -0,0 +1,40 @@
+export const DISCOUNT = Object.freeze({
+ christmasDate : 25,
+ christmasBasic : 1000,
+ christmasAccumulation : 100,
+ weekday : 2023,
+ weekend : 2023,
+ special : 1000,
+ freebieItem : '์ดํ์ธ 1๊ฐ',
+ freebieStandard : 120000,
+ freebiePrice : 25000,
+ eventStandardAmount : 10000,
+ zero : 0... | JavaScript | ๋ณ์๋ช
์ ๊ฐ๊ฒฉ์ด๋ผ๋๊ฒ ๋ ๋๋ฌ๋๋ฉด ์ข์ ๊ฒ ๊ฐ์์! |
@@ -0,0 +1,40 @@
+export const DISCOUNT = Object.freeze({
+ christmasDate : 25,
+ christmasBasic : 1000,
+ christmasAccumulation : 100,
+ weekday : 2023,
+ weekend : 2023,
+ special : 1000,
+ freebieItem : '์ดํ์ธ 1๊ฐ',
+ freebieStandard : 120000,
+ freebiePrice : 25000,
+ eventStandardAmount : 10000,
+ zero : 0... | JavaScript | ๊ผผ๊ผผํ์ญ๋๋น!! ๐๐๐ |
@@ -0,0 +1,40 @@
+export const DISCOUNT = Object.freeze({
+ christmasDate : 25,
+ christmasBasic : 1000,
+ christmasAccumulation : 100,
+ weekday : 2023,
+ weekend : 2023,
+ special : 1000,
+ freebieItem : '์ดํ์ธ 1๊ฐ',
+ freebieStandard : 120000,
+ freebiePrice : 25000,
+ eventStandardAmount : 10000,
+ zero : 0... | JavaScript | ๊ทธ๋ฆฌ๊ณ ํด๋น `DISCOUNT` ์์์ ์ด๋ฒคํธ์ ๊ด๋ จ๋ ๋ชจ๋ ์ ๋ณด๊ฐ ๋ค์ด๊ฐ์๋๋ฐ, ์์ ํฌ๋ฆฌ์ค๋ง์ค ์ด๋ฒคํธ, ํ์ผ ์ด๋ฒคํธ, ๋ฑ๋ฑ์ผ๋ก ์์๋ฅผ ์ชผ๊ฐ๊ฑฐ๋, ํน์ ์ค๊ฐ์ ๊ณต๋ฐฑ๋ผ์ธ์ ๋ฃ์ผ๋ฉด ์ข์ ๊ฒ ๊ฐ์์! ๊ตฌ๋ถ๋์ด์์ง ์๋ค๋ณด๋๊น ํ์
ํ๊ธฐ ์กฐ๊ธ ์ด๋ ค์ธ ๊ฒ ๊ฐ์์! |
@@ -0,0 +1,40 @@
+export const DISCOUNT = Object.freeze({
+ christmasDate : 25,
+ christmasBasic : 1000,
+ christmasAccumulation : 100,
+ weekday : 2023,
+ weekend : 2023,
+ special : 1000,
+ freebieItem : '์ดํ์ธ 1๊ฐ',
+ freebieStandard : 120000,
+ freebiePrice : 25000,
+ eventStandardAmount : 10000,
+ zero : 0... | JavaScript | `star : { price : 5000, name : '๋ณ'}` ํด๋น ํ์์ ์ด๋จ์ง ์ถ์ฒํ๊ณ ๊ฐ๋๋ค! |
@@ -0,0 +1,14 @@
+export const ERROR_DATE = Object.freeze({
+ basic : '[ERROR] ์ ํจํ์ง ์์ ๋ ์ง์
๋๋ค. ๋ค์ ์
๋ ฅํด ์ฃผ์ธ์.',
+ minDate : 1,
+ maxDate : 31,
+});
+
+export const ERROR_MENU = Object.freeze({
+ basic : '[ERROR] ์ ํจํ์ง ์์ ์ฃผ๋ฌธ์
๋๋ค. ๋ค์ ์
๋ ฅํด ์ฃผ์ธ์.',
+ onlyDrink : '[ERROR] ์๋ฃ๋ง ์ฃผ๋ฌธ ์, ์ฃผ๋ฌธํ ์ ์์ต๋๋ค.',
+ maxOrder : '[ERROR] ๋ฉ๋ด๋ ํ ๋ฒ์... | JavaScript | ํด๋น 20๋ ์์๋ก ๋นผ๋ฉด ์ข์ ๊ฒ ๊ฐ์์! |
@@ -0,0 +1,43 @@
+export const APPETIZER = Object.freeze({
+ '์์ก์ด์ํ' : 6000,
+ 'ํํ์ค' : 5500,
+ '์์ ์๋ฌ๋' : 8000,
+ 'type' : 'appetizer',
+});
+
+export const MAIN = Object.freeze({
+ 'ํฐ๋ณธ์คํ
์ดํฌ' : 55000,
+ '๋ฐ๋นํ๋ฆฝ' : 54000,
+ 'ํด์ฐ๋ฌผํ์คํ' : 35000,
+ 'ํฌ๋ฆฌ์ค๋ง์คํ์คํ' : 25000,
+ 'type' : 'main',
+});
+
+export const DESERT = Obj... | JavaScript | ํ์
๋ถ๋ถ์ ํด๋น ๊ฐ์ฒด์ ๋ง์ง๋ง์ ๋ฃ๊ธฐ๋ณด๋จ, ๋ฐ๋ก ๋นผ์ ํ์ธํ๋๊ฒ ์ข์ ๊ฒ ๊ฐ์ต๋๋ค!
๊ฐ์ฒด๊ฐ ์ค๊ฐ์ ์์ฑ์ด ๋ค๋ฅผ ๊ฒฝ์ฐ, ์ ์ง๋ณด์๋ ํ๋ค๋ฟ๋ง ์๋๋ผ ๋งค๋ฒ `APPETIZER`์ ๋ง์ง๋ง ์์ฑ์ type์ด๋ผ๋๊ฑธ ๊ธฐ์ตํด๋๊ณ ์ฝ๋๋ฅผ ์ง์ผํด์, type์ ํด๋น ๊ฐ์ฒด์์ ๋ฐ๋ก ๋นผ๋๊ฒ ์ข์๋ณด์
๋๋ค!
```js
export const APPETIZER = Object.freeze({
'์์ก์ด์ํ': 6000,
'ํํ์ค': 5500,
'์์ ์๋ฌ๋': 8000,
});
``` |
@@ -0,0 +1,43 @@
+export const APPETIZER = Object.freeze({
+ '์์ก์ด์ํ' : 6000,
+ 'ํํ์ค' : 5500,
+ '์์ ์๋ฌ๋' : 8000,
+ 'type' : 'appetizer',
+});
+
+export const MAIN = Object.freeze({
+ 'ํฐ๋ณธ์คํ
์ดํฌ' : 55000,
+ '๋ฐ๋นํ๋ฆฝ' : 54000,
+ 'ํด์ฐ๋ฌผํ์คํ' : 35000,
+ 'ํฌ๋ฆฌ์ค๋ง์คํ์คํ' : 25000,
+ 'type' : 'main',
+});
+
+export const DESERT = Obj... | JavaScript | ์ด ๋ถ๋ถ์ `-` ๋ก ์ชผ๊ฐฐ์๋ ๋์ค๋ ๋ฐฐ์ด์ index๋ฅผ ๊ฐ์ ธ์ค๊ธฐ ์ํ ์์ ๋ง์๊น์? ๊ทธ๋ ๋ค๋ฉด ๊ตฌ์กฐ๋ถํดํ ๋น ์ฐ๋ฉด ๋ ๊น๋ํ ๊ฒ ๊ฐ์์! ๊ทธ๋ ๊ฒ ๋๋ค๋ฉด `KNIFE `์์๋ช
๋ณด๋ค๋ `delimiter`๋ `seperator`๋ก ๋ฐ๊พธ๋๊ฒ๋ ์ข์ ๊ฒ ๊ฐ์์! |
@@ -0,0 +1,14 @@
+export const ERROR_DATE = Object.freeze({
+ basic : '[ERROR] ์ ํจํ์ง ์์ ๋ ์ง์
๋๋ค. ๋ค์ ์
๋ ฅํด ์ฃผ์ธ์.',
+ minDate : 1,
+ maxDate : 31,
+});
+
+export const ERROR_MENU = Object.freeze({
+ basic : '[ERROR] ์ ํจํ์ง ์์ ์ฃผ๋ฌธ์
๋๋ค. ๋ค์ ์
๋ ฅํด ์ฃผ์ธ์.',
+ onlyDrink : '[ERROR] ์๋ฃ๋ง ์ฃผ๋ฌธ ์, ์ฃผ๋ฌธํ ์ ์์ต๋๋ค.',
+ maxOrder : '[ERROR] ๋ฉ๋ด๋ ํ ๋ฒ์... | JavaScript | `ERROR_MENU`์๋ ์๋ฌ์ ๊ด๋ จ๋๊ฒ๋ง ์์ผ๋ฉด ์ข์ ๊ฒ ๊ฐ์๋ฐ, 11,12,13 line์ ์กฐ๊ธ ์ ๋งคํ ๊ฒ ๊ฐ์ต๋๋ค!
`ERROR_MENU`-> `MENU`๋ก ๋ฐ๊พธ๊ณ , ๊ทธ ์์ `ERROR`๋ก ํ๋ฒ ๋ ๊ฐ์ธ๋๊ฑด ์ด๋จ์ง ์ถ์ฒํ๊ณ ๊ฐ๋๋น! |
@@ -0,0 +1,41 @@
+import { BENEFIT_MESSEAGE } from "./BenefitStorage.js";
+import { EVENT_NAME } from "./BenefitStorage.js";
+
+export const priceFilter = (priceNumber) => new Intl.NumberFormat('ko-KR').format(priceNumber);
+
+export const merageFoodInfo = (foodName, foodAmount) => `${foodName} ${foodAmount}๊ฐ`;
+
+expo... | JavaScript | ํด๋น ๊ฐ์ฒด์ ๊ฒฝ์ฐ positive, negative์์ฑ์ ๋๋์ง๋ง๊ณ ์ฒ์๋ถํฐ 3๊ฐ์ง ์กฐ๊ฑด๋ฌธ์ผ๋ก ๋ฐ๋ก ๊ฒ์ฌํ๋ฉด ์ด๋จ๊น์? |
@@ -0,0 +1,41 @@
+import { BENEFIT_MESSEAGE } from "./BenefitStorage.js";
+import { EVENT_NAME } from "./BenefitStorage.js";
+
+export const priceFilter = (priceNumber) => new Intl.NumberFormat('ko-KR').format(priceNumber);
+
+export const merageFoodInfo = (foodName, foodAmount) => `${foodName} ${foodAmount}๊ฐ`;
+
+expo... | JavaScript | ํน์ ์๋ค๋ ์์๋ผ๊ณ ๋ณผ ์ ์๋๋ฐ ์นด๋ฉ์ผ์ด์ค๋ก ์์ฑํ์ ์ด์ ๊ฐ ์์๊น์? |
@@ -0,0 +1,41 @@
+import { BENEFIT_MESSEAGE } from "./BenefitStorage.js";
+import { EVENT_NAME } from "./BenefitStorage.js";
+
+export const priceFilter = (priceNumber) => new Intl.NumberFormat('ko-KR').format(priceNumber);
+
+export const merageFoodInfo = (foodName, foodAmount) => `${foodName} ${foodAmount}๊ฐ`;
+
+expo... | JavaScript | ์ฌ๊ธฐ !==๋ค์ ๋์ด์ฐ๊ธฐ 1๋ฒ ํด์ผํ ๊ฒ ๊ฐ์์! |
@@ -0,0 +1,81 @@
+import Supervisor from "../domain/Supervisor.js";
+import InputView from "../InputView.js";
+import OutputView from "../OutputView.js";
+
+class EventPlanner {
+ #supervisor;
+
+ constructor() {
+ this.#supervisor = new Supervisor();
+ }
+
+ async start() {
+ OutputView.printIntroduce();
+... | JavaScript | ํด๋น ๋ถ๋ถ์ ๋ฐ๋ก ํจ์๋ก ์๋นผ๊ณ `OutputView.print~`๋ก ๋ฐ๋ก ๋ฃ์ด๋ ๊ด์ฐฎ์ง ์์๊น ํฉ๋๋ค!
๊ฐ๊ฐ์ ํจ์์์ ๋ฐ๋ก ์ถ๊ฐ์ ์ธ ๊ธฐ๋ฅ์ด ์๋๊ฒ ์๋๋ผ์, OutputView๋ก ๋ฐ๋ก ๋ค์ด๊ฐ๋ ์ข์ ๊ฒ ๊ฐ์์! |
@@ -0,0 +1,70 @@
+import Food from "./Food.js";
+import { ERROR_MENU } from "../constants/ErrorMesseage.js";
+import { merageFoodInfo } from "../constants/ViewRefiner.js";
+import { DISCOUNT, BENEFIT_MESSEAGE } from "../constants/BenefitStorage.js";
+import { NAME } from "../constants/FoodStorage.js";
+
+class Cashier ... | JavaScript | import ์์๋ ๋ง์ถฐ์ฃผ๋ฉด ์ข์ ๊ฒ ๊ฐ์์! ์๋ฅผ ๋ค์ด constants๋ถ๋ถ๋ ์ํ๋ฒณ ์์ผ๋ก importํด์ค๋ค๊ฑฐ๋,,! |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.