-
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기 - 김현우] Spring Boot Part3 Weekly Mission 제출합니다. #972
Open
ASak1104
wants to merge
73
commits into
prgrms-be-devcourse:ASak1104-hwkim-week3
Choose a base branch
from
ASak1104:ASak1104/week3
base: ASak1104-hwkim-week3
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 62 commits
Commits
Show all changes
73 commits
Select commit
Hold shift + click to select a range
7494782
fix : ddl wallet 테이블에 cascade 추가
ASak1104 080148d
refactor : Jdbc 빈 설정과 repository 빈 설정 분리
ASak1104 ed2c696
test : 조회한 Voucher 정보를 테스트할 때 순서가 상관 없도록 수정
ASak1104 c8a2b1c
test : save 메서드 테스트에 대한 검증 부분 추가
ASak1104 9d617ab
test : 테스트 예외에 대한 검증 부분 추가
ASak1104 408969d
test : 블랙리스트 유저 테스트 강화
ASak1104 c0ef95a
test : Voucher 모델에 대한 테스트 강화
ASak1104 5fda05f
fix : 데이터베이스 커넥션이 없을 때의 버그 수정
ASak1104 1b029d4
fix : 존재하지 않는 고객을 조회할 때 빈 Optional 객체를 반환하도록 수정
ASak1104 0c3f516
test : JdbcCustomerRepository test 코드 추가
ASak1104 555b815
test : JdbcWalletRepository 테스트 코드 추가
ASak1104 40e001a
refactor : console 애플리케이션 페키지 분리
ASak1104 383b178
fix : 잘못된 uuid가 입력 됐을 때의 예외처리 추가
ASak1104 2065a1e
logging : 로깅 포인트 컷 수정
ASak1104 641def9
chore : spring web 의존성 추가
ASak1104 ae21ab6
style : 메서드 이름 변경
ASak1104 4921225
feat : voucher 생성 필드 일자 추가
ASak1104 3ac74b5
feat : voucherRepository 조회 추가
ASak1104 8ee85f0
test : voucher 모델 테스트 추가
ASak1104 737411b
test : id, type 조회 테스트 추가
ASak1104 fb0987b
refactor : string uuid 인자를 UUID 타입으로 변경
ASak1104 57984a2
chore : javafaker 의존성 추가
ASak1104 76a4da7
refactor : voucher 조회 로직 수정
ASak1104 9a62852
test : VoucherCCustomerFacade 테스트 코드 추가
ASak1104 2e34c07
test : 이름과 이메일 생성을 faker 클래스로 변경
ASak1104 eb891a9
refactor : 필요 없는 생성자 제거
ASak1104 c716997
feat : Console 유틸 close 메서드 추가
ASak1104 6dd746f
test : Console 유틸 테스트 코드 추가
ASak1104 5ca617d
fix : 문자열을 변환 방법 수정
ASak1104 f4a2123
test : UUIDConverter 테스트 코드 추가
ASak1104 a1b92b5
refactor : 메서드 분리
ASak1104 174d918
fix : 불필요한 예외 처리 제거
ASak1104 e931e55
feat : VoucherRepository 기능 추가
ASak1104 34cb118
test : 삭제 & 생성 일자 조회 기능 테스트 추가
ASak1104 882020a
refactor : 불필요한 예외 제거
ASak1104 3341f39
test : 바우처 생성 데이터를 랜덤으로 변경
ASak1104 efa55f0
test : 생성 기간 조회 테스트 추가
ASak1104 fc7fbd1
feat : 바우처 api 추가
ASak1104 98b5430
chore : xml dataformat 의존성 추가
ASak1104 8c7aada
feat : xml response 기능 추가
ASak1104 f262beb
feat : 애플리케이션 선택 기능 추가
ASak1104 9d2b545
refactor : 애플리케이션들의 패키지를 분리
ASak1104 3a7976b
refactor : 패키지 구조 변경
ASak1104 39b416d
test : 필요없는 테스트 부분 제거
ASak1104 dbeddfa
logging : repository pointcut 변경
ASak1104 c970983
style : api 공통 path 추출
ASak1104 15215a6
chore : thymeleaf 의존성 추가
ASak1104 db5c341
feat : 간단한 고객 페이지 추가
ASak1104 028286d
refactor : Voucher createAt을 불변으로 변경
ASak1104 3b66145
view : 고객 관리 html 파일 추가
ASak1104 3b77085
feat : 고객 view 기능 추가
ASak1104 b930567
feat : 고객 관리 ControllerAdvice 추가
ASak1104 d5efde3
feat : 고객 수정 기능 추가
ASak1104 6ec6b67
view : 뷰 파일 위치 변경
ASak1104 7a1de11
view : 에러 페이지 추가
ASak1104 73686fb
feat : 고객 삭제 기능 추가
ASak1104 894720c
test : 고객 테스트 코드 추가
ASak1104 750e944
view : 고객 삭제 버튼 추가
ASak1104 7215e16
view : 상세 페이지로 가는 링크 추가
ASak1104 9a01773
test : 콘솔 테스트 기능을 추상 클래스로 분리
ASak1104 fc515f7
test : 메인 클래스 테스트 코드 추가
ASak1104 948b2a1
refactor : 콘솔 초기화 메서드를 불변으로 변경
ASak1104 81d6f1e
style : 불필요한 중괄호 제거
ASak1104 70a79d9
style : 확실한 의미를 내포하도록 메서드 명을 수정
ASak1104 649f7ff
style : 불필요한 param 지정 부분 제거
ASak1104 1332c72
chore : spring validation 의존성 추가
ASak1104 f870b5b
feat : 바우처 생성 dto 데이터 검증 기능 추가
ASak1104 ce79ec0
feat : 고객 추가 dto 검증 기능 추가
ASak1104 f077d7d
refactor : 존재하지 않는 바우처를 삭제할 때 예외가 발생하도록 수정
ASak1104 51bfeea
refactor : 바우처 생성 api의 status 코드 수정
ASak1104 7412a89
refactor : 실행할 애플리케이션을 이넘으로 관리
ASak1104 f949bd9
refactor : 필터링 api를 origin에 대한 쿼리스트링으로 통일
ASak1104 d3c86e4
docs: fix typo
ASak1104 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 26 additions & 16 deletions
42
src/main/java/team/marco/voucher_management_system/VoucherManagementSystemApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,38 @@ | ||
package team.marco.voucher_management_system; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.boot.context.properties.ConfigurationPropertiesScan; | ||
import org.springframework.context.ApplicationContext; | ||
import org.springframework.core.env.Environment; | ||
import team.marco.voucher_management_system.application.CommandMainApplication; | ||
import org.springframework.context.annotation.ComponentScan; | ||
import team.marco.voucher_management_system.console_app.ConsoleApplication; | ||
import team.marco.voucher_management_system.util.Console; | ||
import team.marco.voucher_management_system.web_app.WebApplication; | ||
|
||
@SpringBootApplication | ||
@ComponentScan | ||
@ConfigurationPropertiesScan | ||
public class VoucherManagementSystemApplication { | ||
private static final Logger logger = LoggerFactory.getLogger(VoucherManagementSystemApplication.class); | ||
|
||
public static void main(String[] args) { | ||
ApplicationContext context = SpringApplication.run(VoucherManagementSystemApplication.class, args); | ||
Environment environment = context.getEnvironment(); | ||
Console.print(""" | ||
=== 실행할 애플리케이션을 선택해주세요. === | ||
0. Console Application | ||
1. Web Application"""); | ||
|
||
selectApplication(args); | ||
|
||
Console.close(); | ||
} | ||
|
||
private static void selectApplication(String[] args) { | ||
String input = Console.readString(); | ||
|
||
logger.info("Program start (profile: {})", environment.getActiveProfiles()[0]); | ||
switch (input) { | ||
case "0" -> ConsoleApplication.main(args); | ||
case "1" -> WebApplication.main(args); | ||
default -> reselect(args); | ||
} | ||
} | ||
|
||
CommandMainApplication application = context.getBean(CommandMainApplication.class); | ||
application.run(); | ||
private static void reselect(String[] args) { | ||
Console.print("사용할 수 없는 애플리케이션 입니다."); | ||
|
||
logger.info("Program exit"); | ||
selectApplication(args); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/main/java/team/marco/voucher_management_system/console_app/ConsoleApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package team.marco.voucher_management_system.console_app; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.WebApplicationType; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.context.ConfigurableApplicationContext; | ||
import org.springframework.context.annotation.Import; | ||
import team.marco.voucher_management_system.VoucherManagementSystemApplication; | ||
import team.marco.voucher_management_system.console_app.application.CommandMainApplication; | ||
|
||
@Import(VoucherManagementSystemApplication.class) | ||
@SpringBootApplication | ||
public class ConsoleApplication { | ||
public static void main(String[] args) { | ||
SpringApplication springApplication = new SpringApplication(ConsoleApplication.class); | ||
springApplication.setWebApplicationType(WebApplicationType.NONE); | ||
|
||
ConfigurableApplicationContext context = springApplication.run(args); | ||
CommandMainApplication application = context.getBean(CommandMainApplication.class); | ||
|
||
application.run(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...plication/RunnableCommandApplication.java → ...plication/RunnableCommandApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...system/type_enum/CustomerCommandType.java → ...app/command_enum/CustomerCommandType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ent_system/type_enum/MainCommandType.java → ...ole_app/command_enum/MainCommandType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...t_system/type_enum/WalletCommandType.java → ...e_app/command_enum/WalletCommandType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...ontroller/ConsoleBlacklistController.java → ...ontroller/ConsoleBlacklistController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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같은걸로 해두면 클린코드 적으로 좋을거 같습니다.
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.
실행할 스프링 애플리케이션의 main 메서드를 enum에서 Consumer로 관리하는 방향으로 수정해봤습니다!
commit 7412a89