-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[5기 - 박주한] SpringBoot Part1 Weekly Mission 제출합니다. #919
base: main
Are you sure you want to change the base?
Conversation
feat: logger int VoucherController
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
첫 과제 리뷰가 많이 늦어졌네요.
몇 가지 코멘트 남겼습니다. ~
import java.io.IOException; | ||
|
||
@SpringBootApplication | ||
//@ComponentScan( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
안쓰는 코드는 지워주는 것이 좋아요 ~
@Override | ||
public PropertySource<?> createPropertySource(String s, EncodedResource encodedResource) throws IOException { | ||
var yamlPropertiesFactoryBean = new YamlPropertiesFactoryBean(); | ||
yamlPropertiesFactoryBean.setResources(encodedResource.getResource()); | ||
|
||
var properties = yamlPropertiesFactoryBean.getObject(); | ||
return new PropertiesPropertySource(encodedResource.getResource().getFilename(), properties); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
코드로 프로퍼티를 받는 건 어떤 이유인가요 ???
public interface CustomerRepository { | ||
|
||
List<Customer> readFile(String filePath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spring data 스펙에 맞춰서 네이밍하는 것이 다음 과제 진행할때 편할 것 같아요
private final String EXIT = "exit"; | ||
private final String CREATE = "create"; | ||
private final String LIST = "list"; | ||
private final String FIXED = "fixed"; | ||
private final String PERCENT = "percent"; | ||
private final String BLACK = "black"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 정도 개수라면 Enum 으로 분리해도 좋을 것 같아요
@SpringBootTest | ||
class KdtApplicationTests { | ||
|
||
@Test | ||
void contextLoads() { | ||
} | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
굳이 사용하지 않는 테스트는 제거해주셔도 좋을 것 같아요
@Controller | ||
public class VoucherController { | ||
|
||
private final InputHandler inputHandler; | ||
private final OutputHandler outputHandler; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
컨트롤러에 너무 로직이 많은 것 같아요.
컨트롤러는 서비스와 맵핑만 해주는게 바람직해보입니다.
private final OutputHandler outputHandler; | ||
private final StartMenu startMenu; | ||
private final VoucherService voucherService; | ||
private final CustomerController customerController; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
컨트롤러가 컨트롤러를 참조하는게 어색해요
public class FixedAmountVoucherDto { | ||
private final UUID voucherId; | ||
private final long amount; | ||
|
||
public FixedAmountVoucherDto(UUID voucherId, long amount) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DTO 는 record 클래스 사용해도 좋을 것 같아요
public interface InputHandler { | ||
|
||
String inputString() throws IOException; | ||
|
||
int inputInt() throws IOException; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
인터페이스로 선언했을때 장점이 궁금합니다. ~
pom.xml
Outdated
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-parent</artifactId> | ||
<version>2.5.1</version> | ||
<relativePath/> <!-- lookup parent from repository --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
그레이들이 아닌 메이븐을 사용하신 이유가 궁금해요 ~
📌 과제 설명
(기본) 바우처 관리 애플리케이션
Maven / Gradle 로 프로젝트를 실제로 구성하고 이때 Spring Boot CLI를 개발PC에 설치해서 명령어들을 사용해보고 프로젝트를 만든다. 그리고 IDE (IntelliJ)에서 실행시켜 본다.
바우처 관리 Command-line Application을 만들어본다.
적절한 로그를 기록하고
logback
설정을 해서 에러는 파일로 기록된다.실행가능한
jar
파일을 생성한다.(심화) 파일을 통한 데이터관리 기능과 고객 블랙 리스트 명단 관리기능
👩💻 요구 사항과 구현 내용
✅ PR 포인트 & 궁금한 점