Skip to content
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

[REFACTOR] IPO Domain 로직 개선 (Service Layer) #67

Closed
9 tasks done
chhs2131 opened this issue Oct 30, 2022 · 0 comments · Fixed by #77
Closed
9 tasks done

[REFACTOR] IPO Domain 로직 개선 (Service Layer) #67

chhs2131 opened this issue Oct 30, 2022 · 0 comments · Fixed by #77
Labels
refactor 로직 수정을 통한 개선 진행 (입출력에 변화 X)

Comments

@chhs2131
Copy link
Owner

chhs2131 commented Oct 30, 2022

목적

가독성 증대를 위한 ipo domain 로직 개선


상세내용

변수명 설명 기본값
pageNumber 페이지번호 1
numberOfArticles 페이지 당 반환 갯수 100
targetDate 기준 일자 today
startDate 검색 시작 일자 today
endDate 검색 종료 일자 today
ipoSequence 청약 진행 단계 IpoSequence.ALL
containCancel 청약철회 종목 포함 여부 false
sort 정렬 Sort.ASC
  • target, start, end 간 결과 도출 예상
    • (target) vs (start,end) 가 대립될 때 양측모두 '오늘'이 아닌 경우 예외 발생
target start end result
오늘 오늘 오늘 (오늘,오늘)
오늘 어제 오늘 (어제,오늘)
오늘 오늘 어제 Exception
어제 오늘 오늘 (어제,어제)
어제 어제 오늘 Exception
  • schedule 파라미터를 string이 아닌 localDate로 변경

  • ipo api 중 기간 관련 파라미터를 받는 요청들에 대해서 내부적으로 DatePeriod를 사용

    • comment
    • schedule
  • comment 를 통해 특정 ipo를 조회하는 기능 제거 (해당기능은 이미 {ipo_index}/comment 에 존재함)

  • comment 리스트 기본 조회 기간 최근 7일에서 14일로 수정

    • 명절 및 최근과 같은 공모가 잘 없는 경우를 대비
  • comment를 별도의 service layer로 분리

  • 비어있는 comment 처리 개선

    • list removeIf vs Stream
  • 신규상장에 대한 comment 처리 개선

    • domain에 comment 객체가 있으므로 분리 가능할 것으로 보임
    • 신규 상장에 대해서 현재 정상적으로 메세지가 표시되고있는지 확인
  • 그 외 VO(Domain) 객체화 할 수 있는 부분이 있는지 확인


참고사항


@chhs2131 chhs2131 added the refactor 로직 수정을 통한 개선 진행 (입출력에 변화 X) label Oct 30, 2022
@chhs2131 chhs2131 changed the title [REFACTOR] /api/v1/ipo list 조회시 전달되는 조건 parameter를 묶는 데이터클래스 추가 [REFACTOR] IPO Domain 로직 개선 (Service Layer) Dec 19, 2022
chhs2131 added a commit that referenced this issue Dec 20, 2022
…페이징 조건값을 전달하도록 기존 로직을 대체
chhs2131 added a commit that referenced this issue Dec 22, 2022
chhs2131 added a commit that referenced this issue Dec 22, 2022
… 에러에 대한 처리 진행

- IllegalArgumentException 발생가능
- 해당 에러를 IG000(BadRequest)
CustomException으로 변환하여 사용자에게 노출
chhs2131 added a commit that referenced this issue Dec 28, 2022
Refactor/#67 - ipo domain 로직 개선
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor 로직 수정을 통한 개선 진행 (입출력에 변화 X)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant