[5기 - 송인재] Spring Boot Part3 Weekly Mission 제출합니다.#971
Open
IjjS wants to merge 82 commits intoprgrms-be-devcourse:IjjSfrom
Open
[5기 - 송인재] Spring Boot Part3 Weekly Mission 제출합니다.#971IjjS wants to merge 82 commits intoprgrms-be-devcourse:IjjSfrom
IjjS wants to merge 82 commits intoprgrms-be-devcourse:IjjSfrom
Conversation
ksy90101
reviewed
Nov 18, 2023
| public class Voucher { | ||
| private final UUID voucherId; | ||
| private final LocalDateTime createdAt; | ||
| private final BigDecimal discountValue; |
ksy90101
reviewed
Nov 18, 2023
| import com.programmers.vouchermanagement.advice.annotation.AdminController; | ||
|
|
||
| @ControllerAdvice(annotations = AdminController.class) | ||
| public class GeneralAdvice { |
ksy90101
reviewed
Nov 18, 2023
| import org.springframework.web.bind.annotation.RestControllerAdvice; | ||
|
|
||
| @RestControllerAdvice(annotations = RestController.class) | ||
| public class RestAdvice { |
There was a problem hiding this comment.
RuntimeException으로 예상치 못한 예외를 방어해보면 어떨까요?
ksy90101
reviewed
Nov 18, 2023
| return "redirect:/customers/" + customer.customerId(); | ||
| } | ||
|
|
||
| @PostMapping("/{customerId}/delete") |
ksy90101
reviewed
Nov 18, 2023
| return "customers/customer"; | ||
| } | ||
|
|
||
| @PostMapping("/update") |
ksy90101
reviewed
Nov 18, 2023
| } | ||
|
|
||
| @PostMapping | ||
| @ResponseStatus(HttpStatus.CREATED) |
ksy90101
reviewed
Nov 18, 2023
| } | ||
|
|
||
| @DeleteMapping("/{voucherId}") | ||
| @ResponseStatus(HttpStatus.ACCEPTED) |
There was a problem hiding this comment.
내려줄 응답이 없다면 no_content가 status에 맞습니다.
ksy90101
reviewed
Nov 18, 2023
|
|
||
| @GetMapping | ||
| @ResponseStatus(HttpStatus.OK) | ||
| public List<VoucherResponse> readAllVouchers(String typeName, LocalDate startDate, LocalDate endDate) { |
There was a problem hiding this comment.
해당 값들을 dto로 받으면 어떨까요?
validate도 자연스럽게 될꺼에요!
ksy90101
reviewed
Nov 18, 2023
| public record CreateVoucherRequest(BigDecimal discountValue, VoucherType voucherType) { | ||
| public record CreateVoucherRequest( | ||
| @Positive(message = "Discount value must be greater than 0.") long discountValue, | ||
| @NotBlank(message = "Voucher type cannot be blank.") String voucherType |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
📌 과제 설명
바우처와 고객 서비스 관리페이지를 thymeleaf를 이용하여 개발했습니다.
프로젝트 디렉터리에 Dockerfile을 추가해두었습니다. 프로젝트 디렉터리에서 도커 이미지 빌드 후 실행 부탁드립니다.
테스트를 제외하고 4개의 프로파일이 있습니다.
콘솔 애플리케이션
웹 애플리케이션
👩💻 요구 사항과 구현 내용
(기본) 바우처 서비스 관리페이지 개발하기
(기본) 바우처 서비스의 API 개발하기
Spring MVC를 적용해서 JSON과 XML을 지원하는 REST API를 개발해보세요
(보너스) 바우처 지갑용 관리페이지를 만들어보세요.
Advice
Configuration
Customer
Voucher
✅ 피드백 반영사항
✅ PR 포인트 & 궁금한 점
라이브 리뷰 해주실 때 여쭤보겠습니다!!