code stringlengths 41 34.3k | lang stringclasses 8
values | review stringlengths 1 4.74k |
|---|---|---|
@@ -1,7 +1,20 @@
package lotto;
+import lotto.config.Configuration;
+import lotto.controller.BuyLottoController;
+import lotto.controller.LottoController;
+import lotto.dto.BuyLottoDto;
+
public class Application {
public static void main(String[] args) {
- // TODO: ํ๋ก๊ทธ๋จ ๊ตฌํ
+ Configuration config... | Java | ์.. ๋ง์์ ์ ๋ ์ด ๋ถ๋ถ์ด ๋ง์ด ๊ฑธ๋ ธ์ด์. ํ์ง๋ง ๋ชจ๋ํ ํ๋ฉด ํ ์๋ก Application์์ ์์ฑํด์ค์ผ ํ๋๊ฒ ๋ง์์ ธ์ ๊ณ ๋ฏผ์ด ๋์ด์...
๋ค์์๋ controller๋ง ์์กดํ๊ฒ๋ ์์ ํด๋ด์ผ๊ฒ ์ด์!! |
@@ -0,0 +1,34 @@
+package lotto.model;
+
+import static lotto.constant.Constant.THOUSAND;
+import static lotto.constant.Constant.ZERO;
+import static lotto.exception.ErrorInputException.ErrorMessage.PURCHASE_PRICE_CAN_DIVIDE_BY_THOUSAND;
+
+import lotto.exception.ErrorInputException;
+
+public class PurchasePrice {
+ ... | Java | ๋ก๋์ ๊ฐ์๋ฅผ ๊ตฌํ๋ ํจ์(calculateLottoCount)๋ก ๋ง๋ค์์ต๋๋ค!
๋ฃ๊ณ ๋ณด๋ ๋ง์ฝ ๋ก๋ ๊ฐ๊ฒฉ์ด ๋ฐ๋๊ฒ ๋๋ค๋ฉด ๋๋๋ ๊ฐ๊ฒฉ์ ์์ ํด์ผ ํ๋ `THOSAND` ๋์ `LOTTOPRICE`๋ก ๋ฐ๋๋๊ฒ ์ข๊ฒ ๊ตฐ์! |
@@ -0,0 +1,57 @@
+package lotto.model;
+
+import static lotto.constant.Constant.ZERO;
+
+import java.util.Collections;
+import java.util.EnumMap;
+import java.util.List;
+import java.util.Map;
+import lotto.constant.Rank;
+
+public class Statistics {
+ private final Map<Rank, Integer> result;
+
+ private Statisti... | Java | `countMatchingWinnerNumber()` ํจ์์์ stream์ ์ฐ๋ค๋ณด๋ return ๊ฐ์ด long์ด ๋์์ด์!
long์ด๋ int๋ ํฌ๊ฒ ์ํฅ์ ์ฃผ์ง ์์ ๊ฒ์ด๋ผ๊ณ ์๊ฐํ์ฌ long์ผ๋ก ์ ์ธํ์ต๋๋ค! |
@@ -0,0 +1,40 @@
+package lotto.dto;
+
+import lotto.model.BonusNumber;
+import lotto.model.LottoNumbers;
+import lotto.model.PurchasePrice;
+import lotto.model.Statistics;
+import lotto.model.WinnerNumber;
+
+public class BuyLottoDto {
+ private PurchasePrice purchasePrice;
+ private LottoNumbers lottoNumbers;
+... | Java | ๋ง์์! ์ด ๋ก์ง์ service์ ๋ฐฐ์นํ๋๊ฒ ๋ ์ ์ ํ ๊ฒ ๊ฐ๊ตฐ์! ๐ |
@@ -0,0 +1,109 @@
+package christmas.controller;
+
+import christmas.domain.Date;
+import christmas.domain.EventBadge;
+import christmas.domain.Orders;
+import christmas.domain.discount.DDayStrategy;
+import christmas.domain.discount.Discount;
+import christmas.domain.discount.GiftStrategy;
+import christmas.domain.dis... | Java | ์ปจํธ๋กค๋ฌ๋จ์์ ํ๋๊ฒ๋ ๊ด์ฐฎ์ง๋ง ํด๋น ๋๋ฉ์ธ ๋ก์ง์ผ๋ก ๊ฐ์ ธ๊ฐ๋ ๊ฒ๋ ์ข์๋ณด์ฌ์! |
@@ -0,0 +1,48 @@
+package christmas.domain;
+
+public enum Event {
+ NONE("์์", 0),
+ CHRISTMAS_D_DAY_DISCOUNT("ํฌ๋ฆฌ์ค๋ง์ค ๋๋ฐ์ด ํ ์ธ", 1_000),
+ WEEKDAY_DISCOUNT("ํ์ผ ํ ์ธ", 2_023),
+ WEEKEND_DISCOUNT("์ฃผ๋ง ํ ์ธ", 2_023),
+ SPECIAL_DISCOUNT("ํน๋ณ ํ ์ธ", 1_000),
+ GIFT("์ฆ์ ์ด๋ฒคํธ", 25_000);
+
+ private static final int B... | Java | ์ฝ๋๊ฐ ์ฝ๊ธฐ ํธํด์! |
@@ -0,0 +1,57 @@
+package christmas.domain;
+
+import christmas.exception.ExceptionMessage;
+import christmas.exception.InputException;
+import java.util.Arrays;
+
+public enum Menu {
+ MUSHROOM_CREAM_SOUP("์์ก์ด์ํ", 6_000, FoodType.APPETIZER),
+ TAPAS("ํํ์ค", 5_500, FoodType.APPETIZER),
+ CAESAR_SALAD("์์ ์๋ฌ๋", 8... | Java | Menu Enum์ FoodType Enum ์ ๊ฐ์ ธ์์ ์ฐ์๋ ์๋๊ฐ ๊ถ๊ธํฉ๋๋ค! |
@@ -0,0 +1,19 @@
+package christmas.domain.discount;
+
+import christmas.domain.Date;
+import christmas.domain.Event;
+import christmas.domain.Orders;
+import java.util.List;
+
+public class GiftStrategy implements DiscountStrategy {
+ private static final int GIFT_BASE_AMOUNT = 120_000;
+
+ @Override
+ public... | Java | ์ธํฐํ์ด์ค ํ์ฉ ์ข๋ค์! |
@@ -0,0 +1,4 @@
+package christmas.dto;
+
+public record OrderParam(String name, int count) {
+} | Java | ํด๋น record ๊ฐ์ฒด์ ์๋๊ฐ ๊ถ๊ธํฉ๋๋ค! |
@@ -0,0 +1,9 @@
+package christmas.exception;
+
+public class InputException extends IllegalArgumentException {
+ public static final String PREFIX = "[ERROR] ";
+
+ public InputException(String message) {
+ super(PREFIX + message);
+ }
+} | Java | ์ ๋ ํ๋ก๊ทธ๋จ์์ ๋ฐ์ํ๋ ์์ธ ์ฒ๋ฆฌ ๋ฉ์๋๋ฅผ ํ ํจํค์ง์ ๋ชจ์์ ๊ด๋ฆฌํ๊ณ ์๋๋ฐ ์ด๋ป๊ฒ ์๊ฐํ์ค๊น์? |
@@ -0,0 +1,72 @@
+package christmas.view;
+
+public class OutputView {
+ private static final String GREETING = "์๋
ํ์ธ์! ์ฐํ
์ฝ ์๋น 12์ ์ด๋ฒคํธ ํ๋๋์
๋๋ค.";
+ private static final String PREVIEW_TITLE = "12์ %d์ผ์ ์ฐํ
์ฝ ์๋น์์ ๋ฐ์ ์ด๋ฒคํธ ํํ ๋ฏธ๋ฆฌ ๋ณด๊ธฐ!";
+ private static final String ORDERED_MENU = "<์ฃผ๋ฌธ ๋ฉ๋ด>";
+ private static final ... | Java | ํด๋น ๋ก์ง์ ๊ตณ์ด Enum์ผ๋ก ๊ด๋ฆฌํ์ง ์์๋๋ฐ๋ ๊ฐ๋
์ฑ์ด ์ ๋ง ์ข๋ค์!
์ธ์ฌ์ดํธ ์ป์ด๊ฐ๋๋ค! |
@@ -0,0 +1,171 @@
+package christmas.domain;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatNoException;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+
+import christmas.exception.ExceptionMessage;
+import java.util.ArrayList;
... | Java | ํด๋น ๋ก์ง์ @BeforEach ์ด๋
ธํ
์ด์
์ ํ์ฉํ๋๊ฑด ์ด๋ป๊ฒ ์๊ฐํ์ค๊น์? |
@@ -0,0 +1,109 @@
+package christmas.controller;
+
+import christmas.domain.Date;
+import christmas.domain.EventBadge;
+import christmas.domain.Orders;
+import christmas.domain.discount.DDayStrategy;
+import christmas.domain.discount.Discount;
+import christmas.domain.discount.GiftStrategy;
+import christmas.domain.dis... | Java | ๊ณต๊ฐํฉ๋๋ค!! |
@@ -0,0 +1,58 @@
+package christmas.domain;
+
+import christmas.exception.ExceptionMessage;
+import christmas.exception.InputException;
+import java.time.LocalDate;
+import java.time.format.TextStyle;
+import java.util.List;
+import java.util.Locale;
+
+public class Date {
+ private static final int MIN_DATE = 1;
+ ... | Java | "SUNDAY" ๋ฅผ "์ผ" ๋ก ํ์ง ์์ผ์ ์ด์ ๊ฐ ์๋์?? |
@@ -0,0 +1,61 @@
+package christmas.domain;
+
+import static christmas.Constants.BASE_COUNT;
+import static christmas.Constants.BLANK;
+import static christmas.Constants.COUNT;
+import static christmas.Constants.LINE_FEED;
+import static christmas.Constants.NONE;
+
+import christmas.exception.ExceptionMessage;
+import ... | Java | ์ด๊ฑด OutputView ์์ ํด๋ ์ข์๊ฒ ๊ฐ์๋ฐ ์ด๋ป๊ฒ ์๊ฐํ์๋์?? |
@@ -0,0 +1,36 @@
+package christmas.domain;
+
+import java.util.Arrays;
+import java.util.Comparator;
+
+public enum EventBadge {
+ NONE("์์", 0),
+ STAR("๋ณ", 5_000),
+ TREE("ํธ๋ฆฌ", 10_000),
+ SANTA("์ฐํ", 20_000);
+
+ private final String name;
+ private final int price;
+
+ EventBadge(String name, i... | Java | ์ ๋ง ๊น๋ํ๋ค์!! |
@@ -0,0 +1,17 @@
+package christmas.domain.discount;
+
+import christmas.domain.Date;
+import christmas.domain.Event;
+import christmas.domain.Orders;
+import java.util.List;
+
+public class DDayStrategy implements DiscountStrategy {
+ @Override
+ public List<Event> getShouldApplyEvents(Orders orders, Date date) ... | Java | ์ ๋ต ํจํด ์ฌ์ฉํ์
จ๋ค์! ๐๐ |
@@ -21,6 +21,7 @@ package
{
if (_instance)
{
+ // NOTE throw ์์ผ๋๊ณ catch ์ํด์ฃผ๋ฉด ์ด๋ป๊ฒ ๋ ๊น์?
throw new Error("Use getInstance().");
}
_instance = this; | Unknown | ์ฌ์ค ์ฌ๊ธฐ์ throw๊ฐ ๋ ๊ฐ๋ฅ์ฑ์ ๊ฑฐ์ ์์ด๋ณด์
๋๋ค๋ง...
๋ฐ๊นฅ์ try catch ์ฒ๋ฆฌ๋ฅผ ํ์ง ์์ ์ฑ๋ก throw๊ฐ ๋ฐ์ํด๋ฒ๋ฆฌ๋ฉด
์ด๋ป๊ฒ ๋ ๊น์? |
@@ -1,10 +1,113 @@
package subway;
import java.util.Scanner;
+import subway.controller.InitController;
+import subway.controller.InputController;
+import subway.controller.SubwayController;
+import subway.domain.Station;
+import subway.repository.LineRepository;
+import subway.repository.StationRepository;
+import ... | Java | ์ ์ฌ๊ธฐ๋ ๋ก๋์ ๊ฐ๊ตฐ์! ๋ง์ฝ controller์ service์ ๋ํ ๊ฐ์ฒด ์์ฑํ๋ ๊ด์ฌ์ฌ๋ฅผ ํน์ ํด๋์ค์์ ํ๊ณ ์ถ๋ค๋ฉด Configurationํด๋์ค๋ฅผ ๋ง๋๋๊ฑด ์ด๋จ๊น์? ์คํ๋ง๋ถํธ์์ @Configuration์ด Bean์ ๋ฑ๋กํด์ฃผ๋ ์ด๋
ธํ
์ด์
์ด๋๊น์! |
@@ -1,10 +1,113 @@
package subway;
import java.util.Scanner;
+import subway.controller.InitController;
+import subway.controller.InputController;
+import subway.controller.SubwayController;
+import subway.domain.Station;
+import subway.repository.LineRepository;
+import subway.repository.StationRepository;
+import ... | Java | Q๋ 1๊ฐ์ ๊ฐ์ Function enumํด๋์ค๋ก ์ ๊ทผํด์ ์์ฑํ์
จ์ ์ ์์ ๊ฒ ๊ฐ์์! |
@@ -0,0 +1,44 @@
+package subway.service;
+
+import static subway.domain.RouteInfo.calculateTotalDistance;
+import static subway.domain.RouteInfo.calculateTotalTime;
+import static subway.domain.RouteInfo.values;
+
+import java.util.List;
+import org.jgrapht.GraphPath;
+import org.jgrapht.alg.shortestpath.DijkstraShort... | Java | ์คํธ!! ๊ฐ์ฒด ์์ฑํ๋ ์ฝ๋๋ฅผ ๋ถ๋ฆฌ์์ผฐ๊ตฐ์!! ๋ฐฐ์๊ฐ๋๋ค..!! |
@@ -0,0 +1,59 @@
+package subway.view.Input;
+
+import subway.validation.EndStationValidation;
+import subway.validation.MainFunctionValidation;
+import subway.validation.SelectRouteValidation;
+import subway.validation.StartStationValidation;
+
+public class InputView {
+ private final MainFunctionValidation mainFu... | Java | ์ด๋ฏธ isBlank๋ฉ์๋๊ฐ static์ผ๋ก ํ ๋น๋์ด์๊ธฐ๋๋ฌธ์ mainFunctionValidation.isBlank๊ฐ ์๋, MainFunctionValidation.isBlank๋ก ํ๋๊ฒ ๋ ์ ํฉํ ๊ฒ ๊ฐ์ต๋๋ค! |
@@ -1,10 +1,113 @@
package subway;
import java.util.Scanner;
+import subway.controller.InitController;
+import subway.controller.InputController;
+import subway.controller.SubwayController;
+import subway.domain.Station;
+import subway.repository.LineRepository;
+import subway.repository.StationRepository;
+import ... | Java | ์ต์ข
์ฝํ
์์ ์ฌ์ฉํ ํ
ํ๋ฆฟ์ ๋ง๋ค๋ค๋ณด๋ ๊ฐ์ ํ์์ผ๋ก ๋ง๋ค์ด์ก๊ตฐ์ ใ
ใ
๋ค์ ๊ณ ๋ฏผํด๋ด์ผ๊ฒ ์ต๋๋ค!! |
@@ -0,0 +1,15 @@
+package config;
+
+import controller.UserController;
+import service.UserJoinService;
+
+public class AppConfig {
+
+ public static UserController userController() {
+ return new UserController(userJoinService());
+ }
+
+ public static UserJoinService userJoinService() {
+ retur... | Java | AppConfig๋ก DI๋ฅผ ์ฃผ์
ํด์ฃผ๋ ค๋ ์๋๐ |
@@ -0,0 +1,45 @@
+package controller;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import service.UserJoinService;
+import util.HttpRequest;
+import util.HttpResponse;
+
+public class UserController {
+ private final String HTTP_GET = "GET";
+ private final String JOIN_FORM = "/user/form.html";
+... | Java | ```suggestion
if (request.getUrl().equals(JOIN_FORM)) {
return JOIN_FORM;
}
```
๋ ๊ฐ ๊ฐ์ด ๊ฐ์์ ์ด ์ฝ๋์ ๊ฐ์ ์๋ฏธ์
๋๋ค. |
@@ -0,0 +1,45 @@
+package controller;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import service.UserJoinService;
+import util.HttpRequest;
+import util.HttpResponse;
+
+public class UserController {
+ private final String HTTP_GET = "GET";
+ private final String JOIN_FORM = "/user/form.html";
+... | Java | response ๊ตฌ์กฐ๋ฅผ ์ ๊ทน ์ฝ๋์ ๋ฐ์ํ์
จ๋ค์! |
@@ -0,0 +1,45 @@
+package controller;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import service.UserJoinService;
+import util.HttpRequest;
+import util.HttpResponse;
+
+public class UserController {
+ private final String HTTP_GET = "GET";
+ private final String JOIN_FORM = "/user/form.html";
+... | Java | ์ด ๋ถ๋ถ์ ์์ ๊ณ ๋ฒ์ฉ์ ์ธ ๋ฉ์๋๋ก ๋ฐ๋ก ๋นผ์ ๋ฆฌํฉํ ๋งํ ์ ์์ ๊ฒ ๊ฐ์์. |
@@ -0,0 +1,56 @@
+package util;
+
+public class HttpRequest {
+
+ private String method;
+ private String url;
+ private String queryString;
+
+ public HttpRequest(String line) {
+ String[] splitHeader = line.split(" ");
+ // uriPath = ์ ์ฒด uri (์ฟผ๋ฆฌ ํ๋ผ๋ฏธํฐ ๋ถ๋ฆฌ ์ )
+ String uriPath = getURIPath... | Java | ์ฟผ๋ฆฌ๋ฅผ String์ผ๋ก ์ ์ฅํ๋๋ก ๊ตฌํํ์ ์ด์ ๊ฐ ์๋์? |
@@ -0,0 +1,81 @@
+package util;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.nio.file.Files;
+import java.util.HashMap;
+import java.util.Map;
+
+public class HttpResponse {
... | Java | path๊ฐ `/fonts/~` ์ด๋ ๊ฒ ์์ฒญ๋ค์ด์ค์ง ์๋์? |
@@ -0,0 +1,81 @@
+package util;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.nio.file.Files;
+import java.util.HashMap;
+import java.util.Map;
+
+public class HttpResponse {
... | Java | status์ header๋ก ๋๋์ด ์ ์ฅํ๋ ๊ฒ ์ข๋ค์!! |
@@ -0,0 +1,81 @@
+package util;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.nio.file.Files;
+import java.util.HashMap;
+import java.util.Map;
+
+public class HttpResponse {
... | Java | ์ด ํด๋์ค์์ ์ ์ฒด์ ์ผ๋ก ์ ๊ฐ ๊ตฌํํ๊ณ ์ถ์ ๋ถ๋ถ๋ค์ ์ ๋๋์ด์ฃผ์ ๊ฒ ๊ฐ์์! ๋ง์ด ๋ฐฐ์ ์ต๋๋ค |
@@ -0,0 +1,81 @@
+package util;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.nio.file.Files;
+import java.util.HashMap;
+import java.util.Map;
+
+public class HttpResponse {
... | Java | `headers` ๋ฅผ ์ด์ฉํด์ ๋ ๋ฆฌํฉํ ๋ง ํ ์ ์์ ๊ฒ ๊ฐ์์. |
@@ -0,0 +1,56 @@
+package util;
+
+public class HttpRequest {
+
+ private String method;
+ private String url;
+ private String queryString;
+
+ public HttpRequest(String line) {
+ String[] splitHeader = line.split(" ");
+ // uriPath = ์ ์ฒด uri (์ฟผ๋ฆฌ ํ๋ผ๋ฏธํฐ ๋ถ๋ฆฌ ์ )
+ String uriPath = getURIPath... | Java | inline์ผ๋ก ์ค์ฌ๋ณด๋ ๊ฑด์ด๋จ๊น์? ์๋ฏธ๋ฅผ ๋๋ฌ๋ด๋ ์ง์ญ๋ณ์๊ฐ ์๋๋ผ๋ฉด ์๋ตํ๋ ํธ์ด ๊น๋ํ ๊ฑฐ๊ฐ์์. |
@@ -0,0 +1,45 @@
+package controller;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import service.UserJoinService;
+import util.HttpRequest;
+import util.HttpResponse;
+
+public class UserController {
+ private final String HTTP_GET = "GET";
+ private final String JOIN_FORM = "/user/form.html";
+... | Java | ์์๊ฐ ๋ง์์ง๋ฉด ์ข ํท๊ฐ๋ฆด๊ฑฐ๊ฐ์์, ์๊ทธ๋์ฒ์ ๊ท์น๊ฐ์๊ฒ ์์ผ๋ฉด ์ข๊ฒ ๋ค์ |
@@ -0,0 +1,141 @@
+package com.example.firstproject.controller;
+
+import com.example.firstproject.dto.ArticleDto;
+import com.example.firstproject.dto.BoardDto;
+import com.example.firstproject.entity.Article;
+import com.example.firstproject.entity.Board;
+import com.example.firstproject.service.ArticleService;
+impo... | Java | delete ๋ฉ์๋์ articleId๋ฅผ ์ฌ์ฉํ๋ ๋ฉ์๋์ ์์ ์ ๊ณ ๋ คํด๋ณด์๋ฉด ์ข์ ๊ฒ ๊ฐ์์ |
@@ -0,0 +1,41 @@
+package com.example.firstproject.controller;
+
+import com.example.firstproject.service.ArticleService;
+import com.example.firstproject.service.BoardService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.sp... | Java | / ์ฌ๋์์ ์ ๋ฌด์ ๋ฐ๋ฅธ ์ฐจ์ด์ ์ ํจ๊ป ๊ณต๋ถํด๋ด
์๋ค |
@@ -29,14 +29,14 @@ public Game findMatchTypeById(Integer matchId) {
"FROM matches WHERE id = ?";
return jdbcTemplate.queryForObject(SQL, new Object[]{matchId},
(rs, rowNum) -> Game.builder()
- .id(rs.getInt("id"))
- .awayTeam... | Java | ์กฐ๊ธ์ด๋ผ๋ ๋ ๋ณด๊ธฐ์ข์ ์ฝ๋๋ฅผ ์์ฑํ๊ธฐ ์ํ ๋
ธ๋ ฅ์ธ๊ฐ์. ๐ |
@@ -1,13 +1,16 @@
package kr.codesquad.baseball.dto;
-import lombok.AllArgsConstructor;
import lombok.Getter;
-import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter @Setter
-@AllArgsConstructor @NoArgsConstructor
public class GameInitializingRequestDto {
private Integer matchId;
+
+ public G... | Java | Lombok ์ฌ์ฉ์ ๋ํด์ ์กฐ๊ธ ๊บผ๋ ค์ง์๋ ๋ฉด์ด ์๋ ๊ฒ ๊ฐ์๋ฐ lombok ์ด์ ์ฐ์
๋ ๊ด์ฐฎ์์.
๋ค๋ง ๊ณตํต์ ์ผ๋ก ์ฃผ์ํด์ผ ํ ์ฌํญ๋ค์ด ์๋๋ฐ, ์๋ ๋งํฌ๋ฅผ ์ฐธ๊ณ ํด ์ฃผ์ธ์.
https://kwonnam.pe.kr/wiki/java/lombok/pitfall |
@@ -1,13 +1,10 @@
package kr.codesquad.baseball.dto.teamVO;
import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
@Getter @Setter
-@AllArgsConstructor
public class TeamVO {
... | Java | `VO`, `DTO`, ๊ทธ๋ฆฌ๊ณ ๋ชจ๋ธ ํด๋์ค๋ฅผ ์ด๋ค ๊ธฐ์ค์ผ๋ก ๊ตฌ๋ถํ์
จ๋์? |
@@ -1,13 +1,16 @@
package kr.codesquad.baseball.dto;
-import lombok.AllArgsConstructor;
import lombok.Getter;
-import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter @Setter
-@AllArgsConstructor @NoArgsConstructor
public class GameInitializingRequestDto {
private Integer matchId;
+
+ public G... | Java | ์ด์ ๋ถํฐ ๋กฌ๋ณต์ ์๋ฌด ์๊ฐ ์์ด ๊ธฐ๊ณ์ ์ผ๋ก ์ฌ์ฉ ํ๋๊ฑฐ ๊ฐ์ต๋๋ค. ์ง๋ ํ๋ก์ ํธ์ ๋น๋๋ฅผ ์จ๋ณด๋ฉด์ ๋๋์ฑ ๋กฌ๋ณต ์์ด ๊ตฌํ์ ํด๋ด์ผ๊ฒ ๋ค๋ ์๊ฐ์ด ๋ค์ด์ ํ์ด์๊ฒ ์ฐ์ง ๋ง์๊ณ ์ ์ํ๊ณ , ์ด๋ฒ ํ๋ก์ ํธ์๋ ํด๋์ค์ ๋น๋๋ฅผ ์ง์ ๋ง๋ค์ด๋ณด๊ณ ์๋๋ฐ ๊ณต๋ถ๊ฐ ๋ง์ด ๋๊ณ ์๋ค์.
์๋ ค์ฃผ์ ์ฃผ์์ฌํญ ๋งํฌ๋ ์ฝ์ด ๋ดค๋๋ฐ ๋ชจ๋ฅด๊ณ ์ด๊ฒ ์ฐธ ๋ง์๋ค๋ ์๊ฐ์ด ๋๋ค์! ๋ค์ ํ๋ก์ ํธ๋ถํฐ ์ ์ํ๋ฉฐ ์ฌ์ฉ ํ๊ฒ ์ต๋๋ค. ์กฐ์ธ ํด์ฃผ์
์ ๊ฐ์ฌํฉ๋๋ค. |
@@ -1,13 +1,10 @@
package kr.codesquad.baseball.dto.teamVO;
import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
@Getter @Setter
-@AllArgsConstructor
public class TeamVO {
... | Java | ๋ชจ๋ธ ํด๋์ค๋ DB์ ์ํฐํฐ์ ์ง์ ๋์๋๋ ํด๋์ค๋ผ ์๊ฐ ํ๊ณ , VO๋ DB์ ์ฌ๋ฌ ์ํฐํฐ ๋ฐ์ดํฐ๋ฅผ DTO์ ์๋ง๊ฒ ๊ฐ๊ณตํ ์ต์ ๋จ์(DTO์ ๋ถ๋ถ ์งํฉ), DTO๋ ํด๋ผ์ด์ธํธ์ ํต์ ์ ํ๋ ์ ์ ์์ ์ฌ์ฉ๋๋ ์ต์ข
๋ฐ์ดํฐ ํด๋์ค๋ผ๋ ๊ธฐ์ค์ ์ธ์ฐ๊ณ ์ฌ์ฉ์ ํ์์ต๋๋ค.
๋ฐฑ์๋ ์๊ตฌ ์ฌํญ์ธ(์ต์
) ํ, ์ ์ ๋ฐ์ดํฐ ๊ด๋ฆฌ ํด์ ์ผ๋์ ๋๊ณ ๋ถ๋ฅ๋ฅผ ํ๋๊ฑด๋ฐ, ๋ก์ง์ด ๋ณต์กํด์ง๋ค ๋ณด๋ VO์ ๋ชจ๋ธ ์ฌ์ด์ ๊ฒฝ๊ณ๊ฐ ๋ง์ด ๋ชจํธํด์ง๊ฑฐ ๊ฐ์ต๋๋คใ
ใ
์ด๋ฐ ๊ฒฝ์ฐ์ VO๋ผ๋ ์ฝ์ด๋ฅผ ์ฌ์ฉํ๋๊ฒ ๋ง๋๊ฑด์ง ์ ๋งคํ ์ ์ด ์์๋๋ฐ, ์๋ฌด๋๋ ๋ ๊ณต๋ถํ๊ณ ์๊ฐ์ ํด๋ด์ผ ํ ๊ฑฐ ๊ฐ์ต๋๋ค. ์กฐ์ธ ํด์ฃผ์ ... |
@@ -0,0 +1,48 @@
+/* http://meyerweb.com/eric/tools/css/reset/
+ v2.0 | 20110126
+ License: none (public domain)
+*/
+
+html, body, div, span, applet, object, iframe,
+h1, h2, h3, h4, h5, h6, p, blockquote, pre,
+a, abbr, acronym, address, big, cite, code,
+del, dfn, em, img, ins, kbd, q, s, samp,
+small, strike, s... | Unknown | css ๋ฆฌ์
์๊ณ ์์๋๋ฐ ๋ฆฌ๋ง์ธ๋ํ๊ณ ๊ฐ๋๋ค! |
@@ -1,9 +1,10 @@
import { useState } from "react";
-import Input from "../components/Input";
import InputBox from "../components/InputBox";
-import validation from "../utils/validation";
+import InputCheckBox from "../components/InputCheckBox";
+import validateFormInfos from "../utils/validation";
import checking fr... | Unknown | ๋ณ์๋ช
๋ฐ๊พธ์ ๊ฑฐ ๊ตฟ๊ตฟ |
@@ -1,19 +1,28 @@
+import './InputBox.css';
+
type InputBoxProps = {
+ type: string;
id: string;
- checked: boolean;
- onChange: any;
+ value: string;
+ onChange: (e : React.FormEvent<HTMLInputElement>) => void;
+ label: string;
+ required: boolean;
}
-const InputBox = ({id, checked, onChange}: InputBoxPr... | Unknown | ์ปดํฌ๋ํธ ์ด๋ฆ์ด InputBox๋๊น checkbox์ฉ input ์์๋ฅผ ์ํ ์ปดํฌ๋ํธ ๊ฐ์๋ฐ, type props๋ฅผ ์ถ๊ฐํ๊ณ checked ์์ฑ ๋์ value ์์ฑ์ผ๋ก ๋ณ๊ฒฝํ์ ์ด์ ๊ฐ ์์๊น์? |
@@ -1,19 +1,28 @@
+import './InputBox.css';
+
type InputBoxProps = {
+ type: string;
id: string;
- checked: boolean;
- onChange: any;
+ value: string;
+ onChange: (e : React.FormEvent<HTMLInputElement>) => void;
+ label: string;
+ required: boolean;
}
-const InputBox = ({id, checked, onChange}: InputBoxPr... | Unknown | ์! ๋ฐ์ InputCheckBox๊ฐ ๋ฐ๋ก ์๊ณ ์๋์ Input์ด InputBox๋ก ๋ณ๊ฒฝ๋๊ฑฐ์๊ตฐ์. ์ ๋ ์์ ์ ๊ทธ๋๋ก Input๊ณผ InputCheckBox๊ฐ ๋ ๋์๋ณด์ฌ์..! |
@@ -1,9 +1,10 @@
import { useState } from "react";
-import Input from "../components/Input";
import InputBox from "../components/InputBox";
-import validation from "../utils/validation";
+import InputCheckBox from "../components/InputCheckBox";
+import validateFormInfos from "../utils/validation";
import checking fr... | Unknown | ์ ํํ ํ์
์ข์ต๋๋ค~! |
@@ -0,0 +1,28 @@
+import './InputCheckBox.css';
+
+type InputCheckBoxProps = {
+ id: string;
+ checked: boolean;
+ onChange: (e : React.FormEvent<HTMLInputElement>) => void;
+ label?: string;
+ required?: boolean;
+}
+
+const InputCheckBox = ({id, checked, onChange, label, required}: InputCheckBoxProps) => {
+ re... | Unknown | label์ className์ ๊ฒฐ์ ํ๋ ๋ถ๋ถ์ด inputBox์ inputCheckBox์์ ๋ฐ๋ณต๋ฉ๋๋ค. ์ด ๋ถ๋ถ์ ํ์ className๊ณผ ํ๋๊ทธ์ ๋ฐ๋ผ ์ถ๊ฐ์ฌ๋ถ๊ฐ ์ ํด์ง๋ className, ๊ทธ๋ฆฌ๊ณ ํ๋๊ทธ๋ฅผ ์ธ์๋ก ๋ฐ์์ ํด๋์ค ๋ค์์ ๋ฆฌํดํด์ฃผ๋ ํจ์๋ก ๋ฐ๊ฟ๋ณด๋ฉด ์ด๋จ๊น์?
```suggestion
const InputCheckBox = ({id, checked, onChange, label, required}: InputCheckBoxProps) => {
const labelClassName = getClassNameByRequired('inputC... |
@@ -0,0 +1,65 @@
+
+package basball.view;
+
+import basball.baseball.model.GameStatus;
+
+import java.util.Arrays;
+import java.util.Scanner;
+import java.util.regex.Pattern;
+
+public final class InputView {
+
+ private static final String INPUT_NUMBER_MESSAGE = "์ซ์๋ฅผ ์
๋ ฅํด ์ฃผ์ธ์ : ";
+ private static final Scanner s... | Java | (nit) Inner class๋ก ๋์ค๊ฑฐ๋ฉด Validator์ ๋ด๋ถ ๋ฉ์๋ ๋ชจ๋ private์ผ๋ก ํ๋๊ฒ ์ข๊ฒ ์ด์. |
@@ -0,0 +1,65 @@
+
+package basball.view;
+
+import basball.baseball.model.GameStatus;
+
+import java.util.Arrays;
+import java.util.Scanner;
+import java.util.regex.Pattern;
+
+public final class InputView {
+
+ private static final String INPUT_NUMBER_MESSAGE = "์ซ์๋ฅผ ์
๋ ฅํด ์ฃผ์ธ์ : ";
+ private static final Scanner s... | Java | ๋ฉํ ๋ ์๋
ํ์ธ์ ! ๋ต๋ณ ๋จ๊ฒจ์ฃผ์
์ ๊ฐ์ฌํฉ๋๋ค ๊ทธ๋ฐ๋ฐ Validator ๋ฅผ private ๋ก ๋ฐ๊พธ๋ฉด Balls ๋ InputView ํ
์คํธ ๊ฐ์ ๊ณณ ์์๋ ์ด๋ป๊ฒ ์ฌ์ฉํด์ผ ํ๋์ ?
์ ์๊ฐ์ผ๋ก๋ InputView ์์ get ๋ฉ์๋๋ก ์ ๊ทผ ๋ฉ์๋๋ฅผ ์ ๊ณตํ๋ ๋ฐฉ๋ฒ ๋ฟ์ธ๋ฐ ์ด๋ ๊ฒ ๋๋ฉด InputView ํ
์คํธ๋ ๊ทธ๋ ๋ค ์ณ๋ Balls ๋ถ๋ถ์์ Validator ๋ฅผ ์ฌ์ฉํ๊ธฐ ์ํด ๋ถํ์ํ๊ฒ InputView ๊ฐ์ฒด๋ฅผ ๋ง๋ค์ด์ผ ํ๋๋ฐ ๋ง์๊น์ !?
์๋๋ฉด ์ ๋ฒ์ ๋จ๊ฒจ์ฃผ์ static class ๋ก ๋ฐ๊พธ๋ผ๋๊ฒ ์ด๋ ๊ฒ ๋ฐ๊พธ๋ผ๊ณ ํ์ ๊ฒ ์๋์๋์ !?? |
@@ -0,0 +1,65 @@
+
+package basball.view;
+
+import basball.baseball.model.GameStatus;
+
+import java.util.Arrays;
+import java.util.Scanner;
+import java.util.regex.Pattern;
+
+public final class InputView {
+
+ private static final String INPUT_NUMBER_MESSAGE = "์ซ์๋ฅผ ์
๋ ฅํด ์ฃผ์ธ์ : ";
+ private static final Scanner s... | Java | ์ ์ ๋จ๊ฒจ๋๋ฆฐ๊ฑด static ๊ฐ๋ณ ํด๋์ค๋ก ๋๋ผ๋ ์๊ธฐ์์ด์ ใ
ใ
์ ๊ฐ private๋ก ํ๋ผ๊ณ ๋ง์๋๋ฆฐ๊ฑด ์ฌ์ค InputView ๋ด์์๋ง ์ฐ์ฌ์ ๊ทธ๋ ๊ฒ ๋ง์๋๋ฆฐ๊ฑฐ์์ด์. ๋ง์ฝ Validator ์์ฒด๊ฐ ๋ฐ์ผ๋ก ๋์์์ ์ด์ ๊ฐ ์๋ค๋ฉด ํ
์คํธ๋ ํ์์๋๊ฑฐ๊ฒ ์ฃ . (์บก์ํ์ ์๋ฏธ์์ด์. Validator๋ฅผ ๊ฐ์ ธ๋ค ์ธ ๋ฐ๊ฐ InputView ์ธ์ ์๋ค๋ฉด ๊ตณ์ด Validator๊ฐ ์ด๋ป๊ฒ ๊ตฌํ๋์๋์ง ํ
์คํธ๋ฅผ ์ด๋ป๊ฒ ํ ์ง๋ ๊ณ ๋ฏผํ ํ์๊ฐ ์๋๊ฑฐ๊ฒ ์ฃ )
ํ์ง๋ง Validator๊ฐ ๋ค๋ฅธ๋ฐ์๋ ์ฐ์ผ๊ฑฐ๋ผ๋ฉด ๊ฐ๋ณ static ํด๋์ค๋ก ๋นผ๋๋๊ฒ ๋ ์ข์ ๊ฒ ๊ฐ์์. |
@@ -0,0 +1,65 @@
+
+package basball.view;
+
+import basball.baseball.model.GameStatus;
+
+import java.util.Arrays;
+import java.util.Scanner;
+import java.util.regex.Pattern;
+
+public final class InputView {
+
+ private static final String INPUT_NUMBER_MESSAGE = "์ซ์๋ฅผ ์
๋ ฅํด ์ฃผ์ธ์ : ";
+ private static final Scanner s... | Java | ์๋
ํ์ธ์ ๋ฉํ ๋ ! `๊ฐ๋ณ static ํด๋์ค` ๋ผ๋ ๋ง์ด ์ ์ดํด๊ฐ ์๋๋๋ฐ ํน์ `Math` ํด๋์ค ์ฒ๋ผ `final ๊ณผ private ์์ฑ์` ๋ฅผ ํตํด ์์ฑ์ ๋ง๊ณ ๋จ์ง `Utils` ํด๋์ค ์ฒ๋ผ ์ฌ์ฉ ์ ์๋ฏธ ํ์๋๊ฑด๊ฐ์ ? ?์๋๋ฉด
์ธ๋ถ๋ `public ํด๋์ค` ๋ก ๋ง๋ค๊ณ ๋ด๋ถ์ `public static class` ๋ก ๋ง๋ค๋ผ๊ณ ํ์๋ ๊ฑด๊ฐ์ ??
< final ์ฌ์ฉ >
```
public final class Validator {
private Validator() {
}
private static... |
@@ -0,0 +1,65 @@
+
+package basball.view;
+
+import basball.baseball.model.GameStatus;
+
+import java.util.Arrays;
+import java.util.Scanner;
+import java.util.regex.Pattern;
+
+public final class InputView {
+
+ private static final String INPUT_NUMBER_MESSAGE = "์ซ์๋ฅผ ์
๋ ฅํด ์ฃผ์ธ์ : ";
+ private static final Scanner s... | Java | ์ ์..์ ๊ฐ ๋ง์๋๋ฆฐ๊ฑธ ๋๋ฌด ํฌ๊ฒ ์๊ฐํ์ ๊ฒ ๊ฐ๊ตฐ์..^^;
์ ๊ฐ ๋ง์๋๋ฆฐ๊ฑด ๋จ์ํ Validator.java ํ์ผ์ ํ๋ ๋ ๋ง๋ค์ด์ ๊ฑฐ๊ธฐ๋ค ๋ฃ๋๋ค๋ ์๊ธฐ์์ด์.
๊ทธ๋ฌ๋ฉด ๊ตณ์ด InputView์ ์ข
์์ ์ธ namespace๋ฅผ ๊ฐ์ง ํ์๊ฐ ์์ผ๋๊น์ ใ
ใ
|
@@ -88,5 +88,186 @@ export default {
display: flex;
align-items: center;
justify-content: center;
+ html,
+ body {
+ height: 100%;
+ width: 100%;
+ padding: 0;
+ margin: 0;
+ }
+ .container {
+ background: white;
+ width: 100%;
+ height: 100%;
+ display: flex;
+ flex-direction: c... | Unknown | ์ฌ๊ธฐ์ด๋ ๊ฒํ๋ฉด์๋ผ์ |
@@ -88,5 +88,186 @@ export default {
display: flex;
align-items: center;
justify-content: center;
+ html,
+ body {
+ height: 100%;
+ width: 100%;
+ padding: 0;
+ margin: 0;
+ }
+ .container {
+ background: white;
+ width: 100%;
+ height: 100%;
+ display: flex;
+ flex-direction: c... | Unknown | ์์ ํ์ต๋๋ค |
@@ -0,0 +1,105 @@
+import { Helmet } from 'react-helmet-async';
+import titles from '../routes/titles';
+import styled from 'styled-components';
+import MainCard from './components/MainCard';
+import Tag from './components/Tag';
+import Card from './components/Card';
+import { useQuery } from 'react-query';
+import { g... | Unknown | P4: margin์ด๋ margin-bottom ๊ฐ์ด ์ด ์ด์ ๊ฐ ์์๊น์? ํ๋๋ก ํต์ผํ๋ฉด ๋ ๊ฒ ๊ฐ์์. |
@@ -0,0 +1,105 @@
+import { Helmet } from 'react-helmet-async';
+import titles from '../routes/titles';
+import styled from 'styled-components';
+import MainCard from './components/MainCard';
+import Tag from './components/Tag';
+import Card from './components/Card';
+import { useQuery } from 'react-query';
+import { g... | Unknown | P1: suspense๋ก ์ฎ๊ธฐ๋ ๊ฒ ๊ณต๋ถ
https://blog.jbee.io/react/React%EC%97%90%EC%84%9C+%EC%84%A0%EC%96%B8%EC%A0%81%EC%9C%BC%EB%A1%9C+%EB%B9%84%EB%8F%99%EA%B8%B0+%EB%8B%A4%EB%A3%A8%EA%B8%B0 |
@@ -0,0 +1,32 @@
+import styled from 'styled-components';
+
+const TagWrapper = styled.div<{ $isActive: boolean }>`
+ border-radius: 40px;
+ border: none;
+ padding: 14px 20px;
+ font-size: 18px;
+ cursor: pointer;
+ line-height: 22px;
+ color: ${(props) => (props.$isActive ? '#ffffff' : '#868b94')};
+ backgrou... | Unknown | P3: ์ดํ์ css variables๋ก ๋นผ์ ๊ด๋ฆฌํ๋ฉด ์ข์ ๊ฒ ๊ฐ์์. |
@@ -0,0 +1,31 @@
+class VisitDateError {
+ #notInputDate(visitDate) {
+ if (visitDate.length === 0) {
+ throw new Error('[ERROR] ๋ฐฉ๋ฌธ ๋ ์ง๋ฅผ ์
๋ ฅํด ์ฃผ์ธ์.');
+ }
+ }
+
+ #dateNotNum(visitDate) {
+ if (
+ Number.isNaN(Number(visitDate)) ||
+ Number.isInteger(Number(visitDate)) === false ||
+ visitD... | JavaScript | ํด๋น ๋ถ๋ถ ์ ๊ท ํํ์์ผ๋ก ํ๋ฉด if๋ฌธ์ ํ๋๋ก ์ค์ผ ์ ์์ ๊ฒ ๊ฐ์ต๋๋ค ! |
@@ -0,0 +1,31 @@
+class VisitDateError {
+ #notInputDate(visitDate) {
+ if (visitDate.length === 0) {
+ throw new Error('[ERROR] ๋ฐฉ๋ฌธ ๋ ์ง๋ฅผ ์
๋ ฅํด ์ฃผ์ธ์.');
+ }
+ }
+
+ #dateNotNum(visitDate) {
+ if (
+ Number.isNaN(Number(visitDate)) ||
+ Number.isInteger(Number(visitDate)) === false ||
+ visitD... | JavaScript | ํด๋น ๋ฌธ๊ตฌ๋ constant์ ๋ฐ๋ก error.js๋ฅผ ์์ฑํ์
์ ํ์๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค ! |
@@ -0,0 +1,61 @@
+import { MENU_NAMES, MENUS } from '../../constant/menu.js';
+
+class OrderMenuError {
+ #orderNotInput(orderMenu) {
+ if (
+ orderMenu.length === 1 &&
+ orderMenu[0].menu.trim() === ''
+ ) {
+ throw new Error('[ERROR] ์ฃผ๋ฌธํ์ค ๋ฉ๋ด์ ๊ฐ์๋ฅผ ์
๋ ฅํด ์ฃผ์ธ์.');
+ }
+ }
+
+ #orderWrongInput(ord... | JavaScript | ์ ๋ ์ค์๋ก ๋์น ๋ถ๋ถ์ด์ง๋ง 1.0์ ํฌํจํ ์ง ์ํ ์ง ๊ณ ๋ฏผํ์
จ๋ค๊ณ ํ์
จ๋๋ฐ ๊ทธ ๋ถ๋ถ ์ดํดํฉ๋๋ค...
๋ฏธ์
์ด ๋๋๊ณ ์๊ฐ๋๊ฑฐ์ง๋ง 1.0๋ ํฌํจ์ ํ๋ค๋ฉด 1.000000000000000... ๋ 1๋ก ๋๋๊ฑฐ๋ผ 0์ ๋ฌดํ๋๋ก ์
๋ ฅํ๋ฉด ๋ฌธ์ ๊ฐ ๋ฐ์ํ์ง ์์๊น ํ๋ ์ฐ๋ ค๊ฐ ๋๋๋ฐ ์ด๋ป๊ฒ ์๊ฐํ์๋์? |
@@ -0,0 +1,28 @@
+const EVENT_NAMES = ['ํฌ๋ฆฌ์ค๋ง์ค ๋๋ฐ์ด ํ ์ธ', 'ํ์ผ ํ ์ธ', '์ฃผ๋ง ํ ์ธ', 'ํน๋ณ ํ ์ธ', '์ฆ์ ์ด๋ฒคํธ'];
+
+const WEEKDAY_DISCOUNT_DATE = [
+ 3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 17,
+ 18, 19, 20, 21, 24, 25, 26, 27, 28, 31,
+];
+
+const WEEKEND_DISCOUNT_DATE = [
+ 1, 2, 8, 9, 15, 16, 22, 23, 29, 30,
+];
+
+const SPECIAL_DISCOUNT... | JavaScript | ํด๋น ๋ถ๋ถ์ `new Date()` ๋ฉ์๋๋ก ํํ์ด ๊ฐ๋ฅํ ๊ฒ ๊ฐ์ต๋๋ค !
`new Date()`๋ฅผ ์ฌ์ฉํ์๋ฉด 0-์ผ์์ผ ~ 6-ํ ์์ผ๋ก 0~6๊น์ง์ number๋ก ์ถ๋ ฅ๋ฉ๋๋ค ! |
@@ -0,0 +1,66 @@
+import OUTPUT from '../../utils/constant/output.js';
+import OutputView from '../../utils/view_type/OutputView.js';
+import { EVENT_NAMES } from '../../utils/constant/event.js';
+
+class PrintEventResult {
+ #totalOrderAmount(TOTAL_AMOUNT) {
+ OutputView.printOutput(`${OUTPUT.TOTAL_AMOUNT.BEFORE_D... | JavaScript | ```jsx
OutputView.printOutput('');
```
์ด ๋ฌธ๊ตฌ ๊ฐํ๋๋ฌธ์ ์
๋ ฅํ์ ๊ฒ ๊ฐ์๋ฐ `์`๋ ๋ณ์ํ ํ์
์ `์\n`์ ํ์
๋ ๋๊ณ
๊ทธ ๋ค์ ๋ฌธ๊ตฌ์ `OutputView.printOutput(${OUTPUT.EVENT.BADGE});`๊ฐ ๋์ค๋
`BADGE: '\n<12์ ์ด๋ฒคํธ ๋ฐฐ์ง>'` ์ด๋ฐ์์ผ๋ก ์ถ๊ฐํ๋ฉด ์ฝ๋๊ฐ ์กฐ๊ธ ๋ ๊น๋ํด ์ง ๊ฒ ๊ฐ์์ ! |
@@ -0,0 +1,56 @@
+import { WEEKDAY_DISCOUNT_DATE, WEEKEND_DISCOUNT_DATE, SPECIAL_DISCOUNT_DATE } from '../../utils/constant/event.js';
+import { MENUS } from '../../utils/constant/menu.js';
+
+class CalculateEventBenefit {
+ #event = {
+ christmas: 0,
+ weekday: 0,
+ weekend: 0,
+ special: 0,
+ giveaway... | JavaScript | ```jsx
#event = {
christmas: 0,
weekday: 0,
weekend: 0,
special: 0,
giveaway: 0,
};
```
์ด๋ ๊ฒ ์์ฑํ์ ๊ฒ ์ฒ๋ผ ํด๋น ์์ ๊ฐ๋ ๊ณ ์ ๊ฐ์ด๋ ๋ณ์ํํด์ ์๋ฏธ๋ฅผ ๋ถ์ฌํ๋ ๊ฒ๋ ๊ด์ฐฎ์ ๊ฒ ๊ฐ์ต๋๋ค ! |
@@ -0,0 +1,41 @@
+import VisitDateError from '../../../utils/error/type/visit_date_error.js';
+import printError from '../../../utils/error/print_error.js';
+import INPUT_QUESTION from '../../../utils/constant/input_question.js';
+import OUTPUT from '../../../utils/constant/output.js';
+import InputView from '../../../... | JavaScript | ์๊ตฌ์ฌํญ์ ์๋ ๋ง์ฝ ํ์์ ๋ง์ง ์์ผ๋ฉด ์๋ก์ด ๊ฐ์ ๋ฐ์์ค๋ ๊ณผ์ ์ด ์๋๊ฒ ๊ฐ์ต๋๋ค.
(ํน์ ์ ๊ฐ ๋ชป ์ฐพ๋ ๊ฒ์ด๋ผ๋ฉด ์ ์ํด์ฃผ์๊ธฐ ๋ฐ๋๋๋ค)
ํด๋น ๊ตฌ๋ฌธ์์๋ return false๋ฅผ ํ๊ณ ๊ทธ๋ฅ break์จ์ ๋น ์ ธ ๋์จ๊ฒ ๊ฐ์๋ฐ return false ๋์ return this.#inputVisitDate() ํ๋ฉด ๋ค์ ๊ฐ์ ๋ฐ์ ์ฌ์ ์์ ๊ฒ ๊ฐ์ต๋๋ค. |
@@ -0,0 +1,48 @@
+import CalculateOrderMenu from '../../model/calculate_order_menu.js';
+import PrintOrderMenu from '../../view/print_order_menu.js';
+import OrderMenuError from '../../../utils/error/type/order_menu_error.js';
+import printError from '../../../utils/error/print_error.js';
+import INPUT_QUESTION from '.... | JavaScript | ์ด ๋ถ๋ถ๋ ๋ ์ง ๋ฐ์์ฌ๋์ ๋ง์ฐฌ๊ฐ์ง๋ก ์๋ชป๋ ๊ฒฝ์ฐ ์ ๊ฐ์ ๊ฐ์ ธ์ค๋ ๊ณผ์ ์ด ์์ด๋ณด์
๋๋ค |
@@ -0,0 +1,67 @@
+import CalculateTotalOrderAmount from '../../model/calculate_total_order_amount.js';
+import CalculateEventDetails from '../../model/calculate_event_details.js';
+import PrintEventResult from '../../view/print_event_result.js';
+
+class EventManage {
+ #visitDate;
+ #orderMenu;
+
+ constructor(visi... | JavaScript | ์ด ๋ถ๋ถ์์ 10000์ด ์ด๋ค ์๋ฏธ๋ฅผ ๊ฐ๊ณ ์๋์ง ํ๋จํ๊ธฐ ํ๋ญ๋๋ค. ์ด ํ๋ก๋ ์ซ์๊ฐ ํ๋์ฝ๋ฉ ๋ ๊ฒฝ์ฐ๊ฐ ์๋๋ฐ ์๋ฏธ๋ฅผ ๊ฐ์ง ์ ์๋๋ก ์์์ชฝ์ผ๋ก ๋นผ์ฃผ๋ ๊ฒ์ ์ด๋จ๊น์? |
@@ -0,0 +1,67 @@
+import CalculateTotalOrderAmount from '../../model/calculate_total_order_amount.js';
+import CalculateEventDetails from '../../model/calculate_event_details.js';
+import PrintEventResult from '../../view/print_event_result.js';
+
+class EventManage {
+ #visitDate;
+ #orderMenu;
+
+ constructor(visi... | JavaScript | else๋ฅผ ์ง์ํ๋ผ๊ณ ํ ๊ฒ์ ์๋ฏธ๊ฐ ๊ฑฐ์ ๋น์ทํ ์๋ฏธ๋ฅผ ๊ฐ๊ณ ์๋ ์ผํญ ์ฐ์ฐ์๋ฅผ ์ฐ๋ผ๊ณ ํ ๊ฒ์ ์๋๋ผ๊ณ ์๊ฐํ๋๋ฐ, ์ผํญ ์ฐ์ฐ์๋ฅผ ์ด ์ด์ ๊ฐ ๋ฐ๋ก ์์๊น์? |
@@ -0,0 +1,67 @@
+import CalculateTotalOrderAmount from '../../model/calculate_total_order_amount.js';
+import CalculateEventDetails from '../../model/calculate_event_details.js';
+import PrintEventResult from '../../view/print_event_result.js';
+
+class EventManage {
+ #visitDate;
+ #orderMenu;
+
+ constructor(visi... | JavaScript | ์
๋ ฅ 2๊ฐ์ ์ด๋ฒคํธ๋ก ํด๋์ค๋ฅผ ๋๋์
จ๋๋ฐ ๋ฐฐ์ง๋ ๋๋จธ์ง ์ชฝ(ํ ์ธ์ด๋ ํํ ๋ฑ ๊ณ์ฐํํธ)์ ๊ธฐ๋ฅ์ด ๋ฌ๋ผ๋ณด์ด๋๋ฐ ๋ค๋ฅธ ํด๋์ค๋ก ๋นผ๋๊ฒ์ ์ด๋จ๊น์ |
@@ -0,0 +1,41 @@
+import VisitDateError from '../../../utils/error/type/visit_date_error.js';
+import printError from '../../../utils/error/print_error.js';
+import INPUT_QUESTION from '../../../utils/constant/input_question.js';
+import OUTPUT from '../../../utils/constant/output.js';
+import InputView from '../../../... | JavaScript | 3์ฃผ์ฐจ ๊ณตํต ํผ๋๋ฐฑ์ "๊ฐ์ฒด๋ก๋ถํฐ ๋ฐ์ดํฐ๋ฅผ ๊บผ๋ด๋ ๊ฒ(get)์ด ์๋๋ผ, ๋ฉ์์ง๋ฅผ ๋์ง๋๋ก ๊ตฌ์กฐ๋ฅผ ๋ฐ๊ฟ ๋ฐ์ดํฐ๋ฅผ ๊ฐ์ง๋ ๊ฐ์ฒด๊ฐ ์ผํ๋๋ก ํด์ผํ๋ค"๊ณ ํ๋๋ฐ, getter๋ฅผ ์ฌ์ฉํ์ง ์๊ณ ํด๊ฒฐํ ๋ฐฉ๋ฒ์ ๊ณ ๋ฏผํด๋ณด๋ ๊ฒ๋ ์ข์ ๊ฒ ๊ฐ์ต๋๋ค. |
@@ -0,0 +1,41 @@
+import VisitDateError from '../../../utils/error/type/visit_date_error.js';
+import printError from '../../../utils/error/print_error.js';
+import INPUT_QUESTION from '../../../utils/constant/input_question.js';
+import OUTPUT from '../../../utils/constant/output.js';
+import InputView from '../../../... | JavaScript | ๋ณ์๋ช
์ `ERROR`๋ก ํ์ ์ด์ ๊ฐ ๊ถ๊ธํฉ๋๋ค. |
@@ -0,0 +1,41 @@
+import VisitDateError from '../../../utils/error/type/visit_date_error.js';
+import printError from '../../../utils/error/print_error.js';
+import INPUT_QUESTION from '../../../utils/constant/input_question.js';
+import OUTPUT from '../../../utils/constant/output.js';
+import InputView from '../../../... | JavaScript | (์ง๋๊ฐ๋ค) ์์ธ๊ฐ ๋ฐ์ํ์ฌ `return false`๋ฅผ ํ๋ฉด `#inputVisitDate()` ๋ฉ์๋์์ ์กฐ๊ฑด์์ ๊ฑธ๋ฆฌ์ง ์์ ๊ฒ์ด๊ณ , ๋ฌดํ ๋ฃจํ์ ์ํด ์ฌ์
๋ ฅ์ ๋ฐ๊ฒ๋ ๊ฒ ๊ฐ๋ค์!
๋ฌดํ ๋ฃจํ๊ฐ ์๋ ๋ค๋ฅธ ๋ฐฉ์์ ํด๊ฒฐ๋ฐฉ๋ฒ๋ ๊ณ ๋ฏผํด๋ณด๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค. |
@@ -0,0 +1,29 @@
+import VisitDateManage from '../child/visit_date_manage.js';
+import OrderMenuManage from '../child/order_menu_manage.js';
+import EventManage from '../child/event_manage.js';
+
+class PlannerManage {
+ #VISIT_DATE = null;
+ #ORDER_MENU = null;
+
+ async visitDate() {
+ const visitDateManage = n... | JavaScript | 3์ฃผ์ฐจ ๊ณตํต ํผ๋๋ฐฑ์ ํ๋์ ์๋ฅผ ์ต์ํํ๋ค๋ ์ฝ๋ฉํธ๊ฐ ์๋๋ฐ, ํ๋๋ฅผ ์ฌ์ฉํ์ง ์๊ณ ์ธ์๋ก ์ ํด์ฃผ์ด ์ฌ์ฉํ๋ค๋ฉด ์ด๋ ์๊น์? |
@@ -0,0 +1,29 @@
+import VisitDateManage from '../child/visit_date_manage.js';
+import OrderMenuManage from '../child/order_menu_manage.js';
+import EventManage from '../child/event_manage.js';
+
+class PlannerManage {
+ #VISIT_DATE = null;
+ #ORDER_MENU = null;
+
+ async visitDate() {
+ const visitDateManage = n... | JavaScript | ๋๋ฉ์ธ ๋ก์ง๊ณผ UI ๋ก์ง์ด ๋ถ๋ฆฌ๋์ด ์์ง์์ ์ฑ ๋ก์ง์ด ์ ๊ฐ๋๋ค ๋ณด๋ ํฐ ํ๋ฆ์ ํ์
ํ๊ธฐ ์ด๋ ค์๋ณด์
๋๋ค.
PlannerManage์์๋ ํ์ด์ฆ๋ฅผ ๋๋๊ณ ๋ค์ด๋ฐ์ ํตํด ํฐ ํ๋ก์ธ์ค๋ฅผ ํํํ๊ณ , ๋ด๋ถ ๋์์ ๋๋ฉ์ธ, UI ๋ก์ง์ ๋ถ๋ฆฌํ์ฌ ๋ด๋นํ๋๋ก ํ๋ฉด ๋์ฑ ์๋ฏธ๊ฐ ๋๋ฌ๋๊ณ ํ๋ก์ธ์ค๋ฅผ ์ดํดํ๊ธฐ ์์ํ ๊ฒ ๊ฐ์ต๋๋ค. |
@@ -0,0 +1,67 @@
+import CalculateTotalOrderAmount from '../../model/calculate_total_order_amount.js';
+import CalculateEventDetails from '../../model/calculate_event_details.js';
+import PrintEventResult from '../../view/print_event_result.js';
+
+class EventManage {
+ #visitDate;
+ #orderMenu;
+
+ constructor(visi... | JavaScript | 10,000๋ ์์๋ก ๊ด๋ฆฌํด์ฃผ๋ฉด ๋์ฑ ์ข์ ๊ฒ ๊ฐ์ต๋๋ค. ์๋ฏธ๋ฅผ ํ์
ํ๊ธฐ๋ ์์ํ๊ณ , ๋ง์ฝ ์กฐ๊ฑด์ด ๋ณ๊ฒฝ๋๋ ์ํฉ์ด ์๋ ๊ฒฝ์ฐ ์์ ํ๊ธฐ ์์ํ๋ค๊ณ ์๊ฐํฉ๋๋ค. |
@@ -0,0 +1,67 @@
+import CalculateTotalOrderAmount from '../../model/calculate_total_order_amount.js';
+import CalculateEventDetails from '../../model/calculate_event_details.js';
+import PrintEventResult from '../../view/print_event_result.js';
+
+class EventManage {
+ #visitDate;
+ #orderMenu;
+
+ constructor(visi... | JavaScript | ์ฌ์ํ์ง๋ง, ์กฐ๊ฑด์ ์ญ์์ผ๋ก ์ ์๋ค๋ฉด ๋ ์ดํดํ๊ธฐ ์์ํ ๊ฒ ๊ฐ์ต๋๋ค.
`20000 ์ด์: ์ฐํ / 10000 ์ด์: ํธ๋ฆฌ / 5000 ์ด์: ๋ณ / ๋๋จธ์ง: ์์` |
@@ -0,0 +1,28 @@
+const EVENT_NAMES = ['ํฌ๋ฆฌ์ค๋ง์ค ๋๋ฐ์ด ํ ์ธ', 'ํ์ผ ํ ์ธ', '์ฃผ๋ง ํ ์ธ', 'ํน๋ณ ํ ์ธ', '์ฆ์ ์ด๋ฒคํธ'];
+
+const WEEKDAY_DISCOUNT_DATE = [
+ 3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 17,
+ 18, 19, 20, 21, 24, 25, 26, 27, 28, 31,
+];
+
+const WEEKEND_DISCOUNT_DATE = [
+ 1, 2, 8, 9, 15, 16, 22, 23, 29, 30,
+];
+
+const SPECIAL_DISCOUNT... | JavaScript | ์ฌ๋ฌ ๊ฐ์ ์ธ์๋ฅผ ๋๊ฒจ์ฃผ๊ณ freeze ๋ฉ์๋๋ฅผ ํธ์ถํ๋ฉด ํ๋ฆฌ์ง๋์ง ์์ ๊ฒ ๊ฐ์ต๋๋ค. |
@@ -0,0 +1,33 @@
+const MENU_NAMES = [
+ '์์ก์ด์ํ', 'ํํ์ค', '์์ ์๋ฌ๋',
+ 'ํฐ๋ณธ์คํ
์ดํฌ', '๋ฐ๋นํ๋ฆฝ', 'ํด์ฐ๋ฌผํ์คํ', 'ํฌ๋ฆฌ์ค๋ง์คํ์คํ',
+ '์ด์ฝ์ผ์ดํฌ', '์์ด์คํฌ๋ฆผ',
+ '์ ๋ก์ฝ๋ผ', '๋ ๋์์ธ', '์ดํ์ธ',
+];
+
+const MENUS = {
+ Epitizer: {
+ ์์ก์ด์ํ: 6000,
+ ํํ์ค: 5500,
+ ์์ ์๋ฌ๋: 8000,
+ },
+ Main: {
+ ํฐ๋ณธ์คํ
์ดํฌ: 55000,
+ ๋ฐ๋นํ๋ฆฝ: 54000,
+ ํด์ฐ๋ฌผํ์คํ: 35000... | JavaScript | ์ค์ฒฉ๋ ๊ฐ์ฒด์ ๊ฒฝ์ฐ, ์ธ๋ถ๋ฅผ ํ๋ฆฌ์ง ํด์ฃผ์ด๋ ๋ด๋ถ๋ ํ๋ฆฌ์ง ๋์ง ์์ต๋๋ค. deep freeze ํค์๋๋ก ํ์ตํด๋ณด๋ ๊ฒ์ ์ถ์ฒ๋๋ฆฝ๋๋ค. |
@@ -0,0 +1,30 @@
+package store.contant;
+
+public enum Constant {
+ PRODUCTS_FILE_PATH("./src/main/resources/products.md"),
+ PROMOTIONS_FILE_PATH("./src/main/resources/promotions.md"),
+
+ Y("Y"),
+ N("N"),
+
+ YEAR("year"),
+ MONTH("month"),
+ DAY("day"),
+
+ DEFAULT_DELIMITER("-... | Java | ์ ๋ ๋ชฐ๋๋ ์ ๊ทํํ์ ๋ฌธ๋ฒ์ด๋ผ ์ฐพ์๋ณด๋๊น named capturing group ์ด๋ผ๊ณ ํ๋๊ตฐ์.. ์๋ก์ด๊ฑฐ ๋ฐฐ์๊ฐ๋๋ค! |
@@ -0,0 +1,126 @@
+package store.view;
+
+import java.text.NumberFormat;
+import store.domain.Product;
+import store.domain.Products;
+import store.dto.PurchaseDTO;
+import store.dto.ReceiptDTO;
+
+public class OutputView {
+ private static final NumberFormat format = NumberFormat.getNumberInstance();
+
+... | Java | ์ด๋ฐ ๋ถ๋ถ์๋ DTO๋ฅผ ๋ฐ์์ ์ฒ๋ฆฌํ๋๊ฑด ์ด๋ป๊ฒ ์๊ฐํ์๋์? |
@@ -0,0 +1,14 @@
+package store.exception;
+
+public class CustomException extends IllegalArgumentException {
+ private final String errorMessage;
+
+ public CustomException(String errorMessage) {
+ super(errorMessage);
+ this.errorMessage = errorMessage;
+ }
+
+ public String getErr... | Java | CustomException ํด๋์ค๋ฅผ ๋ฐ๋ก ๋ง๋์ ์ด์ ๊ฐ ๊ถ๊ธํฉ๋๋ค (์ด ๋ถ๋ถ์ ์ ๋ชฐ๋ผ์). |
@@ -0,0 +1,57 @@
+package store.view;
+
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import store.contant.Constant;
+import store.dto.BuyDTO;
+import store.exception.CustomException;
+import store.excep... | Java | Matcher.results()๋ก ๋๋๋๊ฑด ๊น๋ํ์ง๋ง ํ๋ชฉ์ ๋๋๋ ๊ตฌ๋ถ์๋ก ์ผํ๊ฐ ์๋์ด๋ ์๋ํด์, ์๊ตฌ์ฌํญ์ ๋ง์ถ๋ ค๋ฉด ์์ ํด์ผ ํ ๊ฒ ๊ฐ์์. |
@@ -0,0 +1,83 @@
+package store.view;
+
+import camp.nextstep.edu.missionutils.Console;
+import java.util.List;
+import store.contant.Constant;
+import store.dto.BuyDTO;
+import store.exception.CustomException;
+import store.exception.ErrorMessage;
+
+public class InputView {
+ public static List<BuyDTO> r... | Java | validate() ๋ค์ด๋ฐ์ด ์กฐ๊ธ ๋ ๊ตฌ์ฒด์ ์ด๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค. |
@@ -0,0 +1,108 @@
+package store.controller;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.time.LocalDateTime;
+import java.util.List;
+import org.junit.platform.commons.logging.Logger;
+import org.junit.platform.commons.logging.LoggerFactory;
+import sto... | Java | ์ปจํธ๋กค๋ฌ์ ์์ฑ์๋ run ๋ถ๋ถ์ด ์ ๋ง ๊น๋ํ๊ณ ์ข์ ๊ฒ ๊ฐ์์! |
@@ -0,0 +1,206 @@
+package store.domain;
+
+import camp.nextstep.edu.missionutils.DateTimes;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import store.contant.Constant;
+import store.dto.BuyDTO;
+import store.dto.ProductsDTO;
+import store.dto.PurchaseDTO... | Java | InputView๋ฅผ ํธ์ถํ๋ ๋ถ๋ถ์ ์ปจํธ๋กค๋ฌ๋ฅผ ๊ฑฐ์น๋๊ฒ ์ข์ง ์์๊น ์๊ฐํฉ๋๋ค. |
@@ -0,0 +1,35 @@
+package store.dto;
+
+import java.util.List;
+
+public record ReceiptDTO(
+ List<PurchaseDTO> cart,
+ List<PurchaseDTO> free
+) {
+ public int getTotalQuantity() {
+ return cart.stream()
+ .mapToInt(PurchaseDTO::quantity)
+ .sum();
+ ... | Java | 0.3์ ์ค์ํ ์ซ์๋ผ ์์๋ก ๋ฐ๊พธ๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค! |
@@ -0,0 +1,126 @@
+package store.view;
+
+import java.text.NumberFormat;
+import store.domain.Product;
+import store.domain.Products;
+import store.dto.PurchaseDTO;
+import store.dto.ReceiptDTO;
+
+public class OutputView {
+ private static final NumberFormat format = NumberFormat.getNumberInstance();
+
+... | Java | ๊ฐ์๊ฐ 0์ด์ด๋ ์ถ๋ ฅ์ด ๋๋๋ฐ, 0์ผ๋ ์ถ๋ ฅ์์ ์ ์ธ์ํค๋ ๊ฒ๋ ์ข์ ๊ฒ ๊ฐ์ต๋๋ค. |
@@ -0,0 +1,108 @@
+package store.controller;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.time.LocalDateTime;
+import java.util.List;
+import org.junit.platform.commons.logging.Logger;
+import org.junit.platform.commons.logging.LoggerFactory;
+import sto... | Java | ์ด๋ ๊ฒ ๋๋ฉด ํ๋ก๋ชจ์
๊ธฐ๊ฐ์ ์ข
๋ฃ๋ ์ง๊ฐ ์ฌ์ค ํฌํจ์ด ์๋์ด์ (์ข
๋ฃ๋ ์ง๋ก ๋์ด๊ฐ๋ 00์ 00๋ถ 00์ด ๊น์ง๋ง ํฌํจ๋๋๋ผ๊ตฌ์),
endDate.plusDays(1) ์ .atStartOfDay() ๋ฅผ ์ฌ์ฉํ๋๊ฒ ๋ ๋ง๋ค๊ณ ์๊ฐํฉ๋๋ค. |
@@ -0,0 +1,31 @@
+package dto;
+
+import domain.car.Car;
+
+import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
+
+import static util.Splitter.BLANK;
+
+public class CarDto {
+ private String name;
+ private List<String> whiteSpaceList;
+
+ public CarDto(Car car) {
+... | Java | carDto์ position์ ์์ฑ์์์ whiteSpaceList ๋ง๋๋ ๊ฑธ ์ ์ธํ๊ณค ์ฐ๋๋ฐ๊ฐ ์๋ ๊ฒ ๊ฐ์๋ฐ, carDto์์ ๋นผ๋ ๊ฑด ์ด๋ป๊ฒ ์๊ฐํ์๋์? |
@@ -1,79 +1,83 @@
<!DOCTYPE html>
<html>
+
<head>
-<meta charset="UTF-8">
-<title>๋ ์ด์ค!</title>
+ <meta charset="UTF-8">
+ <title>๋ ์ด์ค!</title>
-<!-- Latest compiled and minified CSS -->
-<link rel="stylesheet"
- href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
- integrity="sha384-B... | Unknown | ์ด ๋ถ๋ถ์ ์ด๋ป๊ฒ ํ ๊น ๊ณ ๋ฏผํ๋ค๊ฐ..๊ทธ๋ฅ ๋ฌธ๊ตฌ๋ฅผ ์์ ํ๋๋ฐ, ์ด ๋ถ๊ธฐ๋ฌธ ๋ฃ๋ ๊ฒ๋ ์๊ฐํด๋ด์ผ๊ฒ ๋ค์๐ |
@@ -0,0 +1,79 @@
+package view;
+
+import domain.car.Car;
+import domain.game.RacingGame;
+import domain.game.Track;
+import domain.random.RandomGenerator;
+import domain.strategy.RandomMovingStrategy;
+import dto.CarDto;
+import dto.RacingGameRequestDto;
+import spark.Route;
+import util.Splitter;
+
+import java.util.... | Java | ๊ฒ์์์์ ํ์ํ input๊ณผ ๊ฒฐ๊ณผ๊ฐ์ธ result๋ฅผ ๊ฐ์ ธ์ค๋ ๋ก์ง์ ๋ฉ์๋๋ก ๋ถ๋ฆฌํ๋ฉด ๋ ๊น๋ํด ์ง๊ฑฐ ๊ฐ์์ |
@@ -0,0 +1,79 @@
+package view;
+
+import domain.car.Car;
+import domain.game.RacingGame;
+import domain.game.Track;
+import domain.random.RandomGenerator;
+import domain.strategy.RandomMovingStrategy;
+import dto.CarDto;
+import dto.RacingGameRequestDto;
+import spark.Route;
+import util.Splitter;
+
+import java.util.... | Java | ๋ฉ์๋๋ฅผ ๋ถํดํด๋ ์ข์๊ฒ ๊ฐ์ต๋๋ค ๐ ! |
@@ -0,0 +1,25 @@
+import view.WebRacingHandler;
+
+import java.util.HashMap;
+
+import static spark.Spark.*;
+import static util.RenderUtil.render;
+
+public class WebMain {
+ public static final int PORT = 8080;
+ private static WebRacingHandler webRacingHandler = new WebRacingHandler();
+
+ public static voi... | Java | ํ, ๋ณ๊ฑด์๋๋ฐ `post`๊ฐ ์๊ตฌ์ฌํญ์ด์์ต๋๋ค ๐ |
@@ -0,0 +1,79 @@
+package view;
+
+import domain.car.Car;
+import domain.game.RacingGame;
+import domain.game.Track;
+import domain.random.RandomGenerator;
+import domain.strategy.RandomMovingStrategy;
+import dto.CarDto;
+import dto.RacingGameRequestDto;
+import spark.Route;
+import util.Splitter;
+
+import java.util.... | Java | ์๊ฑด ๋ฐํ๊ฐ์ด ๋ฐ๋ก ์๋์ด์ ๊ฐ ์์๊น์ ?
`getTracks()`๋ ๋ฉ์๋๊ฐ ๋ฐ๋ก์์ด์์! |
@@ -0,0 +1,79 @@
+package view;
+
+import domain.car.Car;
+import domain.game.RacingGame;
+import domain.game.Track;
+import domain.random.RandomGenerator;
+import domain.strategy.RandomMovingStrategy;
+import dto.CarDto;
+import dto.RacingGameRequestDto;
+import spark.Route;
+import util.Splitter;
+
+import java.util.... | Java | ํด๋น ์์ญ์ ๋ถ๋ฆฌํ๋ฉด ์ข์ ๊ฒ ๊ฐ์์! |
@@ -0,0 +1,25 @@
+package com.example.chatgptcodereviewtest.controller;
+
+import com.example.chatgptcodereviewtest.dto.InputDto;
+import com.example.chatgptcodereviewtest.service.TestService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * ์ค๋ช
:
+ *
+ * @author ์ตํ๋ฒ(J... | Java | ์ ์ฝ๋ ์กฐ๊ฐ์์๋ `TestController` ํด๋์ค๋ฅผ ์ ์ํ๊ณ ์์ผ๋ฉฐ, ํด๋น ์ปจํธ๋กค๋ฌ์ `convertText` ๋ฉ์๋๋ `InputDto` ๊ฐ์ฒด๋ฅผ ๋ฐ์๋ค์ฌ `testService`์์ `addAgeAndNameLength` ๋ฉ์๋๋ฅผ ํธ์ถํ ๊ฒฐ๊ณผ๋ฅผ ๋ฐํํฉ๋๋ค.
์ด ์ฝ๋ ์กฐ๊ฐ์ ๋ํ ์ฃผ์ ๊ฐ์ ์ ์์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค:
1. ์ปจํธ๋กค๋ฌ์ ์๋น์ค ํด๋์ค์ ์ด๋ฆ์ ๋ ๋ช
ํํ๊ฒ ๋ํ๋ผ ์ ์๋๋ก ๋ณ๊ฒฝํ๋ ๊ฒ์ด ์ข์ต๋๋ค.
2. ์ปจํธ๋กค๋ฌ์์ ์ฌ์ฉ๋ ๊ฒฝ๋ก๋ช
(`"/test"`) ๋ฐ HTTP ๋ฉ์๋(`@PostMapping`)์ ๋ํด ์ถฉ๋ถํ ์ค๋ช
์ด ์์ผ๋ฏ๋ก API์ ์๋๋ฅผ ๋ ... |
@@ -0,0 +1,22 @@
+package com.example.chatgptcodereviewtest.dto;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.ToString;
+
+/**
+ * ์ค๋ช
:
+ *
+ * @author ์ตํ๋ฒ(Jayce) / hb.choi@dreamus.io
+ * @since 2023/03/23
+ */
+@Getter
+@ToString
+@NoArgsConstructor
+@AllA... | Java | ์ ์ฝ๋๋ lombok ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ด์ฉํด InputDto ํด๋์ค๋ฅผ ์์ฑํ๊ณ ์๋ ๊ฒ์ผ๋ก ๋ณด์
๋๋ค.
๊ฐ์ ์ :
1. ํด๋์ค์ ๋ณ์ ์ด๋ฆ์ ๋ ๋ช
ํํ๊ฒ ์ ์ด์ฃผ๋ฉด ์ข๊ฒ ์ต๋๋ค.
2. Setter๊ฐ ์๊ธฐ ๋๋ฌธ์ name๊ณผ age์ ๋ํ ์ผ๋ถ ์ ๋ณด ๋ณ๊ฒฝ์ด ๋ถ๊ฐ๋ฅํฉ๋๋ค. ๋ฐ๋ผ์, ํด๋น DTO๋ฅผ ์ฌ์ฉํ๋ ํด๋์ค์์ ์ ์ดํ ์ ์๋๋ก Setter ๋ฉ์๋ ์ถ๊ฐ๋ฅผ ๊ณ ๋ คํด๋ณผ ํ์์ฑ์ด ์์ต๋๋ค.
๋ฒ๊ทธ ๊ฐ๋ฅ์ฑ:
ํ์ฌ ํด๋น ์ฝ๋์์ ๋ฒ๊ทธ๋ ๋ณด์ด์ง ์์ต๋๋ค. |
@@ -0,0 +1,20 @@
+package com.example.chatgptcodereviewtest.service;
+
+import com.example.chatgptcodereviewtest.dto.InputDto;
+import org.springframework.stereotype.Service;
+
+/**
+ * ์ค๋ช
:
+ *
+ * @author ์ตํ๋ฒ(Jayce) / hb.choi@dreamus.io
+ * @since 2023/03/23
+ */
+@Service
+public class TestService {
+
+ public int... | Java | ์์ ์ฝ๋ ๋ฆฌ๋ทฐ์ ๋ํ ์ ์๊ฐ์
๋๋ค.
๊ธฐ๋ฅ์ ์ผ๋ก ๋ฌธ์ ๊ฐ ์์ด ๋ณด์ด๋ฉฐ, ์ถ๊ฐ ๊ฐ์ ์ฌํญ์ ์์ต๋๋ค. ๊ทธ๋ฌ๋ ๋ช ๊ฐ์ง ์์ ์์ ์ฌํญ์ ์ ์ํด ๋๋ฆฌ๊ฒ ์ต๋๋ค:
- ์ฃผ์์ด ์์ธํ์ง ์์ ๋ณ๊ฒฝ ๋ ํ๋ก์ ํธ์ ๋ํด ์ถฉ๋ถํ ์ค๋ช
์ ์ ๊ณตํ์ง ์์ต๋๋ค. ๋ฉ์๋ ์ด๋ฆ 'addAgeAndNameLength' ์์ฒด๊ฐ ๊ธฐ๋ฅ์ ์ค๋ช
ํ๋ ๋ฐ ๋งค์ฐ ํฌ๊ด์ ์
๋๋ค. ์ข ๋ ๊ตฌ์ฒด์ ์ธ ๋ฉ์๋ ๋ฐ ํด๋์ค ์ค๋ช
๊ณผ ํจ๊ป ์ฃผ์์ ์ถ๊ฐํ๋ ๊ฒ์ด ์ข์ต๋๋ค.
- ๋ชจ๋ ์์ธ๋ฅผ ์ฒ๋ฆฌ ํ ์ ์๋๋ก try-catch ๋ธ๋ก์ ์ถ๊ฐํ ์ ์์ต๋๋ค.
์์ธกํ ์์๋ ๊ฐ์ ์ ๋ฌํ์ฌ ์ถ๋ ฅ ๊ฐ์ด ์์๊ฐ๋๋ ๊ฒฝ์ฐ ๋ฑ ์ํ์ฑ์ด ... |
@@ -0,0 +1,39 @@
+package nextstep.auth.authentication;
+
+import nextstep.member.application.UserDetailsService;
+import nextstep.member.domain.User;
+import org.springframework.web.servlet.HandlerInterceptor;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java... | Java | ์๋ ์๊ตฌ์ฌํญ์ด ๋ฐ์๋์ง ์์ ๊ฒ ๊ฐ์์ ๐ข
<img width="516" alt="แแ
ณแแ
ณแ
แ
ตแซแแ
ฃแบ 2022-08-16 แแ
ฉแแ
ฎ 10 07 08" src="https://user-images.githubusercontent.com/17218212/184886987-febc108f-8b2f-403b-a53e-bf36f069cc24.png"> |
@@ -1,51 +1,45 @@
package nextstep.auth.token;
import com.fasterxml.jackson.databind.ObjectMapper;
-import nextstep.auth.authentication.AuthenticationException;
-import nextstep.member.application.LoginMemberService;
-import nextstep.member.domain.LoginMember;
+import nextstep.auth.authentication.AuthenticationToke... | Java | `ObjectMapper` ๋ ์์ฑ ๋น์ฉ์ด ๋น์ธ๋ค๊ณ ์๋ ค์ง ๊ฐ์ฒด์
๋๋ค. ์์กด์ฑ ์ฃผ์
์ ํตํด ํด๊ฒฐํด๋ณผ ์ ์์๊น์? ๐ |
@@ -0,0 +1,8 @@
+package nextstep.member.application;
+
+import nextstep.member.domain.User;
+
+public interface UserDetailsService {
+
+ User loadUserByUsername(String email);
+} | Java | ์ด ์ธํฐํ์ด์ค๊ฐ `member` ํจํค์ง์ ์๋๊ฒ ๋ง์๊น์? ๐ค |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.