Skip to content

Conversation

@seob7
Copy link
Member

@seob7 seob7 commented Jan 12, 2024

No description provided.

seob7 and others added 30 commits November 7, 2023 13:23
- 요구 사항에 없던 password 제거
- Member 생성자를 사용한 setting
Map 동시성 문제를 해결하기 위해
ConcurrentHashMap 사용
private static final 로 외부에서의 접근 및 중복 생성 방지
- order 메소드에서 member 의 아이디를 사용해 member의 등급을 조사한 뒤 할인율을 계산하였습니다.
- ProductRepositroy 인터페이스 작성
- ProductRepository를 구현한 MemeoryProductRepository 에서 메모리에 저장하는 기능 구현
(1week code)순수자바에서 gradle 변경
- Rename MemoryMemberRepository to MemberRepository

- 자잘한 코드 수정
MemberService 인터페이스를 작성하기 위해 기존 클래스명을 MemberServiceImpl로 변경
MemberService 인터페이스를 작성하고
MemberServiceImpl에 구현함
- Product -> Order
- price 와 discountedPrice에 대한 자료형 수정
- 할인정책 interface 와 구현체 작성
[BE] (feat) orderService 구현

주문서비스 인터페이스 및 구현체 작성
[BE] (refactor) Main class 수정

오타 수정 및 코드 리팩토링
[BE] (feat) RateDiscountPolicy 생성

할인을 30(%) 로 지정함
VIP 외 등급은 0을 리턴시킴
[BE] (docs) Add ISSUE

ISSUE 에 대한 내용 추가
[BE] (refactor) DiscountPolicy 클래스 리팩토링

- if문 수정
- discountRateAmount 정적변수로 변경
- discountFixAmount 정적변수로 변경
[BE] (refactor) 생성자를 통해 외부에서 주입받도록 변경

- 생성자를 사용해 FixDiscountPolicy 나 RateDiscoutPolicy를 주입할 수 있음.
[BE] (test) Main Test

orderServiceImpl 생성자 주입 테스트
(return 값으로 지정한 30이 출력됨)
[BE] (docs) Add solution

1번 Issue에 대한 Solution 작성
[BE] (docs)  DI 이론 요약
[BE] (docs) Solution 수정
[BE] (docs) 좋은 OOP 설계 5가지 원칙 정리

SOLID
- SRP
- OCP
- LSP
- ISP
- DIP
import jakarta.validation.ConstraintValidatorContext;

/*
* https://jsy1110.github.io/2022/enum-class-validation/
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

해당 내용 참고했습니다

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이렇게 복잡하게 안하셔도 Spring 은 @Valid , @Validate 라는 어노테이션을 제공합니다.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enum 유효성 검사 에노테이션이 따로 존재하나요?

Copy link
Contributor

@shinywoon shinywoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

중간중간 코드가 기술적으로 아쉬운부분들이 많습니다.
보완하신다면 좋은 개발자가 될 수 있을것 같습니다.

import jakarta.validation.ConstraintValidatorContext;

/*
* https://jsy1110.github.io/2022/enum-class-validation/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이렇게 복잡하게 안하셔도 Spring 은 @Valid , @Validate 라는 어노테이션을 제공합니다.

Comment on lines 4 to 6
소프트웨어학과,
컴퓨터공학과,
산업디자인학과
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

????

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{
    "studentNumber" : 2026055,
    "studentName" : "이동섭",
    "studentBirth" : "2001_09_07",
    "studentMajor" : "소프트웨어학과",
    "studentSemester" : 2,
    "studentAddress" : "충주시",
    "studentGrade" : 1
}

studentMajor에 한글로 "소프트웨어학과" 같은 요청이 오면 SoftwareDept 로 영문으로 매핑하는 코드를 따로 작성해야 하는건가요?...?

public ResponseEntity signUp(@Valid @RequestBody SignUpForm signUpForm, BindingResult bindingResult) {

if(bindingResult.hasErrors())
return new ResponseEntity<>(bindingResult.getAllErrors(), HttpStatus.BAD_REQUEST);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

responseForm 을 사용했던거 같은데 .... ResponseEntity<> 를 사용하는 이유가 있을까요?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants