code stringlengths 41 34.3k | lang stringclasses 8
values | review stringlengths 1 4.74k |
|---|---|---|
@@ -1,22 +1,36 @@
package codesquad;
-import codesquad.repository.ArrayUserRepository;
+import codesquad.repository.QuestionRepositoryImpl;
+import codesquad.repository.UserRepositoryImpl;
+import codesquad.repository.QuestionRepository;
import codesquad.repository.UserRepository;
+import codesquad.service.Question... | Java | ์์กด์ฑ ์ฃผ์
์ ์คํ๋ง์ด ์์์ ํด์ฃผ๋ ๋ถ๋ถ์
๋๋ค ~
์คํ๋ง ๋ถํธ์ DI ๋ฐฉ์์ ๋ํด ์์๋ณด๋ฉด ์ข์ ๊ฒ ๊ฐ์์ |
@@ -0,0 +1,74 @@
+package codesquad.controller;
+
+import codesquad.AppConfig;
+import codesquad.dto.question.QuestionRequestDto;
+import codesquad.dto.question.QuestionResponseDto;
+import codesquad.entity.QuestionEntity;
+import codesquad.mapper.QuestionMapper;
+import codesquad.service.QuestionService;
+import org.s... | Java | ์คํ๋ง๋ถํธ์์ ์์ฑ์ ์ฃผ์
์ ํ๋ ๋ฐฉ๋ฒ์ ๋ํด ๊ฒ์ํด๋ณด์๋ฉด ์ข์ ๊ฒ ๊ฐ์์ |
@@ -0,0 +1,45 @@
+package codesquad.mapper;
+
+import codesquad.dto.question.QuestionRequestDto;
+import codesquad.dto.question.QuestionResponseDto;
+import codesquad.entity.QuestionEntity;
+
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+
+public class QuestionMapper {
+
+ public stat... | Java | ๋ณ์๋ private ์ผ๋ก ์ ์ธํ๊ณ setter ๋ฅผ ์ฌ์ฉํด์ ์ ๊ทผํ๋๊ฒ ์๋ฐ์ ์ผ๋ฐ์ ์ธ ์์น์
๋๋ค ~ |
@@ -0,0 +1,24 @@
+package codesquad.entity;
+
+import lombok.*;
+
+@Setter
+@Getter
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class QuestionEntity extends BaseTimeEntity {
+
+ private String writer;
+ private String title;
+ private String contents;
+
+ @Override
+ public String toString... | Java | Entity ๋ผ๋ postfix ๋ฅผ ๋ถ์ด์ง ์์๋ ๋ ๊ฒ ๊ฐ์ต๋๋ค ~ |
@@ -1,22 +1,36 @@
package codesquad;
-import codesquad.repository.ArrayUserRepository;
+import codesquad.repository.QuestionRepositoryImpl;
+import codesquad.repository.UserRepositoryImpl;
+import codesquad.repository.QuestionRepository;
import codesquad.repository.UserRepository;
+import codesquad.service.Question... | Java | ์ ์ด์ ์ญ์ (IoC)๊ฐ ๋ฌด์์ธ์ง๋ ํ ๋ฒ ์์๋ณด์๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค! |
@@ -0,0 +1,30 @@
+package codesquad.service;
+
+import codesquad.entity.QuestionEntity;
+import codesquad.repository.QuestionRepository;
+
+import java.util.List;
+
+public class QuestionServiceImpl implements QuestionService {
+ private final QuestionRepository questionRepository;
+
+ public QuestionServiceImpl(... | Java | > > ์ํฐํฐ๋ฅผ ์ด์ฉํด ๋ฐ์ดํฐ๋ฅผ ์ฃผ๊ณ ๋ฐ์ผ๋ฉด ์ด๋ค ๋ฌธ์ ๊ฐ ์์์ง ๊ณ ๋ฏผํด๋ณด์๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค!
>
> ๋ค! ํ๋ฒ ๊ณ ๋ฏผํด๋ณด๊ฒ ์ต๋๋ค~ ํน์ ์์ฝ๋์ด ๋ง์ํ์ ๋ฐ์ดํฐ๋ฅผ ์ฃผ๊ณ ๋ฐ๋ ๋ถ๋ถ์ view(controller)์ ์ฃผ๊ณ ๋ฐ๋๋ค๋ ๋ง์์ด์ค๊น์?
์ปจํธ๋กค๋ฌ ๋ฟ ์๋๋ผ ๋ ์ด์ด๋ ์ํคํ
์ณ์์ ๊ฐ ๊ณ์ธต๊ฐ์ ๋ฐ์ดํฐ๋ฅผ ์ฃผ๊ณ ๋ฐ๋ ๊ฒ์ ์๋ฏธํฉ๋๋ค! |
@@ -7,6 +7,8 @@
public interface UserRepository {
void register(UserEntity userEntity);
+ void update(String userId, UserEntity userEntity);
+
UserEntity findById(String userId);
List<UserEntity> findAll(); | Java | > dto <-> entity ์ฌ์ด์ ๋งตํ์ ์ด๋์ ํด์ผํ ์ง ๊ณ ๋ฏผ์ ํ๋๋ฐ์. DTO๋ ์ปจํธ๋กค๋ฌ ๋ ์ด์ด์ ์ข
์๋์ด์ผ ํ๋ค๊ณ ์๊ฐํด ๋งตํ์ ๊ด๋ จ๋ ๊ฒ์ ๋ชจ๋ ์ปจํธ๋กค๋ฌ์์ ๋๋ ค๊ณ ํ์์ต๋๋ค.
>
> update()์ ๋ํ ๋ถ๋ถ์ ํผ๋๋ฐฑ์ ๋ณด๊ณ ๋ค์ ๋ณด๋, ์๋ก์ด userEntity๋ฅผ ์์ฑํ๋ register์ ๋ค๋ฅด๊ฒ ๊ธฐ์กด์ ์๋ userEntity๋ฅผ ์์ ํ๋ ๊ฒ์ด๋ค๋ณด๋ ๊ฐ์ updateํ๋ ๋ฐฉํฅ์ ์ง์คํ์ต๋๋ค. ๊ทธ๋ฌ๋ค๋ณด๋ DTO -> Entity๋ ์๋กญ๊ฒ ๊ฐ์ฒด๋ฅผ ๋ง๋ ๋ค๋ ์๊ฐ์ ๊ฑฐ์น์ง ์์๋ค์.๐
>
> ๋ค์๋ณด๋ register() ์ฒ๋ผ controller์... |
@@ -7,6 +7,8 @@
public interface UserRepository {
void register(UserEntity userEntity);
+ void update(String userId, UserEntity userEntity);
+
UserEntity findById(String userId);
List<UserEntity> findAll(); | Java | @saint6839
์ ๋ service(application or usecase), domain ์ ์ธ๋ถ์ ๊ฒ์ผ๋ก๋ถํฐ ๋
๋ฆฝ์ ์ด๊ณ ์ต๋ํ ์์ํ ์๋ต์ ๋ณด๋ด์ผ ์ฌ์ฉ์ฑ์ด ์ข์์ง๋ค๊ณ ์๊ฐํฉ๋๋ค.
๋ฐ๋ผ์ service ๋ ์ด์ด์์๋ ์ธ๋ถ ์๊ตฌ์ฌํญ์ ํด๋นํ๋ ๋ฐ์ดํฐ ๊ตฌ์กฐ์ธ dto ๋ณํ์ ์ง์ํ๋๋ก ๊ฐ๋ฐํ๋ ํธ์
๋๋ค. ์ค์ ์๋น์ค์์ ๊ฐ๋ฐํ๋ค๋ณด๋ฉด 1controller - 1service ๊ฐ ์๋๋ผ n๊ฐ์ controller ์ผ์ด์ค์์ ์๋ก ๋ค๋ฅธ ๋ชฉ์ ์ผ๋ก 1service ๋ฅผ ํธ์ถํ๋ ์ผ์ด์ค๋ ์์ผ๋ ๊ฐ์๊ฐ ํ์ํ ๋ฐ์ดํฐ๊ฐ ๋ค๋ฅผ ๊ฒฝ์ฐ, dto ๊ฐ ๊ณตํต์ผ๋ก ์ฌ์ฉ๋์ด์ ๋ฑ๋ฑํด์ง๊ณ ... |
@@ -0,0 +1,30 @@
+package codesquad.service;
+
+import codesquad.entity.QuestionEntity;
+import codesquad.repository.QuestionRepository;
+
+import java.util.List;
+
+public class QuestionServiceImpl implements QuestionService {
+ private final QuestionRepository questionRepository;
+
+ public QuestionServiceImpl(... | Java | ์์ง 1๋จ๊ณ๋ผ์ ์ด๋ฐ ๋ถ๋ถ์ ๋ํ ์ฝ๋ฉํธ๋ ์ข ๋ ์น์ ํ ์ค๋ช
ํด์ฃผ์ด๋ ์ข์ ๊ฒ ๊ฐ์ต๋๋ค. |
@@ -0,0 +1,24 @@
+package codesquad.entity;
+
+import lombok.*;
+
+@Setter
+@Getter
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class QuestionEntity extends BaseTimeEntity {
+
+ private String writer;
+ private String title;
+ private String contents;
+
+ @Override
+ public String toString... | Java | @hyukjin-lee class๋ช
๋ง์ํ์ค๊น์?? |
@@ -0,0 +1,74 @@
+package codesquad.controller;
+
+import codesquad.AppConfig;
+import codesquad.dto.question.QuestionRequestDto;
+import codesquad.dto.question.QuestionResponseDto;
+import codesquad.entity.QuestionEntity;
+import codesquad.mapper.QuestionMapper;
+import codesquad.service.QuestionService;
+import org.s... | Java | > applicationcontext๋ก๋ถํฐ ์ง์ ๋น์ ๊ฐ์ ธ์ค์
์ ์ฌ์ฉํ์ ์ด์ ๊ฐ ๊ถ๊ธํฉ๋๋ค!
questionService๋ ๋ค์๊ณผ ๊ฐ์ด ์์ฑ์๋ฅผ ํตํด ์ฃผ์
๋์์ต๋๋ค.
**AppConfig**
```java
@Bean
public QuestionService questionService() {
return new QuestionServiceImpl(questionRepository());
}
@Bean
public QuestionRepository questionRepository() {
return new Questio... |
@@ -0,0 +1,45 @@
+package codesquad.mapper;
+
+import codesquad.dto.question.QuestionRequestDto;
+import codesquad.dto.question.QuestionResponseDto;
+import codesquad.entity.QuestionEntity;
+
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+
+public class QuestionMapper {
+
+ public stat... | Java | @hyukjin-lee ๋ต!!! ๊ธฐ์ตํ๊ฒ ์ต๋๋ค. ์ด๋ฒ์๋ ๋ณ๊ฒฝ ๊ฐ๋ฅ์ฑ์ ์ด์ด๋๋ setter ์ฌ์ฉ์ ์ง์ํ๊ณ , ํ์ํ ๋ฐ์ดํฐ๋ง ์ค์ ํ๊ณ ์ถ์ด Builder ํจํด์ ์ฌ์ฉํด๋ณด์์ต๋๋ค~ |
@@ -1,158 +1,89 @@
package codesquad.qua;
-import codesquad.answer.Answer;
-import codesquad.answer.AnswerRepository;
-import codesquad.user.User;
-import codesquad.utils.SessionUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
+import co... | Java | Question์ ๋ํ Exception์ customizing ํ ์ด์ ์
๋๋ค
QuestionEditException์ ํด๋น ์ง๋ฌธ์๊ฐ ์๋๊ธฐ ๋๋ฌธ์ ์ญ์ ํ ์ ์๋ ๊ฒฝ์ฐ,
QuestionDeleteException์ ๋ค๋ฅธ User์ ๋ต๊ธ์ด ์กด์ฌํ์ฌ ์ญ์ ํ ์ ์๋ ๊ฒฝ์ฐ์
๋๋ค
์ฒ์์๋ boolean์ผ๋ก ์ฒ๋ฆฌํ๋ ค๋ค๊ฐ ๋ ๊ฐ์ง ๊ฒฝ์ฐ๊ฐ ์๊ฒ ๋์ด(=๋ ๊ฐ์ง view)
exception์ ๋ง๋ค์์ต๋๋ค |
@@ -1,10 +1,15 @@
package codesquad.user;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+
import javax.persistence.*;
import java.util.Objects;
@Entity
+@NoArgsConstructor
+@Getter
public class User {
@Id
@@ -20,43 +25,14 @@ public class User {
private String email;
- public Str... | Java | ์ ๋ฒ์ ๋ง์ํด์ฃผ์ equals์ ๋ํ ๋ฆฌ๋ทฐ ์๊ฐํด๋ดค์ต๋๋ค
๋ง์๋๋ก ๊ด๊ณํ DB์์๋ "์๋ณ์(id)" ๊ฐ ๊ณ ์ ํ ๊ฐ์ผ๋ก, ํด๋น ์๋ณ์๊ฐ ๋์ผํ๋ค๋ฉด ๊ฐ์ ๋ฐ์ดํฐ๋ผ๊ณ ์ธ์ํ๋๋ฐ equals๋ฅผ overridingํ๋ค๋ฉด ๋ชจ๋ ํ๋์ ๊ฐ์ด ๋์ผํด์ผ ๊ฐ์ ๊ฐ์ฒด๋ผ๊ณ ํ๋จํฉ๋๋ค
equals๋ฅผ ๊ตณ์ด overridingํ ํ์์๋ ์ํฉ์์ overriding์ ํ๋ค๋ฉด HashSet์ด๋ HashMap์ ์ํฅ์ ์ฃผ์ด ์์์น ๋ชปํ ์ํฉ์ด ๋ฐ์ํ ์๋ ์์ต๋๋ค
๋ฐ๋ผ์ User๋ฅผ ์๋ณํ๊ธฐ ์ํด์๋ "id"๋ก ์ถฉ๋ถํ๊ธฐ ๋๋ฌธ์ equals๋ฅผ overridingํ์ง ์์๋๋๋ค ๋ผ๋ ... |
@@ -0,0 +1,126 @@
+package codesquad.qua;
+
+import codesquad.answer.Answer;
+import codesquad.exception.QuestionDeleteException;
+import codesquad.exception.QuestionEditException;
+import codesquad.user.User;
+import codesquad.utils.SessionUtil;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j... | Java | canDeleteQuestion์ ์ง๋ฌธ์ ์ญ์ ํ ์ ์๋์ง ํ๋จํ๋ ๋ฉ์๋์
๋๋ค
- ๋ต๊ธ์ด ์์ ๊ฒฝ์ฐ ์ญ์ ๊ฐ๋ฅ
- ๋ต๊ธ์ด ์์ผ๋ ์์ฑ์ ๋ชจ๋ ์ง๋ฌธ ์์ฑ์์ ๊ฐ์ ๊ฒฝ์ฐ ์ญ์ ๊ฐ๋ฅ
ํด๋น ๋ฉ์๋๋ Question์ด ์ญ์ ๋ ์ ์์ด?๋ผ๊ณ ๋ฌป๊ณ , Question์ด ์ญ์ ๋ ์ ์์ด/์์ด๋ฅผ ํ๋จํฉ๋๋ค
๊ทธ๋์ ์ ๋ ์ด ๋ถ๋ถ์ด Question์๊ฒ ๋ฌผ์ด๋ณด๊ณ Question์ด ๊ฒฐ์ ํ๋ ๊ฒ์ด๋ผ๋ ์๊ฐ์ด ๋ค์ด Question ํด๋์ค์ ์์ด์ผํ ๊น๋ผ๋ ์๊ฐ์ ํ์ต๋๋ค.
ํ์ง๋ง ์ด ๋
ผ๋ฆฌ๋ผ๋ฉด ์๋ isQuestionMatchUser(์ง๋ฌธ ์์ฑ์์ ๋ก๊ทธ์ธ ๋ User๊ฐ ๊ฐ์์ง ํ๋จ... |
@@ -0,0 +1,62 @@
+package codesquad.answer;
+
+import codesquad.qua.Question;
+import codesquad.qua.QuestionRepository;
+import codesquad.response.Result;
+import codesquad.user.User;
+import codesquad.utils.SessionUtil;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframew... | Java | Answer์ ๋น์ฆ๋์ค ๋ก์ง์ ๋ด๋นํ๋ AnswerService์์ Question๊ด๋ จ ๋ฐ์ดํฐ๊ฐ ํ์ํ ๋ QuestionRepository๋ฅผ ์ง์ ์ฐธ์กฐํ๋ ๋ฐฉ๋ฒ๋ ์์ง๋ง, QuestionService๋ฅผ ํตํด ์ฐธ์กฐํ๋๋ก ํ ์๋ ์์ ๊ฑฐ ๊ฐ์๋ฐ ์ด๋ค ์ฐจ์ด๊ฐ ์์๊น์? |
@@ -0,0 +1,62 @@
+package codesquad.answer;
+
+import codesquad.qua.Question;
+import codesquad.qua.QuestionRepository;
+import codesquad.response.Result;
+import codesquad.user.User;
+import codesquad.utils.SessionUtil;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframew... | Java | Answer๋ฅผ db์์ ์กฐํํ๋ ๋ก์ง ๋ค์ ์ธ์
์ ์ ์ฒดํฌ๊ฐ ์ด๋ค์ง๊ณ ์์ต๋๋ค. ๊ฐ์ ํ ์ ์ด ์์ด๋ณด์ด๋๋ฐ ์ด๋ป๊ฒ ์๊ฐํ์๋์? |
@@ -0,0 +1,27 @@
+package codesquad.answer;
+
+import codesquad.response.Result;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpSession;
+
+@RestController
+@RequiredArgsConstructor
+@Slf4j
+public class ApiA... | Java | ์ด ์์ฒญ์ ์๋ต ์ํ์ฝ๋๋ ์ด๋ป๊ฒ ๋๊ฐ๊น์? |
@@ -0,0 +1,126 @@
+package codesquad.qua;
+
+import codesquad.answer.Answer;
+import codesquad.exception.QuestionDeleteException;
+import codesquad.exception.QuestionEditException;
+import codesquad.user.User;
+import codesquad.utils.SessionUtil;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j... | Java | 1. Service๊ฐ์ฒด๊ฐ HttpSession๋ฅผ ์์์ผํ ํ์๊ฐ ์์๊น์?
2. ํ์ฌ ์์ฒญ์ ๋ํ ์ธ์
์ ๋ณด๊ฐ ์กด์ฌํ๋์ง ํ๋จํ๋ ๋ฉ์๋๋ก ๋ณด์ด๋๋ฐ, ํ์ฌ ๋ฉ์๋๋ช
์ด ์ค์ ์ญํ ์ ์ถฉ๋ถํ ์ค๋ช
ํ์ง ๋ชปํ๋ ๊ฒ ๊ฐ์ต๋๋ค. |
@@ -0,0 +1,126 @@
+package codesquad.qua;
+
+import codesquad.answer.Answer;
+import codesquad.exception.QuestionDeleteException;
+import codesquad.exception.QuestionEditException;
+import codesquad.user.User;
+import codesquad.utils.SessionUtil;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j... | Java | ์ธ์
์ ์ ์ ์ ๋ณด๊ฐ ํฌํจ๋์ผ๋งํ๋ ๋ชจ๋ ๋ฉ์๋์์ ํด๋น ๋ก์ง์ด ์์ฑ๋๊ณ ์๋๋ฐ ์ด๋ป๊ฒ ํ๋ฉด ์ค๋ณต์ ์ค์ผ ์ ์์๊น์? |
@@ -0,0 +1,126 @@
+package codesquad.qua;
+
+import codesquad.answer.Answer;
+import codesquad.exception.QuestionDeleteException;
+import codesquad.exception.QuestionEditException;
+import codesquad.user.User;
+import codesquad.utils.SessionUtil;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j... | Java | ๋ฉ์๋๋ช
์ ๋ณด๊ณ Question์ ๋ํ ๋น์ฆ๋์ค๋ก์ง์ ์ํํ๋ ๊ฐ์ฒด์์ Form๊น์ง ๊ด์ฌํ๋ ๊ฑด๊ฐ๋ผ๋ ์๊ฐ์ด ๋ค์์ต๋๋ค. |
@@ -0,0 +1,126 @@
+package codesquad.qua;
+
+import codesquad.answer.Answer;
+import codesquad.exception.QuestionDeleteException;
+import codesquad.exception.QuestionEditException;
+import codesquad.user.User;
+import codesquad.utils.SessionUtil;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j... | Java | ์ ๋ ์ฝ๋ ์ฌ์ฌ์ฉ์ฑ ์ธก๋ฉด์์ ์๊ฐํด๋ดค์ ๋ ์ด ๋ก์ง์ด ํด๋น Service์์๋ง ์ฌ์ฉ๋๋ ๊ฑฐ๋ผ๋ฉด Question์ด ๋ฌด๊ฑฐ์์ง๋ ๊ฒ์ ๊ณ ๋ คํด์ Service์์ ๋ด๋นํ๋๋ก ๊ตฌํํ ๊ฒ ๊ฐ์ต๋๋ค. ๋ฐ๋ฉด ์ด Service๋ฅผ ๋ฒ์ด๋ ์์ญ์์๋ ์ฌ์ฉ๋๋ ๋ก์ง์ด๋ผ๋ฉด Question์์ ๋ด๋นํ๋ ๊ฒ์ด ์ค๋ณต์ ์ค์ด๋ ๋ฐฉ๋ฒ์ด์ง ์์๊น ์๊ฐํฉ๋๋ค! |
@@ -0,0 +1,62 @@
+package codesquad.answer;
+
+import codesquad.qua.Question;
+import codesquad.qua.QuestionRepository;
+import codesquad.response.Result;
+import codesquad.user.User;
+import codesquad.utils.SessionUtil;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframew... | Java | ResponseAnswerDto๋ฅผ Result๋ก ํ๋ฒ ๋ ๊ฐ์ธ๋ ๋ฐฉ์์ผ๋ก ๊ตฌํํ์
จ๋๋ฐ ์ด๋ค ์ด์ ๊ฐ ์์๊น์? |
@@ -1,158 +1,89 @@
package codesquad.qua;
-import codesquad.answer.Answer;
-import codesquad.answer.AnswerRepository;
-import codesquad.user.User;
-import codesquad.utils.SessionUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
+import co... | Java | ์ด๋ฏธ ๋ณด์
จ์ ์๋ ์์ง๋ง ํ๋ฒ ์ฝ์ด๋ณด์๋ฉด ์ข์ ๊ฑฐ ๊ฐ์ ๊ณต์ ๋๋ฆฝ๋๋ค!
https://tecoble.techcourse.co.kr/post/2020-08-17-custom-exception/ |
@@ -1,158 +1,89 @@
package codesquad.qua;
-import codesquad.answer.Answer;
-import codesquad.answer.AnswerRepository;
-import codesquad.user.User;
-import codesquad.utils.SessionUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
+import co... | Java | ์ค ๋ง์ต๋๋ค ์ ๋ ์ฌ์ฉ์ ์ ์ ์์ธ๋ฅผ ์ฌ์ฉํ๊ธฐ ์ ์ ์ฌ๋ ค์ฃผ์ ๋งํฌ๋ฅผ ๋ดค์ต๋๋ค.
๋งํฌ์ ๋ํด์ ๋ณด๋ฉด ๊ตณ์ด ๋๋ ํ์ ์์ด, IllegalArgumentException, IllegalstateException์ ๋ฐ๋ผ ๋ค๋ฅธ ๋ทฐ๋ฅผ ๋ณด์ฌ์ค ์ ์์ง๋ง, ์ด๋๋ ๋ช
์์ ์ผ๋ก ๋ณด์ฌ์ฃผ๋๊ฒ ๋ซ์ง ์์๊น ๋ผ๋ ์๊ฐ์ ํ์ต๋๋ค |
@@ -0,0 +1,126 @@
+package codesquad.qua;
+
+import codesquad.answer.Answer;
+import codesquad.exception.QuestionDeleteException;
+import codesquad.exception.QuestionEditException;
+import codesquad.user.User;
+import codesquad.utils.SessionUtil;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j... | Java | updateํ๊ธฐ ์ํด์๋ ์กฐ๊ฑด์ด ํ์ํ๋ฐ ์ด ์กฐ๊ฑด์ ๊ฒ์ฆํ๋ ๊ฒ๋ Question์ ๋ํ ๋น์ฆ๋์ค๋ก์ง์ด๋ผ๊ณ ์๊ฐํด์ ์์ฑํ์ต๋๋ค.
ํน์ ๋ฉ์๋๋ช
์ ์์ ํ๋๊ฒ ์ข์๋ณด์ผ ๊ฒ ๊ฐ์ ๋ง์์ด์ค๊น์~~?? |
@@ -0,0 +1,62 @@
+package codesquad.answer;
+
+import codesquad.qua.Question;
+import codesquad.qua.QuestionRepository;
+import codesquad.response.Result;
+import codesquad.user.User;
+import codesquad.utils.SessionUtil;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframew... | Java | ์ค,, ์ด ๋ถ๋ถ์ DB ์ ๊ทผ์ ๋ฌด๊ฑฐ์ด ์์
์ด๊ธฐ ๋๋ฌธ์ ์ธ์
์ ์ฒดํฌํ๊ณ ๋์ DB ์ ๊ทผํ๋ ๊ฒ์ด ์ข์๋ณด์
๋๋ค
๊ฐ์ฌํฉ๋๋ค! |
@@ -0,0 +1,62 @@
+package codesquad.answer;
+
+import codesquad.qua.Question;
+import codesquad.qua.QuestionRepository;
+import codesquad.response.Result;
+import codesquad.user.User;
+import codesquad.utils.SessionUtil;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframew... | Java | ์ด ๋ถ๋ถ๋ง ๊ทธ๋ฐ๊ฒ ์๋๋ผ ๋ค๋ฅธ ๊ณณ๋ ๊ทธ๋ ๊ฒ ์์ฑ๋์ด์๋ค์!! |
@@ -0,0 +1,62 @@
+package codesquad.answer;
+
+import codesquad.qua.Question;
+import codesquad.qua.QuestionRepository;
+import codesquad.response.Result;
+import codesquad.user.User;
+import codesquad.utils.SessionUtil;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframew... | Java | ๋ฏธ์
๋ช
์ธ์์ Result๋ฅผ ๋ฐํํ๋ผ๊ณ ํด์ ์ด๋ ๊ฒ ์์ฑํ์ต๋๋ค! |
@@ -0,0 +1,27 @@
+package codesquad.answer;
+
+import codesquad.response.Result;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpSession;
+
+@RestController
+@RequiredArgsConstructor
+@Slf4j
+public class ApiA... | Java | create๋ฉ์๋๋ ์ฑ๊ณต, ์คํจ ์ฌ๋ถ์์ด Result ๋ฅผ ๋ฐํํ๊ธฐ ๋๋ฌธ์ 200 OK๊ฐ ๋๊ฐ ๊ฒ์ด๋ผ๊ณ ์๊ฐํฉ๋๋ค! |
@@ -55,6 +55,7 @@ captures/
.idea/caches
# Keystore files
+keystore.properties
# Uncomment the following line if you do not want to check your keystore files in.
#*.jks
@@ -100,3 +101,6 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk
+app/src/main/java/kr/co/connect/boostcamp/livewhere/ui/bookmark/
+app/src/main... | Unknown | #82 ์์
์ด ์ด๋ค๊ฑด์ง ํ์คํ ๋ฆฌ๊ฐ ์์ด์ ์ ์ถ๊ฐ๋์๋์ง ๋ชจ๋ฅด๊ฒ ๋๋ฐ
1) ๋ณด์๊ณผ ๊ด๋ จ๋์ด ๊ณต์ ๋์ง ์์์ผ ํ๋ ํ์ผ
2) ๊ฐ์ธ๋ณ ํ๊ฒฝ์ค์ ํ์ผ
3) ์บ์ ํ์ผ
4) ์ฐ๋ ๊ธฐ ํ์ผ
๋ฑ์ ์ฌ์ ๊ฐ ์๋๋ผ๋ฉด .gitignore์ ๋ค์ด๊ฐ๋๊ฒ ๋ถ์ ์ ํด ๋ณด์
๋๋ค.
ํด๋น ํด๋๋ฅผ git์์ ์ ๊ฑฐํ๋ ค๋ค ํธ๋ฒ์ ์ด๊ฒ ์๋๊น ์ถ์ธก์ด ๋๋๋ฐ ์ฌ๋ฐ๋ฅด์ง ๋ชปํ ๋ฐฉ๋ฒ์ธ๊ฑฐ ๊ฐ์์. |
@@ -0,0 +1,68 @@
+# ์์ธ ์ด์ด <img width="85" alt="kakaotalk_20190212_204520833" src="https://user-images.githubusercontent.com/22374750/52834626-1efe2080-3126-11e9-92c3-66ac08c1f2c9.png">
+
+
+data class RecentSearchEntity(
+ @PrimaryKey var text: String,
+ @ColumnInfo(name = "Longitude") var lon... | Kotlin | ๋ค๋ฅธ ํ
์ด๋ธ์ ์ปฌ๋ผ๋ค์ ์๋ฌธ์๋ก ์์ํ๋ snake case๋ฅผ ์ฌ์ฉํ๊ณ ์์ต๋๋ค.
ํต์ผ์ด ํ์ํด๋ณด์ฌ์ |
@@ -0,0 +1,13 @@
+package kr.co.connect.boostcamp.livewhere.di
+
+
+val appModules = arrayListOf(
+ apiModule
+ , loginModule
+ , sharedModule
+ , databaseModule
+ , homeModule
+ , mapModule
+ , reverseGeoApiModule
+ , detailModule
+) | Kotlin | ๋ค๋ฅธ ์ฝ๋๋ค๊ณผ ์ ํ ๋ค๋ฅธ code format์ธ๋ฐ ํต์ผ์ด ํ์ํด ๋ณด์
๋๋ค. |
@@ -0,0 +1,24 @@
+package kr.co.connect.boostcamp.livewhere.di
+
+import androidx.room.Room
+import kr.co.connect.boostcamp.livewhere.data.database.AppDataBase
+import org.koin.android.ext.koin.androidContext
+import org.koin.dsl.module.module
+
+const val DATABASE_NAME = "mdatabase.db"
+
+val databaseModule = module {... | Kotlin | ์ด ๋ชจ๋์ ์ ์๋ 3๊ฐ์ง injection๋ค์ named inject๊ฐ ํ์ํ๊ฐ์?
๋ถํ์ํด๋ณด์
๋๋ค. |
@@ -6,25 +6,33 @@ import { css } from '@emotion/react';
import Rating from '@/components/Rating';
import Profile from '../Profile';
import { formatDate } from '@/utils/format';
+import useModalStore from '@/stores/useModalStore';
+import useDeleteReview from '@/hooks/query/useDeleteReview';
+import ConfirmModal from... | Unknown | _:hammer_and_wrench: Refactor suggestion_
**์๋ฌ ์ฒ๋ฆฌ ๋ก์ง ์ถ๊ฐ ํ์**
`handleDelete` ํจ์์์ mutation ์คํจ ์์ ์๋ฌ ์ฒ๋ฆฌ๊ฐ ๋๋ฝ๋์ด ์์ต๋๋ค.
๋ค์๊ณผ ๊ฐ์ด `onError` ํธ๋ค๋ฌ๋ฅผ ์ถ๊ฐํ๋ ๊ฒ์ ์ ์ํฉ๋๋ค:
```diff
const handleDelete = () => {
mutate(
{ reviewId: review.reviewId },
{
onSuccess: () => {
setModalName(null);
},
+... |
@@ -3,7 +3,10 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
- <title>React App</title>
+ <meta name="description" content="Web site created using create-react-app"/>
+ <link href="https://fonts.googleapis.com/css2?family=Lobster&display=s... | Unknown | description์ ์์ด๋ ๋์ง ์์๊น์? ์ ๋ชจ๋ฅด๊ฒ ์ต๋๋ค ใ
ใ
|
@@ -0,0 +1,50 @@
+import React from 'react';
+import { withRouter } from 'react-router-dom';
+import './Login.scss';
+
+
+class LoginJaeyoung extends React.Component {
+ constructor () {
+ super();
+ this.state = {
+ id: '',
+ pw : '',
+ };
+ }
+
+ handleInput = (e) ... | JavaScript | https://www.notion.so/wecode/React-Refactoring-Check-List-aea297cf88ed4601b769e4b2c2cfd4e1#089493d6bfca438aa328226e327cff92
์ด ๋ถ๋ถ์ ์ฐธ๊ณ ํ๋ฉด ํ๋์ ๋ฉ์๋๋กค ๋ฌถ์ ์ ์์ต๋๋ค. |
@@ -0,0 +1,85 @@
+* {
+ box-sizing: border-box;
+}
+
+.loginContainer {
+ border: 2px solid #e6e6e6;
+ width: 350px;
+ height: 380px;
+ margin: 0 auto;
+ .logoName {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ width: 100%;
+ h1 {
+ font-family: "Lobster",... | Unknown | ์ด ๋ถ๋ถ์ common.css์ ์์ผ๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค. |
@@ -0,0 +1,85 @@
+* {
+ box-sizing: border-box;
+}
+
+.loginContainer {
+ border: 2px solid #e6e6e6;
+ width: 350px;
+ height: 380px;
+ margin: 0 auto;
+ .logoName {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ width: 100%;
+ h1 {
+ font-family: "Lobster",... | Unknown | font-family๊ฐ์ ์์ฑ์ width๋ margin์๋์ ์์ผ๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค. |
@@ -0,0 +1,190 @@
+import React from 'react';
+import FeedComponent from './FeedComponent/FeedComponent';
+import './Main.scss';
+import explore from '../../../images/jaeyoungLee/Main/explore.jpg';
+import heart from '../../../images/jaeyoungLee/Main/heart.jpg';
+import profile from '../../../images/jaeyoungLee/Main/pr... | JavaScript | ๋ณ์๋ช
์ด ๋ช
์์ ์ด์ฌ์ ์ข์ ๊ฒ ๊ฐ์ต๋๋ค.! |
@@ -0,0 +1,190 @@
+import React from 'react';
+import FeedComponent from './FeedComponent/FeedComponent';
+import './Main.scss';
+import explore from '../../../images/jaeyoungLee/Main/explore.jpg';
+import heart from '../../../images/jaeyoungLee/Main/heart.jpg';
+import profile from '../../../images/jaeyoungLee/Main/pr... | JavaScript | ```suggestion
inputKeyPress= (e) => {
```
๊ฐ์ ์ด๋ฆ์ ์ด๋จ๊น์? ๋ฉ์๋๊ฐ ๋ง์์ง๋ฉด ํท๊ฐ๋ฆด ์ ์์ ๊ฑฐ ๊ฐ์ต๋๋ค. |
@@ -0,0 +1,412 @@
+* {
+ margin: 0;
+ padding: 0;
+}
+nav {
+ position: fixed;
+ width: 100%;
+ top: 0px;
+ left: 0px;
+ right: 0px;
+ background-color: #fff;
+ border-bottom: 1px solid #dbdbdb;
+ .navcontents {
+ width: 935px;
+ height: 54px;
+ background-color: #fff;
+ margin: 0 auto;
+ ... | Unknown | ```suggestion
.nav_center {
```
๊ฐ์ด ๋์ด์ฐ๊ธฐ๋ฅผ '-'๋ '_'๋ก ํ์ํด์ฃผ๋ฉด ์์ฑ์ฝ๊ธฐ๊ฐ ๋ ์์ํด ์ง ๊ฑฐ ๊ฐ์ต๋๋ค! |
@@ -0,0 +1,412 @@
+* {
+ margin: 0;
+ padding: 0;
+}
+nav {
+ position: fixed;
+ width: 100%;
+ top: 0px;
+ left: 0px;
+ right: 0px;
+ background-color: #fff;
+ border-bottom: 1px solid #dbdbdb;
+ .navcontents {
+ width: 935px;
+ height: 54px;
+ background-color: #fff;
+ margin: 0 auto;
+ ... | Unknown | scss์ nesting์ ๊ต์ฅํ ์ ์ ์ฉํ์ ๊ฒ ๊ฐ์์
์ด๋ฌ๋ฉด ๋์ค์ component๋จ์๋ก ๋๋ ๋ ๋ ํธํ ๊ฒ ๊ฐ์ต๋๋ค! |
@@ -0,0 +1,412 @@
+* {
+ margin: 0;
+ padding: 0;
+}
+nav {
+ position: fixed;
+ width: 100%;
+ top: 0px;
+ left: 0px;
+ right: 0px;
+ background-color: #fff;
+ border-bottom: 1px solid #dbdbdb;
+ .navcontents {
+ width: 935px;
+ height: 54px;
+ background-color: #fff;
+ margin: 0 auto;
+ ... | Unknown | ```suggestion
```
๋น์นธ์ ์ค์ด๋ ๊ฒ๋ ์ข์ ์ต๊ด์ด๋ผ๊ณ ํ๋ค์! |
@@ -0,0 +1,85 @@
+* {
+ box-sizing: border-box;
+}
+
+.loginContainer {
+ border: 2px solid #e6e6e6;
+ width: 350px;
+ height: 380px;
+ margin: 0 auto;
+ .logoName {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ width: 100%;
+ h1 {
+ font-family: "Lobster",... | Unknown | ๋ ๋ํ
์ผํ css ์์ฑ๊ฐ .. ์ฌ์๋ ๋
ธ๊ณ ์ ๊ฒฝ์๋ฅผ..๐๐ป |
@@ -0,0 +1,50 @@
+import React from 'react';
+import { withRouter } from 'react-router-dom';
+import './Login.scss';
+
+
+class LoginJaeyoung extends React.Component {
+ constructor () {
+ super();
+ this.state = {
+ id: '',
+ pw : '',
+ };
+ }
+
+ handleInput = (e) ... | JavaScript | target ๋ณด๋ค๋ ์ง๊ด์ ์ธ ํค๋ค์์ผ๋ก ๋ณ๊ฒฝํ๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค. |
@@ -0,0 +1,85 @@
+* {
+ box-sizing: border-box;
+}
+
+.loginContainer {
+ border: 2px solid #e6e6e6;
+ width: 350px;
+ height: 380px;
+ margin: 0 auto;
+ .logoName {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ width: 100%;
+ h1 {
+ font-family: "Lobster",... | Unknown | - ํ๋์ ์์์ ์ฌ๋ฌ๊ฐ์ง ์์ฑ์ ๋ถ์ฌํ๋ ๊ฒฝ์ฐ ์ค์๋, ๊ด๋ จ๋์ ๋ฐ๋ผ์ ๋๋ฆ์ convention์ ์ง์ผ์ ์์ฑํ๋ ๊ฒ์ด ์ข์ต๋๋ค.
- ์ผ๋ฐ์ ์ธ convention ์ ์๋์ ๊ฐ์ต๋๋ค. ์๋์ ๊ฐ์ด ์์ ์ ์ฉํด์ฃผ์ธ์.
[CSS property ์์]
- Layout Properties (position, float, clear, display)
- Box Model Properties (width, height, margin, padding)
- Visual Properties (color, background, border, box-shadow)
... |
@@ -3,7 +3,10 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
- <title>React App</title>
+ <meta name="description" content="Web site created using create-react-app"/>
+ <link href="https://fonts.googleapis.com/css2?family=Lobster&display=s... | Unknown | meta ํ๊ทธ์ ์ข
๋ฅ๊ฐ ๋ง๊ธฐ ๋๋ฌธ์ ์ด๋ค ๋ฐ์ดํฐ์ธ์ง ๋ช
์ํ๋ ์ฐจ์์์๋ ์๋ ๊ฒ์ด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค! |
@@ -3,7 +3,10 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
- <title>React App</title>
+ <meta name="description" content="Web site created using create-react-app"/>
+ <link href="https://fonts.googleapis.com/css2?family=Lobster&display=s... | Unknown | ๋ถํ์ํ ์ํฐ ์ฒ๋ฆฌ๋ ์ญ์ ํด์ฃผ์ธ์! |
@@ -0,0 +1,50 @@
+import React from 'react';
+import { withRouter } from 'react-router-dom';
+import './Login.scss';
+
+
+class LoginJaeyoung extends React.Component {
+ constructor () {
+ super();
+ this.state = {
+ id: '',
+ pw : '',
+ };
+ }
+
+ handleInput = (e) ... | JavaScript | Import ์์ ์์ ํด์ฃผ์ธ์! ์ผ๋ฐ์ ์ธ convention์ ๋ฐ๋ฅด๋ ์ด์ ๋ ์์ง๋ง ์์๋ง ์ ์ง์ผ์ฃผ์
๋ ๊ฐ๋
์ฑ์ด ์ข์์ง๋๋ค. ์๋ ์์ ์ฐธ๊ณ ํด์ฃผ์ธ์.
- React โ Library(Package) โ Component โ ๋ณ์ / ์ด๋ฏธ์ง โ css ํ์ผ(scss ํ์ผ) |
@@ -0,0 +1,50 @@
+import React from 'react';
+import { withRouter } from 'react-router-dom';
+import './Login.scss';
+
+
+class LoginJaeyoung extends React.Component {
+ constructor () {
+ super();
+ this.state = {
+ id: '',
+ pw : '',
+ };
+ }
+
+ handleInput = (e) ... | JavaScript | ```js
// render ์๋์์
const isBtnAble = idValue.includes('@') && psValue.length > 5;
<button disabled={!isBtnAble} />
```
- ์ด๋ฐ์์ผ๋ก ๋ณ์๋ฅผ ํ์ฉํ๋ฉด ์ข ๋ ๊น๋ํด์ง ์ ์๊ฒ ๋ค์!
- Boolean ๋ฐ์ดํฐ๋ฅผ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ์๋ ๊ตณ์ด true, false ํ์ํด์ค ํ์ ์์ต๋๋ค! (์ผํญ ์ฐ์ฐ์ ์กฐ๊ฑด์ ํด๋น๋๋ ๋ถ๋ถ์ด ์ด๋ฏธ t/f ๊ฐ์ ๊ฐ๊ธฐ ๋๋ฌธ์) |
@@ -0,0 +1,85 @@
+* {
+ box-sizing: border-box;
+}
+
+.loginContainer {
+ border: 2px solid #e6e6e6;
+ width: 350px;
+ height: 380px;
+ margin: 0 auto;
+ .logoName {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ width: 100%;
+ h1 {
+ font-family: "Lobster",... | Unknown | ๊ฐ๋
์ฑ์ ์ํด selector ์ฌ์ด์ ํ ์ค ๋์์ฃผ์๋ฉด ์ข์ต๋๋ค. |
@@ -0,0 +1,85 @@
+* {
+ box-sizing: border-box;
+}
+
+.loginContainer {
+ border: 2px solid #e6e6e6;
+ width: 350px;
+ height: 380px;
+ margin: 0 auto;
+ .logoName {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ width: 100%;
+ h1 {
+ font-family: "Lobster",... | Unknown | ๊ณตํต๋๋ ์์ฑ์ด ๋ง์ด ๋ณด์ด๋ค์! ์ค์ฌ๋ด
์๋ค ๐ ํ๋์ ์์์ ๋ณต์์ className์ ๋ถ์ฌํ ์ ์์ต๋๋ค. |
@@ -0,0 +1,190 @@
+import React from 'react';
+import FeedComponent from './FeedComponent/FeedComponent';
+import './Main.scss';
+import explore from '../../../images/jaeyoungLee/Main/explore.jpg';
+import heart from '../../../images/jaeyoungLee/Main/heart.jpg';
+import profile from '../../../images/jaeyoungLee/Main/pr... | JavaScript | addComment์ ๊ฐ์ด ๊ธฐ๋ฅ์ ์๋ฏธ๊ฐ ๋ค์ด๋๋ ์ด๋ฆ์ผ๋ก ํจ์๋ช
์ ์์ฑํด์ฃผ์ธ์! |
@@ -0,0 +1,190 @@
+import React from 'react';
+import FeedComponent from './FeedComponent/FeedComponent';
+import './Main.scss';
+import explore from '../../../images/jaeyoungLee/Main/explore.jpg';
+import heart from '../../../images/jaeyoungLee/Main/heart.jpg';
+import profile from '../../../images/jaeyoungLee/Main/pr... | JavaScript | - ํด๋น ํ์ผ์ ๋ฐ์ดํฐ๋ฅผ ๋ฐฐ์ด๋ก ๋ง๋ค์ด์ map ํจ์ ์ ์ฉํ๋ฉด ์ข์ ๋ถ๋ถ์ด ๋ง์ด ๋ณด์ด๋ค์! ์ฐ์ ์ด ๊ฒ ๋ถํฐ ์์ ํด๋ณด์๊ธฐ ๋ฐ๋๋๋ค.
- https://www.notion.so/wecode/React-Refactoring-Check-List-aea297cf88ed4601b769e4b2c2cfd4e1#ef5cf308f13f48458f69175875c239e9 |
@@ -0,0 +1,17 @@
+import React from 'react';
+import './CommentComponent.scss';
+
+class CommentComponent extends React.Component {
+ render() {
+ const { key, name, comment} = this.props
+ return (
+ <li className="CommentComponent">
+ {key}
+ <strong>{name}</strong>
+ {comment... | JavaScript | commentList๋ ul ํ๊ทธ๋ฅผ ์๋ฏธํ๋ ๊ฒ ๊ฐ์์ props ์ด๋ฆ์ comment๋ก ํ๋๊ฒ ์ข์ ๊ฒ ๊ฐ์ต๋๋ค. |
@@ -0,0 +1,412 @@
+* {
+ margin: 0;
+ padding: 0;
+}
+nav {
+ position: fixed;
+ width: 100%;
+ top: 0px;
+ left: 0px;
+ right: 0px;
+ background-color: #fff;
+ border-bottom: 1px solid #dbdbdb;
+ .navcontents {
+ width: 935px;
+ height: 54px;
+ background-color: #fff;
+ margin: 0 auto;
+ ... | Unknown | ์ ์ฒด์ ์ผ๋ก camelCase, snake_case ํผ์ฉํด์ ์ฌ์ฉํ๊ณ ๊ณ์ ๋ฐ ๋ค์์๋ ํ์๋ค๊ณผ ์ ํ ๊ท์น๋๋ก ์ ์ฉํด์ฃผ์ธ์! ์ต์ํ ๋ด๊ฐ ์์ฑํ ์ฝ๋ ์์์๋ ์ผ๊ด์ฑ์ด ์์ด์ผ ํฉ๋๋ค. |
@@ -0,0 +1,85 @@
+* {
+ box-sizing: border-box;
+}
+
+.loginContainer {
+ border: 2px solid #e6e6e6;
+ width: 350px;
+ height: 380px;
+ margin: 0 auto;
+ .logoName {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ width: 100%;
+ h1 {
+ font-family: "Lobster",... | Unknown | ๋ต! ์๊ฒ ์ต๋๋ค! |
@@ -3,7 +3,10 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
- <title>React App</title>
+ <meta name="description" content="Web site created using create-react-app"/>
+ <link href="https://fonts.googleapis.com/css2?family=Lobster&display=s... | Unknown | ์ญ์ ํ์ต๋๋ค! ๊ฐ์ฌํฉ๋๋ค |
@@ -0,0 +1,50 @@
+import React from 'react';
+import { withRouter } from 'react-router-dom';
+import './Login.scss';
+
+
+class LoginJaeyoung extends React.Component {
+ constructor () {
+ super();
+ this.state = {
+ id: '',
+ pw : '',
+ };
+ }
+
+ handleInput = (e) ... | JavaScript | ์์ ํ์ต๋๋ค! |
@@ -0,0 +1,50 @@
+import React from 'react';
+import { withRouter } from 'react-router-dom';
+import './Login.scss';
+
+
+class LoginJaeyoung extends React.Component {
+ constructor () {
+ super();
+ this.state = {
+ id: '',
+ pw : '',
+ };
+ }
+
+ handleInput = (e) ... | JavaScript | ์...์์ ํ์ต๋๋ค! |
@@ -0,0 +1,85 @@
+* {
+ box-sizing: border-box;
+}
+
+.loginContainer {
+ border: 2px solid #e6e6e6;
+ width: 350px;
+ height: 380px;
+ margin: 0 auto;
+ .logoName {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ width: 100%;
+ h1 {
+ font-family: "Lobster",... | Unknown | ์์ ํ์ต๋๋ค! ๊ฐ์ฌํฉ๋๋น |
@@ -0,0 +1,190 @@
+import React from 'react';
+import FeedComponent from './FeedComponent/FeedComponent';
+import './Main.scss';
+import explore from '../../../images/jaeyoungLee/Main/explore.jpg';
+import heart from '../../../images/jaeyoungLee/Main/heart.jpg';
+import profile from '../../../images/jaeyoungLee/Main/pr... | JavaScript | ์์ ํ์ต๋๋ค! ๊ฐ์ฌํฉ๋๋ค! |
@@ -0,0 +1,50 @@
+package christmas.domain;
+
+public enum Calendar {
+ WEEKEND(1, 2, 8, 9, 15, 16, 22, 23, 29, 30),
+ WEEKDAY(3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 17, 18, 19, 20, 21, 24, 25, 26, 27, 28, 31),
+ SPECIAL_DAY(3, 10, 17, 24, 25, 31);
+
+ private final int[] days;
+
+ Calendar(int... days) {
+ ... | Java | ๋ ์ง ๊ด๋ จ๋ ๋ก์ง์ `LocalDate`์ `DayOfWeek`๋ฅผ ์ ์ฉํ๋ฉด ํจ์ฌ ๊ฐ๊ฒฐํ๊ฒ ์ฝ๋๋ฅผ ์์ฑํ ์ ์์ต๋๋ค!! |
@@ -0,0 +1,50 @@
+package christmas.domain;
+
+public enum Calendar {
+ WEEKEND(1, 2, 8, 9, 15, 16, 22, 23, 29, 30),
+ WEEKDAY(3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 17, 18, 19, 20, 21, 24, 25, 26, 27, 28, 31),
+ SPECIAL_DAY(3, 10, 17, 24, 25, 31);
+
+ private final int[] days;
+
+ Calendar(int... days) {
+ ... | Java | ํด๋น ๋ก์ง์ depth๊ฐ 3์ด๊ธฐ์ ์ ์ ํ ๋ฉ์๋ ์ถ์ถ, ๋๋ ๋ฆฌํฉํ ๋ง์ด ํ์ํ ๊ฒ ๊ฐ์๋ฐ์.
์ฃผ๋ง์ ํ์ธํ๊ธฐ ์ํด์ ๋ชจ๋ `Calandar`์ `enum` ์์๋ฅผ ํ์ํ ํ์๋ ์์ ๊ฒ ๊ฐ์ต๋๋ค.
๋ํ, ์คํธ๋ฆผ์ ์ฌ์ฉํ๋ค๋ฉด ๋๋ก ์ฒด์ธ๋ค๋ก ๊ฐ๊ฐ์ ๋จ๊ณ๊ฐ ๊ตฌ๋ถ๋๊ธฐ์ ๊ฐ๋
์ฑ์ด ์ข์์ง๊ธฐ๋ ํ๋ ์คํธ๋ฆผ์ ์ ๊ทน ํ์ฉํ์๋ฉด ๋ ์ข์ ๊ฒ ๊ฐ์ต๋๋ค!
```suggestion
return Arrays.stream(WEEKEND.days)
.anyMatch(day -> day == date);
``` |
@@ -0,0 +1,37 @@
+package christmas.domain;
+
+import java.util.Arrays;
+
+public enum Menu {
+ ์์ก์ด์ํ(6_000), ํํ์ค(5_500), ์์ ์๋ฌ๋(8_000),
+ ํฐ๋ณธ์คํ
์ดํฌ(55_000), ๋ฐ๋นํ๋ฆฝ(54_000), ํด์ฐ๋ฌผํ์คํ(35_000), ํฌ๋ฆฌ์ค๋ง์คํ์คํ(25_000),
+ ์ด์ฝ์ผ์ดํฌ(15_000), ์์ด์คํฌ๋ฆผ(5_000),
+ ์ ๋ก์ฝ๋ผ(3_000), ๋ ๋์์ธ(60_000), ์ดํ์ธ(25_000);
+
+ private final int price;
+... | Java | ์ด ๊ฒฝ์ฐ ๋ฉ๋ด์ ์ถ๊ฐ ๋ฐ ๋ณ๊ฒฝ์ด ์์ ๋ ๋ง๋ค ๋ฉ์๋ ๋ก์ง์ ๋ณ๊ฒฝ ๋ํ ํจ๊ป ๋ฐ์ํด์ผ ํ๋๋ฐ์.
๊ฐ ๋ฉ๋ด์ ์ ๋ณด๊ฐ ๋ฉ๋ด ํ์
์ ํจ๊ป ์ ์ฅํ๊ณ ์๊ฑฐ๋, ๋ฉ๋ด ํ์
์ด ๋ฆฌ์คํธ ํ์์ผ๋ก ๋ฉ๋ด๋ค์ ์ ์ฅํ๊ณ ์๋๋ก ํ๋ฉด `public boolean isTypeOf(MenuType expectedType)`๊ณผ ๊ฐ์ ๋ฉ์๋ ํ๋๋ง ์ ๊ณตํด ์ฃผ๋ ๊ฒ์ผ๋ก ๋ณํ์ ์ฝ๊ฒ ๋์ํ ์๊ฐ ์์ด์! |
@@ -0,0 +1,24 @@
+package christmas.domain;
+
+public enum DiscountType {
+ MIN_EVENT_CONDITION(10000),
+ CHAMPAGNE_CONDITION(120000),
+ CHAMPAGNE(25000),
+ SERVICE_MENU_CONDITION(1),
+ DDAY_CONDITION(25),
+ BASE_AMOUNT(900),
+ DAY_BONUS(100),
+ SPECIALDAY_CONDITION(2023),
+ INIT_COUNT(0),
+ ... | Java | ์ซ์์ ์๋ฆฌ์๊ฐ ๋ง์์ง๋ค๋ฉด _ ์ผ๋ก ์๋ฆฌ์ ๊ตฌ๋ถ์ด ๊ฐ๋ฅํฉ๋๋ค!
```suggestion
CHAMPAGNE_CONDITION(120_000),
``` |
@@ -0,0 +1,36 @@
+package christmas.view;
+
+import camp.nextstep.edu.missionutils.Console;
+import christmas.domain.Menu;
+import christmas.domain.Order;
+import christmas.domain.Reservation;
+import christmas.exception.ValidatorException;
+import christmas.validator.Validator;
+import java.util.Map;
+
+public class I... | Java | `InputView`์ ์กด์ฌํ๋ ์ฝ๋ ํ๋ฆ์ ์ค๋ณต์ ๋ค์๊ณผ ๊ฐ์ด ์ ๊ฑฐํ ์ ์์ต๋๋ค!
๋์ ํ๋ผ๋ฏธํฐํ๋ก ๋ณ๊ฒฝ์ด ํ์ํ ๋ก์ง์ ๋ถ๋ถ๋ง ์ค๋ณต๋๋ ํ๋ฆ ์ฌ์ด์ ์ ๋ฌํด ์ฃผ๋ ๋ฐฉ์์ด์์!
```suggestion
public static Order createOrder() {
return getResult(() -> {
String input = Console.readLine();
Validator.isValidOrderFormat(input);
Map<Menu, Intege... |
@@ -0,0 +1,36 @@
+package christmas.view;
+
+import camp.nextstep.edu.missionutils.Console;
+import christmas.domain.Menu;
+import christmas.domain.Order;
+import christmas.domain.Reservation;
+import christmas.exception.ValidatorException;
+import christmas.validator.Validator;
+import java.util.Map;
+
+public class I... | Java | `View`์์ ๋๋ฉ์ธ ํด๋์ค ์์ฒด๊ฐ ์์ฑ๋์ด ๋ฐํ๋๋ ๊ฒ์ด `View` ํด๋์ค์ ๋๋ฌด ๋ง์ ์ฑ
์์ด ์กด์ฌํ๋ ๊ฒ ์ฒ๋ผ ๋ณด์ด๊ธฐ๋ ํ๋๋ฐ ์ด ๋ถ๋ถ์ ๋ํด์ ์ด๋ป๊ฒ ์๊ฐํ์๋์? |
@@ -0,0 +1,48 @@
+package christmas.view.messages;
+
+public enum PrintMessage {
+ INPUT_INTRODUCE("์๋
ํ์ธ์! ์ฐํ
์ฝ ์๋น 12์ ์ด๋ฒคํธ ํ๋๋์
๋๋ค."),
+ INPUT_RESERVATION("12์ ์ค ์๋น ์์ ๋ฐฉ๋ฌธ ๋ ์ง๋ ์ธ์ ์ธ๊ฐ์? (์ซ์๋ง ์
๋ ฅํด ์ฃผ์ธ์!)"),
+ INPUT_ORDER("์ฃผ๋ฌธํ์ค ๋ฉ๋ด๋ฅผ ๋ฉ๋ด์ ๊ฐ์๋ฅผ ์๋ ค ์ฃผ์ธ์. (e.g. ํด์ฐ๋ฌผํ์คํ-2,๋ ๋์์ธ-1,์ด์ฝ์ผ์ดํฌ-1)"),
+
+ OUTPUT_RESULT("12์ 26์ผ์ ์ฐํ
์ฝ ์๋น์์... | Java | ์ฌ๋ฌ ์ค๋ก ๊ตฌ์ฑ๋ `String`์ `"""`๋ก ๊ฐ์ธ์ค ์ ์๋ ๊ฒ์ผ๋ก ์๊ณ ์์ต๋๋ค! |
@@ -0,0 +1,150 @@
+package christmas.validator;
+
+import christmas.domain.Menu;
+import christmas.exception.ErrorMessage;
+import christmas.exception.ValidatorException;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.uti... | Java | ํด๋น ๋ก์ง์ 26๋ผ์ธ์ผ๋ก ๊ตฌ์ฑ๋์ด ์์ด์.
๊ฐ ๋จ๊ณ๋ฅผ ๋ฉ์๋๋ก ์ถ์ถํด ๋ณด๋ ๊ฑด ์ด๋จ๊น์? |
@@ -0,0 +1,50 @@
+package christmas.domain;
+
+public enum Calendar {
+ WEEKEND(1, 2, 8, 9, 15, 16, 22, 23, 29, 30),
+ WEEKDAY(3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 17, 18, 19, 20, 21, 24, 25, 26, 27, 28, 31),
+ SPECIAL_DAY(3, 10, 17, 24, 25, 31);
+
+ private final int[] days;
+
+ Calendar(int... days) {
+ ... | Java | ์๊ฐํ์ง ๋ชปํ๋ ๋ถ๋ถ์ธ๋ฐ ๊ฐ์ฌํฉ๋๋ค. |
@@ -0,0 +1,50 @@
+package christmas.domain;
+
+public enum Calendar {
+ WEEKEND(1, 2, 8, 9, 15, 16, 22, 23, 29, 30),
+ WEEKDAY(3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 17, 18, 19, 20, 21, 24, 25, 26, 27, 28, 31),
+ SPECIAL_DAY(3, 10, 17, 24, 25, 31);
+
+ private final int[] days;
+
+ Calendar(int... days) {
+ ... | Java | ํ.. ๊ทธ๋ ์ง ์์๋ Stream์ ๋ํด ๊ณ์ ๊ณต๋ถํ๊ณ ์๋๋ฐ ๋ณต์ตํ๋ฉฐ ์ ์ฉํด๋ณด๋๋ก ํ๊ฒ ์ต๋๋ค. ๊ฐ์ฌํฉ๋๋ค! |
@@ -0,0 +1,24 @@
+package christmas.domain;
+
+public enum DiscountType {
+ MIN_EVENT_CONDITION(10000),
+ CHAMPAGNE_CONDITION(120000),
+ CHAMPAGNE(25000),
+ SERVICE_MENU_CONDITION(1),
+ DDAY_CONDITION(25),
+ BASE_AMOUNT(900),
+ DAY_BONUS(100),
+ SPECIALDAY_CONDITION(2023),
+ INIT_COUNT(0),
+ ... | Java | ๊ฐ์ฌํฉ๋๋ค! |
@@ -0,0 +1,37 @@
+package christmas.domain;
+
+import java.util.Arrays;
+
+public enum Menu {
+ ์์ก์ด์ํ(6_000), ํํ์ค(5_500), ์์ ์๋ฌ๋(8_000),
+ ํฐ๋ณธ์คํ
์ดํฌ(55_000), ๋ฐ๋นํ๋ฆฝ(54_000), ํด์ฐ๋ฌผํ์คํ(35_000), ํฌ๋ฆฌ์ค๋ง์คํ์คํ(25_000),
+ ์ด์ฝ์ผ์ดํฌ(15_000), ์์ด์คํฌ๋ฆผ(5_000),
+ ์ ๋ก์ฝ๋ผ(3_000), ๋ ๋์์ธ(60_000), ์ดํ์ธ(25_000);
+
+ private final int price;
+... | Java | ์ข ๋ ๊ฐ์ฒด์งํฅ์ ์ผ๋ก ์ค๊ณ๊ฐ ๊ฐ๋ฅํ ๋ถ๋ถ์ด๋ค์. ๊ฐ์ฌํฉ๋๋ค! |
@@ -0,0 +1,150 @@
+package christmas.validator;
+
+import christmas.domain.Menu;
+import christmas.exception.ErrorMessage;
+import christmas.exception.ValidatorException;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.uti... | Java | 15๋ผ์ธ์ผ๋ก ์ค์ด๋๋ก ๋
ธ๋ ฅํด๋ณด๊ฒ ์ต๋๋ค. ๊ฐ์ฌํฉ๋๋ค! |
@@ -0,0 +1,36 @@
+package christmas.view;
+
+import camp.nextstep.edu.missionutils.Console;
+import christmas.domain.Menu;
+import christmas.domain.Order;
+import christmas.domain.Reservation;
+import christmas.exception.ValidatorException;
+import christmas.validator.Validator;
+import java.util.Map;
+
+public class I... | Java | ์ต๊ทผ์ ๊ณต๋ถํ๋ฉฐ View๋ ์ปจํธ๋กค๋ฌ์์ Model์ ๋ฐ๊ธฐ๋ง ํด์ผ ํ๋ค๋ ์๊ฐ์ด ๋ค์์ต๋๋ค. ์ด ๋น์์๋ View์์ Model์ ์์ฑํด์ ๋ฐํํ๋ ๋ฐฉ๋ฒ์ด ์ ๋ ๋ง๋๊ฑด๊ฐ? ์๊ฐ์ ํ์๋๋ฐ ๊ฐ๋ง ๋ฐํํด์ฃผ๋ ํ์์ผ๋ก ์์ ํด๋ด์ผ๊ฒ ๋ค์. ๊ฐ์ฌํฉ๋๋ค. |
@@ -0,0 +1,36 @@
+package christmas.view;
+
+import camp.nextstep.edu.missionutils.Console;
+import christmas.domain.Menu;
+import christmas.domain.Order;
+import christmas.domain.Reservation;
+import christmas.exception.ValidatorException;
+import christmas.validator.Validator;
+import java.util.Map;
+
+public class I... | Java | ํ ์ด๋ฐ์์ผ๋ก ์ฝ๋๋ฅผ ์์ฑํ ์ ์๊ตฐ์. ์๋ ค์ฃผ์
์ ๊ฐ์ฌํฉ๋๋ค. ์ข ๋ ๊ณต๋ถํด์ ์ ์ฉํด๋ณด๋๋ก ํ๊ฒ ์ต๋๋ค! |
@@ -0,0 +1,48 @@
+package christmas.view.messages;
+
+public enum PrintMessage {
+ INPUT_INTRODUCE("์๋
ํ์ธ์! ์ฐํ
์ฝ ์๋น 12์ ์ด๋ฒคํธ ํ๋๋์
๋๋ค."),
+ INPUT_RESERVATION("12์ ์ค ์๋น ์์ ๋ฐฉ๋ฌธ ๋ ์ง๋ ์ธ์ ์ธ๊ฐ์? (์ซ์๋ง ์
๋ ฅํด ์ฃผ์ธ์!)"),
+ INPUT_ORDER("์ฃผ๋ฌธํ์ค ๋ฉ๋ด๋ฅผ ๋ฉ๋ด์ ๊ฐ์๋ฅผ ์๋ ค ์ฃผ์ธ์. (e.g. ํด์ฐ๋ฌผํ์คํ-2,๋ ๋์์ธ-1,์ด์ฝ์ผ์ดํฌ-1)"),
+
+ OUTPUT_RESULT("12์ 26์ผ์ ์ฐํ
์ฝ ์๋น์์... | Java | ์! ๊น๋จน๊ณ ์์๋ค์. ๊ฐ์ฌํฉ๋๋ค! |
@@ -0,0 +1,15 @@
+package christmas.controller;
+
+import christmas.domain.Order;
+import christmas.domain.Reservation;
+import christmas.domain.Result;
+
+public class EventPlannerController {
+ public static void run() {
+ Reservation reservation = ReservationController.inputReservation();
+ Order or... | Java | ์ด๋ค ์ด์ ๋ก static ๋ฉ์๋๋ฅผ ์ฌ์ฉํ์
จ์๊น์?
static๋ฉ์๋๋ฅผ ์ฌ์ฉํ๋ฉด ํธ๋ฆฌํ ์ ์๋๋ฐ ๋ค๋ฅธ ์ฌ์ด๋ ์ดํํธ๊ฐ ์์๊น์? |
@@ -0,0 +1,20 @@
+package christmas.controller;
+
+import christmas.domain.Order;
+import christmas.domain.Reservation;
+import christmas.domain.Result;
+import christmas.view.OutputView;
+
+public class ResultController {
+
+ public static Result createResult(Order order, Reservation reservation) {
+ OutputV... | Java | ์ฌ๋ฌ ์ปจํธ๋กค๋ฌ ํด๋์ค๋ฅผ ๋ถ๋ฆฌํ์ ์ด์ ๊ฐ ๋ฌด์์ธ๊ฐ์? |
@@ -0,0 +1,50 @@
+package christmas.domain;
+
+public enum Calendar {
+ WEEKEND(1, 2, 8, 9, 15, 16, 22, 23, 29, 30),
+ WEEKDAY(3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 17, 18, 19, 20, 21, 24, 25, 26, 27, 28, 31),
+ SPECIAL_DAY(3, 10, 17, 24, 25, 31);
+
+ private final int[] days;
+
+ Calendar(int... days) {
+ ... | Java | calendar๋ผ๋ enum์ด 2023๋
12์์ ๋ ์ง๋ง ์์ผ๋ ์กฐ๊ธ ์ด์ํ ๊ฒ ๊ฐ์์ ํด๋์ค ๋ช
์ ์ข ๋ ๋ช
ํํ๊ฒ ํ๋ฉด ์ข์ ๊ฒ ๊ฐ์์ |
@@ -0,0 +1,29 @@
+package christmas.domain;
+
+public enum EventBadge {
+ SANTA(20000, "์ฐํ"),
+ TREE(10000, "ํธ๋ฆฌ"),
+ STAR(5000, "๋ณ"),
+ NONE(0, "์์");
+
+ private final int threshold;
+ private final String description;
+
+ EventBadge(int threshold, String description) {
+ this.threshold = t... | Java | ์ด๊ฒ๋ ์คํธ๋ฆผ์ผ๋ก ํด๊ฒฐํ ์ ์๊ฒ ๋ค์
ํด๋ํฐ์ผ๋ก ํ๋ ๊ฒ์ด๋ผ ์ฝ๋์น๊ธฐ๊ฐ ๋ถํธํด์ ์คํธ๋ฆผ, filter, findAny, orElseGet ์ ์ฌ์ฉํ๋ฉด ๋ ๊ฒ ๊ฐ์์! |
@@ -0,0 +1,37 @@
+package christmas.domain;
+
+import java.util.Arrays;
+
+public enum Menu {
+ ์์ก์ด์ํ(6_000), ํํ์ค(5_500), ์์ ์๋ฌ๋(8_000),
+ ํฐ๋ณธ์คํ
์ดํฌ(55_000), ๋ฐ๋นํ๋ฆฝ(54_000), ํด์ฐ๋ฌผํ์คํ(35_000), ํฌ๋ฆฌ์ค๋ง์คํ์คํ(25_000),
+ ์ด์ฝ์ผ์ดํฌ(15_000), ์์ด์คํฌ๋ฆผ(5_000),
+ ์ ๋ก์ฝ๋ผ(3_000), ๋ ๋์์ธ(60_000), ์ดํ์ธ(25_000);
+
+ private final int price;
+... | Java | ์ฌ๊ธฐ๋ง ๋ณ์๋ช
์ ํ๊ธ๋ก ํ์ ์ด์ ๊ฐ ์๋์? ์ ๋ ํ๊ธ ๋ณ์๊ฐ ๊ฐ๋
์ฑ์ด ์ข๋ค๊ณ ์๊ฐํ์ง๋ง ์๋์์ฑ์์ ๋ถํธํ๋๋ผ๊ณ ์
๊ทธ๋ฆฌ๊ณ ์๋์ is~~~ ๋ฉ์๋๊ฐ ๋ง์๋ฐ ๋ฉ๋ด์ ๊ฐ๊ฒฉ๊ณผ ํ์
๋ ๊ฐ์ด ๊ฐ์ง๊ณ ์๋ค๋ฉด ์ข ๋ ๊น๋ํ๊ฒ ์ฝ๋๋ฅผ ์์ฑํ ์ ์์ ๊ฒ ๊ฐ๋ค์ |
@@ -0,0 +1,25 @@
+package christmas.domain;
+
+import christmas.validator.Validator;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class Order {
+
+ private Map<Menu, Integer> orderedItems;
+
+ private Order(Map<Menu, Integer> ordered... | Java | ์ ๊ฐ์ ๋ฉ์๋๊ฐ ๋๊ฐ์ผ๊น์? |
@@ -0,0 +1,20 @@
+package christmas.domain;
+
+import christmas.validator.Validator;
+
+public class Reservation {
+ private final int date;
+
+ private Reservation(int date) {
+ Validator.isInRange(date);
+ this.date = date;
+ }
+
+ public static Reservation from(int date) {
+ return n... | Java | ์ฌ๊ธฐ๋ ๊ทธ๋ ๋ค์ ์ด๋ค ์ด์ ๋ก ์์ฑ์๋ฅผ private์ผ๋ก ๋ง์๋์๊ณ static ๋ฉ์๋๋ฅผ ์ฌ์ฉํ์
จ์๊น์ |
@@ -0,0 +1,171 @@
+package christmas.domain;
+
+import static christmas.domain.DiscountType.*;
+
+import java.util.Map;
+
+public class Result {
+
+ private int totalBeforeDiscount;
+ private int serviceMenu;
+ private int dDayDiscount;
+ private int weekdayDiscount;
+ private int weekendDiscount;
+ p... | Java | ํ ๊ฐ์ฒด์ ๋๋ฌด ๋ง์ ํ๋๋ฅผ ์ ์ธํ๋๋ฐ ์ฑ
์์ ๋ถ๋ฆฌํ ์ ์์ง ์์๊น์? |
@@ -0,0 +1,150 @@
+package christmas.validator;
+
+import christmas.domain.Menu;
+import christmas.exception.ErrorMessage;
+import christmas.exception.ValidatorException;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.uti... | Java | validator๋ผ๋ static ๋ฉ์๋๋ง ๊ฐ์ง๊ณ ์๋ ํด๋์ค๋ฅผ ๋ง๋์ ์ด์ ๊ฐ ๊ถ๊ธํฉ๋๋ค |
@@ -0,0 +1,87 @@
+package christmas.domain;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+
+class CalendarTest {
+
+ @DisplayName("ํ์ผ์ ํด๋นํ๋ ๋ ์ง๋ฅผ ์
๋ ฅํ์ ๋ ๊ฒ์ฆ")
+ @Test
+ public void testIsWeekday() {
+ // Given
+ ... | Java | assertJ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ฌ์ฉํ์๋ ๊ฒ์ ์ถ์ฒ๋๋ฆฝ๋๋ค |
@@ -0,0 +1,88 @@
+package christmas.domain;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+
+class MenuTest {
+
+ @DisplayName("์์ก์ด ์ํ ๊ฐ๊ฒฉ ๋์ผํ์ง ๊ฒ์ฆ")
+ @Test
+ public void testGetPrice() {
+ // Given
+ Menu menu... | Java | softAssertion์ด๋ assertAll์ ๋ํด ์์๋ณด์๋ฉด ์ข์ ๊ฒ ๊ฐ์์ |
@@ -0,0 +1,241 @@
+# ๋ฏธ์
- ํฌ๋ฆฌ์ค๋ง์ค ํ๋ก๋ชจ์
๐
+
+## โ
ย ๊ธฐ๋ฅ ๋ชฉ๋ก
+
+### 1. ๊ฒ์ ์์
+
+- [X] ์๋น ์์ ๋ฐฉ๋ฌธ ๋ ์ง๋ฅผ ์
๋ ฅ ๋ฐ๋๋ค.
+ - [X] ๋ฐฉ๋ฌธํ ๋ ์ง๋ 1 ์ด์ 31 ์ดํ์ ์ซ์๋ง ์
๋ ฅ ๋ฐ๋๋ค.
+ - [X] ์๋ชป๋ ๊ฐ์ ์
๋ ฅํ ๊ฒฝ์ฐ ์์ธ ์ฒ๋ฆฌํ๋ค.
+
+- [X] ๊ณ ๊ฐ์๊ฒ ์๋ดํ ์ด๋ฒคํธ ์ฃผ์ ์ฌํญ์ ์ถ๋ ฅํ๋ค.
+
+- [X] ์ฃผ๋ฌธํ ๋ฉ๋ด์ ๊ฐ์๋ฅผ ์
๋ ฅ ๋ฐ๋๋ค.
+ - [X] ๋ฉ๋ดํ์ ์๋ ๋ฉ๋ด๋ฅผ ์
๋ ฅ ์ ์์ธ ์ฒ๋ฆฌํ๋ค.
+ - [X] ๋ฉ๋ด์ ๊ฐ์๋ 1 ์ด์์ ์ซ์๊ฐ ์๋ ๊ฒฝ์ฐ ์์ธ ์ฒ๋ฆฌํ๋ค... | Unknown | ๊ฒ์์ด๋ผ๊ณ ํ์ ์ด์ ๊ฐ ๋ฐ๋ก ์์๊น์? |
@@ -0,0 +1,15 @@
+package christmas.controller;
+
+import christmas.domain.Order;
+import christmas.domain.Reservation;
+import christmas.domain.Result;
+
+public class EventPlannerController {
+ public static void run() {
+ Reservation reservation = ReservationController.inputReservation();
+ Order or... | Java | static ๋ฉ์๋๋ง ์๋ ํด๋์ค๋ผ๋ฉด ์ธ์คํด์ค๋ฅพ ๋ง๋ค ํ์๊ฐ ์์ํ
๋ฐ์, ์ด๋ฅผ ์ด๋ป๊ฒ ๋ฐฉ์งํ ์ ์์๊น์? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.