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: 메시지 조회 API 동적 쿼리 생성 로직 리팩터링 #158

Merged
merged 4 commits into from
Jul 25, 2022

Conversation

HJ-Rich
Copy link
Contributor

@HJ-Rich HJ-Rich commented Jul 24, 2022

요약

  • 메시지 조회 API 동적 검색 조건 생성 로직 리팩터링



작업 내용

  • MessageService 클래스 내 where 절에 들어가던 내용을 리팩터링했습니다
    • 기존 BooleanBuilder를 이용해 하나의 메서드에서 모든 로직 생성하던 부분을 분리해냈습니다
    • BooleanExpression 으로 개별 검증 단위마다 메서드로 분리하여 이를 조합하도록 구현했습니다
    • isLastExpression도 함께 리팩터링 진행했습니다
  • 테스트 픽스처 하나 수정했습니다
    • 시간으로 조회할 경우 전달된 시간을 포함하여 검색해야하기 때문에 픽스처를 수정했습니다
    • 가령 7월 1일로 이동하면, 7월1일23시59분59초를 전달하는데, 이때 이 시간도 포함해서 검색해야 하기 때문입니다.
  • JpaQueryFactory 를 어디서든 생성자 주입 받을 수 있게 설정을 추가하였습니다



참고 사항



관련 이슈



@HJ-Rich HJ-Rich added 🎉 BE 백엔드 관련 ⚙️ REFACTOR labels Jul 24, 2022
@HJ-Rich HJ-Rich self-assigned this Jul 24, 2022
@HJ-Rich HJ-Rich added this to In progress in 3차 스프린트 via automation Jul 24, 2022
Comment on lines +9 to +19
@Configuration
public class QuerydslConfig {

@PersistenceContext
private EntityManager entityManager;

@Bean
public JPAQueryFactory jpaQueryFactory() {
return new JPAQueryFactory(entityManager);
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

기존엔 entityManager를 주입받아 매번 jpaQueryFactory를 새로 생성했는데,
위와 같이 설정해두면 이후 어디에서나 생성자 주입을 받을 수 있다고 합니다.
이동욱님 블로그 참고하였습니다.

Copy link
Collaborator

Choose a reason for hiding this comment

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

참고하신 블로그 링크도 첨부해주실 수 있나요?😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

참고사항에 명시되어 있어요! ㅎㅎ
이동욱님 블로그입니다 https://jojoldu.tistory.com/372

Comment on lines +67 to +70
private BooleanExpression meetAllConditions(final SlackMessageRequest request) {
return channelIdsIn(request.getChannelIds())
.and(textContains(request.getKeyword()))
.and(messageIdOrDateCondition(request.getMessageId(), request.getDate(), request.isNeedPastMessage()));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

전체 조건을 한 번에 조망할 수 있게 하나에 묶어 표현했습니다

채널 아이디는 무조건 검증이 되어야하므로 맨 앞에 두었고
그 이후에 검색어 검증,
그 이후 메시지 아이디 또는 날짜 검증을 수행한다는 것을 표현하고자 했습니다.

각각의 BooleanExpression을 반환하는 메서드 단위로 분리해두어서
향후 조립하여 재사용할 수 있습니다

createExpectedMessageIds(5L, 1L)),
createExpectedMessageIds(6L, 1L)),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

리팩터링을 완료한 이후 하나의 테스트 케이스가 꺠지고 있는 걸 확인했습니다.
expected는 5L ~ 1L 인데 actual은 6L 부터 1L 이라는 것이었습니다.

messages.sql 파일을 확인해보니 테스트에서 전달하고 있떤 7월 13일 19시 21분 55초와
완전히 일치하는 메시지가 하나 있었습니다.

아마 where 절 리팩터링을 진행하며 제가 eq + or 로 조건을 작성하여 변경이 된 것 같은데
7월 1일 메시지로 이동 시 7월 1일 23시 59분 59초 보다 과거에 작성된 메시지 줘 와 같이 요청이 오기 때문에
날짜 기준 검색시 이를 포함하여 검색해야 한다고 판단했습니다
그래서 테스트 픽스쳐가 잘못된 것으로 판단해 6L로 수정하였습니다.

Copy link
Collaborator

@yeon-06 yeon-06 left a comment

Choose a reason for hiding this comment

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

안녕하세요 리차드 리팩터링 고생 많으셨습니다😄
정말 이보다 깔끔해질 수가 없네요 너무 보기 좋군요👍

Comment on lines +9 to +19
@Configuration
public class QuerydslConfig {

@PersistenceContext
private EntityManager entityManager;

@Bean
public JPAQueryFactory jpaQueryFactory() {
return new JPAQueryFactory(entityManager);
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

참고하신 블로그 링크도 첨부해주실 수 있나요?😄

private final MessageRepository messageRepository;
private JPAQueryFactory jpaQueryFactory;
private final JPAQueryFactory jpaQueryFactory;
Copy link
Collaborator

Choose a reason for hiding this comment

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

bean으로 관리 되니까 생성자 주입으로 받을 수 있고 최종적으로 final 키워드까지 붙일 수 있게 되었군요!
좋은 변화네요👍


private Predicate messageIdOrDateCondition(final Long messageId,
Copy link
Collaborator

@yeon-06 yeon-06 Jul 25, 2022

Choose a reason for hiding this comment

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

메서드명을 보고 이게 뭔지 한참을 생각했던 것 같아요💦
이 메서드가 어떤 로직을 수행하고 있는지 정확하게 하는 것은 좋지만 이 메서드의 목적을 드러내는 이름 은 어떨까요?
예를 들어 지금 같은 경우는 검색 기준 을 messageId로 잡을지 date로 잡을지를 결정하는 메서드네요
기준을 결정한다는 의미에서 decideMessageIdOrDate 같은 이름은 어떨까요?
딱 이거다!!!! 싶은 메서드명은 안떠오르긴 하네요😂💦

.or(QMessage.message.postedDate.after(date));
}

private OrderSpecifier<LocalDateTime> dateAscOrDescByNeedPastMessage(final boolean needPastMessage) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

개인적으로 이름에서 어떤 값을 반환할지 드러내는건 불호하는 편입니다
예를 들어 1 또는 0을 반환하는 메서드 resultZeroOrOne가 존재한다고 가정해봅시다
2라는 반환값도 생기게 된다면 메서드명을 resultZeroOrOneOrTwo 이런 식으로 바뀌어야한다고 생각해요

지금 같은 케이스에서는 정렬 기준이 asc랑 desc외에 추가될 일이 없으니까 상관없을 것 같기도 하네요🤔

Copy link
Collaborator

Choose a reason for hiding this comment

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

저도 연로그 의견에 동의합니다
arrangeDateBy~ 정도는 어떨까요?

return QMessage.message.postedDate.before(oldestMessage.getPostedDate());
}
private BooleanExpression meetAllIsLastCondition(final SlackMessageRequest request, final List<Message> messages) {
Message targetMessage = getTargetMessage(messages, request.isNeedPastMessage());
Copy link
Collaborator

Choose a reason for hiding this comment

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

이번에 리차드가 수정하신 부분은 아니고.. 간만에 코드를 읽으니까 새롭게 발견한건데
저희 getTargetMessage보다는 findTargetMessage는 어떨까요??

String keyword = slackMessageRequest.getKeyword();
if (StringUtils.hasText(keyword)) {
builder.and(QMessage.message.text.contains(keyword));
private BooleanExpression isLastExpression(final Message targetMessage, final boolean needPastMessage) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

targetMessage에서 postedDate 값만을 매번 꺼내서 쓰네요!
Message가 아니라 LocalDateTime을 받아도 좋을 것 같아요😄

Copy link
Collaborator

Choose a reason for hiding this comment

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

추가로 날짜에 대한 Expression인 것 같아서 이를 드러내는 메서드명이면 더 좋을 것 같아요~

3차 스프린트 automation moved this from In progress to Reviewer approved Jul 25, 2022
Copy link
Collaborator

@hyewoncc hyewoncc left a comment

Choose a reason for hiding this comment

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

연로그가 앞서 꼼꼼하게 봐주신 것 같아요 👍
리팩토링 하고 나니 한결 깔끔하네요, 수고하셨습니다~

@@ -45,16 +44,15 @@ public SlackMessageResponses find(final SlackMessageRequest slackMessageRequest)

private List<Message> findMessages(final SlackMessageRequest slackMessageRequest) {
boolean needPastMessage = slackMessageRequest.isNeedPastMessage();
BooleanBuilder builder = createFindMessagesCondition(slackMessageRequest);
int messageCount = slackMessageRequest.getMessageCount();
Copy link
Collaborator

Choose a reason for hiding this comment

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

아래 limit(messageCount)에서만 쓰이는 것 같네요! 인라인 처리하면 어떨까요?

.or(QMessage.message.postedDate.after(date));
}

private OrderSpecifier<LocalDateTime> dateAscOrDescByNeedPastMessage(final boolean needPastMessage) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

저도 연로그 의견에 동의합니다
arrangeDateBy~ 정도는 어떨까요?

Copy link
Collaborator

@JangBomi JangBomi left a comment

Choose a reason for hiding this comment

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

훨씬 깔끔해졌네요 ~ 👍

@JangBomi JangBomi merged commit ffa9292 into main Jul 25, 2022
3차 스프린트 automation moved this from Reviewer approved to Done Jul 25, 2022
@HJ-Rich HJ-Rich deleted the feature/refactor-message-api branch July 25, 2022 09:34
HJ-Rich pushed a commit that referenced this pull request Aug 6, 2022
hotfix: 잘못된 queryParam 수정 (#329)

hotfix: 로그아웃 에러 수정 (#328)

- 쿠키 삭제 방식 변경

hotfix: 메시지 본문에 작성자 썸네일 주소가 들어가는 오류 수정 (#327)

hotfix: 북마크 메시지의 유저가 본인으로 보이는 오류 정정 (#326)

fix: Slack Redirect Url 환경변수로 등록 (#325)

* fix: Slack Redirect Url 환경변수로 등록

* chore: EOL 제거

fix: 모든 멤버가 본인으로 뜨는 에러 해결 (#324)

* fix: 모든 멤버가 본인으로 뜨는 에러 해결

* refactor: 메시지 응답 빌더 적용

Co-authored-by: Richard JEON <ztzy1907@gmail.com>

hotfix: 누락된 북마크 상태 추가 및 잘못된 query param 수정 (#317)

* fix: channelId 디폴트값 구분 api 전체에 적용

* fix: isBookmarked UI 반영 누락 추가

docs: README 업데이트 (#315)

hotfix: 메인피드에서 날짜 이동 시, channelId 누락되는 문제 해결 (#312)

hotfix: 선택된 채널 다시 선택했을 경우 drawer 닫히지 않는 버그 수정 (#311)

hotfix: 채널 선택시 리렌더링 되지 않는 문제 해결 (#310)

feat: 메인페이지에서 북마크 추가 기능 구현 (#308)

hotfix: Calendar modal 닫히지 않는 버그 수정 (#307)

feat: 메시지 응답 필드에 isBookmarked 추가 (#305)

feat: 최초 사용자 채널 구독 페이지로 이동하도록 구현 (#306)

fix: 누락된 headers 추가 (#304)

feat: 로그인 시 최초 로그인 여부 응답 (#303)

hotfix : 로그인/로그아웃 버그 (#302)

* fix: 로그인 이후, 피드 페이지로 이동하도록 수정

* feat: 랜딩페이지 버튼 누를 시, 슬랙 로그인으로 넘어가도록 수정

* fix: 누락된 PrivateRouter 추가

* fix: 매 요청마다 토큰 쿠키로부터 새로 가져오도록 수정

Revert "feat: 파일 공유 메시지 저장 구현 (#225)" (#298)

This reverts commit 2e92b7f.

feat: 파일 공유 메시지 저장 구현 (#225)

* feat: 파일 공유 메시지 저장 구현

Co-authored-by: JangBomi <bonita9931@gmail.com>
Co-authored-by: Richard Jeon <ztzy1907@gmail.com>

* refactor: 피드백 반영

Co-authored-by: Richard Jeon <ztzy1907@gmail.com>
Co-authored-by: JangBomi <bonita9931@gmail.com>

Co-authored-by: Richard Jeon <ztzy1907@gmail.com>

hotfix: 로그인 후 쿼리 무효화 추가 (#296)

fix: api retry 요청 횟수 수정 및 디폴트 QueryParam 수정 (#295)

test: util 함수 test 코드 작성 (#292)

* refactor: utils 파일에 있던 상수 constants 파일로 이동

* chore: @babel/preset-typescript 설치 및 babel preset 추가 설정

* chore: test 절대경로 설정

- jset.config.js moduleNameMapper 설정 추가

* chore: 불필요한 console.log, type 제거

* feat: test 코드 작성시 필요한 mocking data 생성

* feat: utils 함수 test 코드 작성

- 24시간제의 시간이 입력되면 오전/오후 prefix를 붙여 변환된 시간을 반환하는지 확인한다.
- 서버에서 받아온 ISO 형식의 date 값을 '오전/오후 00:00' 형식의 시간으로 변환된 값을 반환하는지 확인한다.
- 서버에서 받아온 메인 피드 데이터에서 필요한 메시지를 잘 추출해 새로운 배열을 만들어 주는지 확인한다.
- 서버에서 받아온 북마크 피드 데이터에서 필요한 메시지를 잘 추출해 새로운 배열을 만들어 주는지 확인한다.
- date로 들어오는 '어제', '오늘', '특정날짜(2022-8-12)'를 ISO 형식의 date 타입으로 변경 해주는지 확인한다.

* chore: package.json scripts 수정

- test, dev-test 나눠서 적용

* refactor: 불필요한 sampleTest 코드 제거

chore: 서브모듈 업데이트 - redirect-url 오타 수정 (#294)

feat: logback maxHistory 수정. 5 -> 2 (#293)

hotfix: 슬랙 로그인 후 토큰 쿠키에 저장하는 로직 추가 (#290)

* fix: 슬랙 로그인 후 토큰 쿠키에 저장하는 로직 추가

* fix: api 응답 데이터 리턴 방식 수정

* fix: 쿠키에 토큰 저장하는 로직 api 함수로 이동

feat: 토큰 검증 api 구현 (#287)

* feat: 토큰 검증 api 구현

* test: 테스트 메서드명 변경

Co-authored-by: yeon-06 <yeonlog06@gmail.com>
Co-authored-by: hyewoncc <hyewoncc@gmail.com>

feat: 사용자 인증 관련 API 연동 및 실제 토큰 삽입 (#289)

* feat: Headers에 실제 token 삽입

* feat: 배포된 사용자 인증 API 연동

* feat: Mocking API url 수정

feat: 토큰 인증 및 인가 구현 (#276)

* feat: token용 Argument Resolver 구현

* refactor: 헤더 Authorization 값을 ArgumentResolver를 통해 추출하도록 변경

* feat: 토큰 유효성 검증 로직 추가

* test: Mockito 대신 BDDMockito 사용

* feat: 유효한 토큰인지 검사하는 interceptor 구현

* style: 누락된 final 키워드 추가

* style: JwtTokenProvider 메서드 순서 변경

Co-authored-by: hyewoncc <hyewoncc@gmail.com>
Co-authored-by: yeon-06 <rnjstldus2@gmail.com>

refactor: DateDropdown 컴포넌트 리팩터링 (#282)

* refactor: DateDropdown component 비즈니스 로직 분리

- DAY 객체 constants 파일로 이동
- getDateInformation, getMessagesDate 함수 utils 파일로 이동

* refactor: component 네이밍 변경

- DropdownToggle -> DateDropdownToggle
- DropdownMenu -> DateDropdownMenu

* refactor: renderDateOption -> DateDropdownOption component 로 분리

hotfix: axios 인스턴스 수정하여 요청 headers 필요시 구분  (#286)

* fix: privateFetcher, publicFetcher 구분

* fix: npm script 수정

* fix: npm script 수정

hotifx: axios 요청에서 header 누락되는 문제 해결  (#285)

* hotfix: axios header 누락되는 문제 해결

* fix: 중복 header 제거

chore: 서브모듈 redirect-url 수정 (#283)

feat: 슬랙 OAuth 기능 구현 (#281)

* feat: Certification 페이지 구현
- Slack OAuth 이후 Redirect 할 뼈대 페이지 구현

* feat: 슬랙 로그인 api 요청 함수 작성

* feat: 인증 관련 Mock API 수정
- 무조건 성공 케이스로 띄워주도록 수정

* feat: Certification 페이지 성공/실패 처리 추가

feat: 메시지 조회 시 needPastMessage 함께 응답하도록 수정 (#277)

* refactor: message api 조회 시 needPastMessage 응답하도록 수정

* test: 기존 테스트 수정

* test: 테스트 충돌 해결

feat: 메시지 조회 API 에 channelId가 전달되지 않을 경우 로직 수정 (#261)

* feat: 구독중인 채널이 전혀 없을 때에 대응할 예외 클래스 생성

Co-authored-by: Richard Jeon <ztzy1907@gmail.com>
Co-authored-by: JangBomi <bonita9931@gmail.com>

* feat: 메시지 조회 시 헤더에서 유저 아이디 추출

Co-authored-by: Richard Jeon <ztzy1907@gmail.com>
Co-authored-by: JangBomi <bonita9931@gmail.com>

* feat: 채널 구독 리포지토리 내 첫번째 구독 채널 조회 메서드 구현

Co-authored-by: Richard Jeon <ztzy1907@gmail.com>
Co-authored-by: JangBomi <bonita9931@gmail.com>

* feat: channelId가 전달되지 않았을 경우, 회원 정보 조회하여 처리하도록 개선

Co-authored-by: Richard Jeon <ztzy1907@gmail.com>
Co-authored-by: JangBomi <bonita9931@gmail.com>

* test: MessageAcceptanceTest 에 인증 과정 추가

Co-authored-by: Richard Jeon <ztzy1907@gmail.com>
Co-authored-by: JangBomi <bonita9931@gmail.com>

* test: MessageControllerTest RestDocs 업데이트

Co-authored-by: Richard Jeon <ztzy1907@gmail.com>
Co-authored-by: JangBomi <bonita9931@gmail.com>

* test: 채널 id가 전달되지 않은 경우 service test 추가

Co-authored-by: Richard Jeon <ztzy1907@gmail.com>
Co-authored-by: JangBomi <bonita9931@gmail.com>

* fix: 제거했던 메서드 복원

Co-authored-by: Richard Jeon <ztzy1907@gmail.com>
Co-authored-by: JangBomi <bonita9931@gmail.com>

Co-authored-by: JangBomi <bonita9931@gmail.com>

feat: 채널 구독 순서 예외 케이스 처리 (#275)

* feat: viewOrder가 중복으로 들어올 경우 예외처리 추가

* feat: 구독 채널 아이디가 올바르게 들어오지 않은 경우에 대한 예외처리 추가

* style: when & then 주석 추가

* refactor: test code 함수 추출

* fix: 테스트코드 오류 수정

* feat: 채널 구독 순서가 1 미만인 경우 예외 발생

feat: 북마크 삭제 기능 구현 (#269)

* feat: 북마크 삭제 기능 구현

* refactor: 북마크 삭제 실패 예외 이름 변경

Co-authored-by: yeon-06 <yeonlog06@gmail.com>
Co-authored-by: hyewoncc <hyewoncc@gmail.com>

refactor: usePortal 리팩터링 (#271)

* chore: tsconfig outDir 설정 추가

* refactor: useEffect 스크롤 사이드 이팩트 usePortal custom hook으로 분리

* refactor: usePortal -> useModal 로 네이밍으로 변경

* refactor: DateDropdown component 중복되는 로직 useModal custom hook으로 변경

* refactor: 변경된 custom hook 적용

* refactor: 리렌더링시 DateDropdownMenu 사라지는 문제 해결

- fetch시 onsettled 제거
- useMessageData custom hook에 useEffect 로직 추가

* chore: 불필요한 import문 제거

feat: Jenkinsfile 삭제 (#272)

feat: 인증 인가 및 로그아웃 기능 (#262)

* feat: 로그인 상태 확인 api 모킹
- header 를 모든 axios 요청에 넣어주도록 수정

* feat: 쿠키 저장/삭제/조회 함수 작성 및 적용
- Header 에 쿠키에 있는 값 가져오도록 구현
- Cookie Key 상수화

* refactor: 불필요한 import 제거

* feat: Private Router 컴포넌트 구현

* refactor: auth 확인 mock api 메서드 수정
- post -> get

* feat: PrivateRouter 적용

* fix: PrivateRouter 수정
- useErrorBoundary 옵션 추가
- early return 적용

* feat: PublicRouter 구현 및 적용

* feat: 랜딩페이지 NavBar 제거

* refactor: 쿼리키 배열->string 으로 수정

* fix: token 요청마다 get 하도록 수정
- 이전에는, axios 객체 생성 시 최초로 cookie 에서 가져왔는데, 현재는 매 요청마다 get 하여 최신 쿠키 상태 반영하도록 수정함

* feat: useAuthentication hook 작성하여 임시 로그인 플로우 구현

* feat: 로그인 여부 확인 모킹 API 에서 토큰 확인하도록 수정

* refactor: useSnackbar 훅 리팩터링
- optional chaning 추가하여 타입 에러 캐치
- 함수 하나만 반환하도록 수정

* fix: 세미콜론 제거

* fix: 중간 화면 깜빡이는 버그 해결

* refactor: Cookie value 파싱 정규식 수정

* refactor: 정규식 주석 첨부

* feat: Snackbar 성공/실패 status 구분

* refactor: Snackbar status type 상수화

feat: 북마크 조회 기능 구현 (#257)

* feat: 북마크 조회 구현

* test: 북마크 생성 서비스 테스트 검증 방식 변경

* refactor: 조회 정렬 조건을 요구사항에 맞게 정정

* refactor: BookmarkResponse에 Builder 패턴 적용

* style: 개행 추가

Co-authored-by: yeon-06 <yeonlog06@gmail.com>
Co-authored-by: hyewoncc <hyewoncc@gmail.com>

feat: 북마크 API 변경된 명세 적용 (#268)

feat: 선택된 채널의 피드만 보여주는 기능 (#260)

* refactor: path에 channelId 추가

* refactor: getMessages API fetcher에 channelId 관련 로직 추가 및 Param type 네이밍 변경

* refactor: Calendar, Drawer, DropdownMenu Component Link tag to 프로퍼티에 channelId 추가

* refactor: Feed, SpecificDateFeed component에 channelId 추가

* chore: authorization sample token 값 변경, style 수정

* refactor: DATE 객체 constants 폴더로 이동 및 "어제", "오늘" 상수로 변경

* refactor: 불필요한 Dropdown component 제거 및 Feed Page component에 적용

* refactor: 하위 컴포넌트에서 호출하는 useParams, Portal -> Page component로 이동 후 Props로 전달

- Calendar, dropdownMenu 에 있는 useParams, Portal -> Feed, SpecificDateFeed로 이동

feat: 북마크 생성 구현 (#249)

* feat: 북마크 생성 구현

* style: 코드 컨벤션 적용

refactor: MemberInitializer에 빈 주입 및 테스트에서 비활성화   (#252)

* refactor: MemberInitializer에 빈 주입 및 Profile 설정

* refactor: 슬랙 api 호출을 위한 봇 토큰을 빈 생성 시 설정

* refactor: 메서드 명 개선

feat: Calendar 컴포넌트 적용 (#251)

* feat: usePortal custom hook 개발

* refactor: ISOConverter util 함수로 분리

- src/@utils 폴더로 함수 이동
- 오늘, 어제가 아닌 경우 convert 해주는 로직 추가

* refactor: 기존 로직 usePortal custom hook으로 변경

* feat: 기존로직에 Calendar component 적용

* refactor: utils 파일 상수처리

* refactor: 캘린더 오픈되었을 때 scroll 고정 시키는 기능 추가

feat: 달력 컴포넌트 개발 (#246)

* feat: Calendar component 개발 및 스토리북 작성

* feat: useCalendar custom hook 분리

* refactor: WrapperButton component props 추가(isFuture)

* refactor: Props type 변경

* refactor: Calendar component 중복되는 로직 제거

feat: Slack OAuth를 이용한 인증 구현 (#233)

* feat: 슬랙 OAuth 2를 이용한 인증 로직 구현

* test: 인증 인수 테스트 추가

* chore: 서브모듈 jwt, 슬랙 api 호출 정보 업데이트

* test: Mockito 대신 BDDMockito 사용

Co-authored-by: hyewoncc <hyewoncc@gmail.com>
Co-authored-by: yeon-06 <yeonlog06@gmail.com>

test: 프론트엔드 단위 테스트 및 스토리북 빌드/배포 자동화 스크립트 작성 (#242)

* chore: 스토리북 배포를 위한 chromatic 설치

* docs: 스토리북 자동 배포/빌드 yml 파일 작성

* chore: EOL 제거

* fix: chromatic devDependency 로 이동

* test: 샘플 테스트 파일 작성
- eslint 수정

* docs: unit test 자동화 yml 파일 작성

* docs: 스토리북 배포 스크립트 수정
- push 시에만 배포하도록 수정

* fix: checkout version 수정

* fix: workingDir 변수로 수정

fix: Spring Rest Docs 가 배포환경에서도 작동하도록 수정 (#243)

* refactor: build.gradle에서 RestDocs 부분 개선

* refactor: api.adoc 이름 index.adoc 으로 변경

* refactor: api 문서(index.html)을 jar 파일 내부에 포함될 수 있도록 build.gradle 수정

docs: issue template 및 Rest Docs 문서 수정 (#229)

* docs: issue template 수정

Co-authored-by: JangBomi <bonita9931@gmail.com>
Co-authored-by: Richard Jeon <ztzy1907@gmail.com>

* docs: Rest Docs snippets 수정

Co-authored-by: JangBomi <bonita9931@gmail.com>
Co-authored-by: Richard Jeon <ztzy1907@gmail.com>

Co-authored-by: Richard Jeon <ztzy1907@gmail.com>

test: Storybook 누락 파일 추가,정리 및 배포 (#240)

* fix: storybook MemoryRouter 적용

* refactor: 누락된 스토리북 추가 및 정리

hotfix: 삭제된 Styled Component 복구 (#239)

* fix: 삭제된 Container 복구

* refactor: 누락된 getAuthorization 함수 실행 추가

refactor: 누락된 타입 보강 (#238)

* refactor: 커스텀훅 ReturnType 정의

* refactor: accessToken 반복적으로 선언해주는 것 수정
- getAuthorization 함수 작성

* refactor: 상수에 as const 추가

* refactor: getMessages API 호출 함수 매개변수 타입 정의

* refactor: getBookmark 매개변수 타입 정의

* refactor: Styled Component Props 타입 정의 및 적용
- 이전에 theme:Theme interface 를 매번 정의해줘야 했던 문제를 StyledDefaultProps 타입을정의해줌으로써 해결

feat: 메시지 조회 시, 빈 문자열을 담은 메시지 필터링 (#231)

* feat: 메시지 조회 시, 빈 문자열을 담은 메시지 필터링

Co-authored-by: JangBomi <bonita9931@gmail.com>
Co-authored-by: Richard Jeon <ztzy1907@gmail.com>

* refactor: 피드백 반영

Co-authored-by: Richard Jeon <ztzy1907@gmail.com>
Co-authored-by: JangBomi <bonita9931@gmail.com>

Co-authored-by: Richard Jeon <ztzy1907@gmail.com>

style: NotFound component style 추가 (#235)

style: Unexpected Error component style 추가 (#223)

* style: Unexpected Error component style 추가

* chore: FlexColumn {} 중괄호 제거

* refactor: UnexpectedError description 작성 및 스타일링 추가

feat: 북마크 기능 추가 (#230)

* feat: 북마크 조회 api 모킹

* faet: 북마크 조회 api 함수 작성

* feat: 북마크 렌더링 페이지 구현

* refactor: bookmark -> bookmarks 로 네이밍 수정

* refactor: MSW handlers, data 도메인 별 분리

* feat: 북마크 여부에 따라서 버튼 색상 바뀌도록 수정

* feat: 북마크 추가/해제 API 작성 및 모킹

* refactor: 모킹 API body type util 에 저장

* feat: useBookmark hook 작성
- 북마크 추가/해제 mutation hook 작성
- handleSettle props 로 받아오도록 구현

* feat: useBookmark 적용
- Bookmark 페이지, Feed 페이지, SpecificDateFeed 페이지 내 useBookmark 적용
- MessageCard Props 로 북마크 추가 핸들러 받아오도록 수정

* fix: 사용하지 않는 props 제거

feat: suspense를 사용한 loading 상태 구현 (#220)

* chore: authorization default token 값 변경

* feat: LazyLoading component 개발

* feat: Loadable Component 생성 및 lazy loading, suspense 설정

* refactor: Routes에 lazy loading component 적용

* chore: package-lock.json 변경

* refactor: LazyLoading component -> Loader component로 component명 변경

feat: 유저 프로필 업데이트 이벤트 발생 시 정보 업데이트 (#211)

* feat: 사용자 이름 및 프로필 이미지 변경 이벤트 구현

Co-authored-by: yeon-06 <yeonlog06@gmail.com>
Co-authored-by: hyewoncc <hyewoncc@gmail.com>

* feat: 사용자 이름 및 프로필 이미지 값 검증 구현

Co-authored-by: yeon-06 <yeonlog06@gmail.com>
Co-authored-by: hyewoncc <hyewoncc@gmail.com>

* refactor: 슬랙 이벤트의 type과 subtype 추출 위치 변경

Co-authored-by: yeon-06 <yeonlog06@gmail.com>
Co-authored-by: hyewoncc <hyewoncc@gmail.com>

* refactor: 빈 문자열 검증 방식 변경

Co-authored-by: yeon-06 <yeonlog06@gmail.com>
Co-authored-by: hyewoncc <hyewoncc@gmail.com>

* refactor: display_name이 없을 시 username을 real_name으로 변경

Co-authored-by: yeon-06 <yeonlog06@gmail.com>
Co-authored-by: hyewoncc <hyewoncc@gmail.com>

* refactor: 슬랙 이벤트의 type과 subtype 추출 방식 롤백

* style: 컨벤션 관련 코드 리뷰 반영

Co-authored-by: yeon-06 <yeonlog06@gmail.com>

feat: 스낵바 컴포넌트 구현 (#215)

* chore: recoil 설치

* feat: recoil 초기 설정 및 스낵바 atom 작성

* feat: Snackbar 컴포넌트 구현
- useSnackbar 훅 구현
- Snackbar 컴포넌트 작성

hoxfix: 젠킨스 빌드 시 테스트 실행하도록 스크립트 변경 (#219)

hotfix: 젠킨스 빌드 시 테스트 미실행 (#217)

* hotfix: 빌드 명령어에 --info 옵션 추가

* hotfix: Jenkinsfile에서 빌드 시 테스트 시행하지 않음

hotfix: 빌드 명령어에 --info 옵션 추가 (#216)

feat: Slack Event 요청값 로깅 (#213)

Co-authored-by: JangBomi <bonita9931@gmail.com>
Co-authored-by: Richard Jeon <ztzy1907@gmail.com>

Co-authored-by: Richard Jeon <ztzy1907@gmail.com>

feat: 채널 동적 생성 구현 (#200)

* feat: 채널 동적 생성 구현

Co-authored-by: Richard Jeon <ztzy1907@gmail.com>
Co-authored-by: JangBomi <bonita9931@gmail.com>

* test: 피드백 반영

Co-authored-by: JangBomi <bonita9931@gmail.com>
Co-authored-by: Richard Jeon <ztzy1907@gmail.com>

Co-authored-by: JangBomi <bonita9931@gmail.com>

chore: 테스트용 yml 서브모듈 적용 (#207)

* chore: 테스트 yml 서브모듈 추가

* chore: gitignore에서 application.yml 제외

* chore: 서브모듈 업데이트 적용

hotfix: TimeUtils 변환 로직 수정, 백엔드 CI 테스트 스크립트 타임존 설정 추가 (#209)

* feat: 백엔드 CI 스크립트에 TimeZone을 Asia/Seoul로 설정

* fix: TimeUtils 변환 로직 수정. systemDefault -> Asia/Seoul

feat: error boundary 구현 (#208)

* feat: ErrorBoundary component 개발

* feat: UnexpectedError component 개발

* feat: ErrorBoundary, UnexpectedError component 적용

hotfix: ChannelDeletedServiceTest 테스트 격리 처리 (#205)

* fix: ChannelDeletedServiceTest 테스트 격리를 위한 Sql 애너테이션 및 truncate 추가

* style: RestDocs를 위한 컨트롤러 테스트에 우테코 코드 스타일 적용

feat: 채널명 변경 이벤트 및 채널 삭제 이벤트 적용 (#187)

* feat: 채널명 변경 이벤트 API 구현

Co-authored-by: JangBomi <bonita9931@gmail.com>
Co-authored-by: Richard Jeon <ztzy1907@gmail.com>

* feat: 채널 삭제 이벤트 API 구현

Co-authored-by: JangBomi <bonita9931@gmail.com>
Co-authored-by: Richard Jeon <ztzy1907@gmail.com>

* feat: SlackEvent 추가

Co-authored-by: JangBomi <bonita9931@gmail.com>
Co-authored-by: Richard Jeon <ztzy1907@gmail.com>

* refactor: 코드 리포맷팅

Co-authored-by: JangBomi <bonita9931@gmail.com>
Co-authored-by: Richard Jeon <ztzy1907@gmail.com>

* refactor: 코드리뷰 반영

Co-authored-by: JangBomi <bonita9931@gmail.com>
Co-authored-by: Richard Jeon <ztzy1907@gmail.com>

* test: ChannelDeletedServiceTest 관련 피드백 반영

* test: 채널 삭제 이벤트 발생 시, 채널 존재 여부 검증하지 않도록 변경

Co-authored-by: JangBomi <bonita9931@gmail.com>
Co-authored-by: Richard Jeon <ztzy1907@gmail.com>

* feat: Slack의 유효하지 않은 요청에 대응하는 예외 생성

Co-authored-by: JangBomi <bonita9931@gmail.com>
Co-authored-by: Richard Jeon <ztzy1907@gmail.com>

* feat: 채널명 변경 시도 시 유효성 검증 로직 도메인 객체에 추가

Co-authored-by: JangBomi <bonita9931@gmail.com>
Co-authored-by: Richard Jeon <ztzy1907@gmail.com>

Co-authored-by: Richard Jeon <ztzy1907@gmail.com>

feat: Github Actions를 이용한 Backend CI 테스트 자동화 (#180)

* feat: Github Actions를 통한 테스트 자동화 설정 파일 추가

* refactor: Github Repository Secret 명칭 변경

* refactor: 백엔드 CI 테스트 자동화 설정 리팩터링

hotfix: 채널 목록 조회 API Endpoint 수정  (#203)

* hotfix: api endpoint 수정

Co-authored-by: Jaejeung Ko <kkojae91@users.noreply.github.com>

* refactor: Drawer 오픈 시, 구독 채널 목록 refetch

Co-authored-by: Jaejeung Ko <kkojae91@users.noreply.github.com>

Co-authored-by: Jaejeung Ko <kkojae91@users.noreply.github.com>

refactor: WrapperLink component에 Link tag NavLink tag로 변경 (#202)

* chore: layouts 폴더 -> @layouts 폴더명 변경

Co-authored-by: moonheekim0118 <hellomooneekim@gmail.com>

* refactor: Link tag -> NavLink로 변경

Co-authored-by: moonheekim0118 <hellomooneekim@gmail.com>

* refactor: WrapperLink component Function as child component 형태로 리펙터링

Co-authored-by: moonheekim0118 <hellomooneekim@gmail.com>

* refactor: Function as child component 형태 적용

Co-authored-by: moonheekim0118 <hellomooneekim@gmail.com>

Co-authored-by: moonheekim0118 <hellomooneekim@gmail.com>

feat: 구독 중인 채널 Drawer에 보여주는 기능 (#198)

* refactor: 불필요한 mocking handler 제거

Co-authored-by: moonheekim0118 <hellomooneekim@gmail.com>

* feat: SubscribedChannel, ResponseSubscribedChannels 타입 추가

Co-authored-by: moonheekim0118 <hellomooneekim@gmail.com>

* feat: getSubscribedChannels API fetcher 추가 및 api path 상수화

Co-authored-by: moonheekim0118 <hellomooneekim@gmail.com>

* chore: 개행 추가

Co-authored-by: moonheekim0118 <hellomooneekim@gmail.com>

* feat: Drawer component 서버 API 연동

Co-authored-by: moonheekim0118 <hellomooneekim@gmail.com>

Co-authored-by: moonheekim0118 <hellomooneekim@gmail.com>

test: 메시지 조회 API 인수테스트 한글 검색 케이스 추가 (#197)

* test: 메시지 조회 API 인수테스트 한글 검색 케이스 추가

* test: 메시지 조회 API 인수테스트 영문 검색 케이스 추가

fix: TimeZone UTC+9 설정 (#196)

* fix: TimeZone UTC+9 설정

* refactor: TimeConfig -> TimeZoneConfig 클래스 명 변경

hotfix: jenkinsfile 수정 (#195)

refactor: 검색어로 메시지 조회시 대소문자 무시하도록 개선, 테스트 픽스처 수정 (#178)

fix: 머지 과정에서의 import issue 및 TC 깨짐 문제해결 (#194)

chore: Spring REST Docs 적용 (#174)

* chore: RestDocs 기본 설정

* feat: 전체 채널 조회 API Docs Test 작성

* feat: 채널 구독 관련 API Docs Test 작성

* refactor: ChannelSubscriptionControllerTest로부터 ChannelControllerTest 분리

* feat: 메시지 조회 관련 API Docs Test 작성

* feat: 현재 만들어진 Rest Docs API 명세 문서에 PathVariable, RequestParam, RequestBody, RequestHeader 정보 추가

* refactor: channel.sql 에서 channel-subscription 관련 내용 channel-subscription.sql 로 분리

* refactor: api.adoc 이름 변경 및 패키지 이동

* refactor: 불필요한 주석 삭제

* refactor: 불필요한 주석 삭제

* refactor: channel-subscription.sql 마지막 한 줄 추가

* refactor: reformatting code

refactor: 메시지 조회 API 네이밍 관련 추가 리팩터링 (#172)

refactor: url pathname 케밥케이스 적용 (#192)

refactor: query key 상수화 (#190)

refactor: 양방향 무한 스크롤 로직 리팩토링 및 Feed Page 리팩토링 (#188)

수정된 채널 구독/해제 API 반영 (#184)

refactor: 구독 생성, 삭제 API 스펙 변경 (#183)

Co-authored-by: hyewoncc <hyewoncc@gmail.com>
Co-authored-by: JangBomi <bonita9931@gmail.com>

Co-authored-by: hyewoncc <hyewoncc@gmail.com>

fix: 패키지 구조 변경 후 QMessage import 이슈 수정 (#171)

refactor: 백엔드 패키지 구조 변경 (#167)

* refactor: 채널 관련 도메인 패키지 분리

* refactor: 멤버 관련 도메인 패키지 분리

* refactor: 메시지 관련 도메인 패키지 분리

Co-authored-by: yeon-06 <yeonlog06@gmail.com>
Co-authored-by: hyewoncc <hyewoncc@gmail.com>
Co-authored-by: Richard Jeon <ztzy1907@gmail.com>
Co-authored-by: JangBomi <bonita9931@gmail.com>

* refactor: Slack Event 관련 도메인 패키지 분리

Co-authored-by: yeon-06 <yeonlog06@gmail.com>
Co-authored-by: hyewoncc <hyewoncc@gmail.com>
Co-authored-by: Richard Jeon <ztzy1907@gmail.com>
Co-authored-by: JangBomi <bonita9931@gmail.com>

* refactor: 테스트 패키지 구조 변경

Co-authored-by: yeon-06 <yeonlog06@gmail.com>
Co-authored-by: hyewoncc <hyewoncc@gmail.com>
Co-authored-by: Richard Jeon <ztzy1907@gmail.com>
Co-authored-by: JangBomi <bonita9931@gmail.com>

Co-authored-by: yeon-06 <yeonlog06@gmail.com>
Co-authored-by: hyewoncc <hyewoncc@gmail.com>
Co-authored-by: JangBomi <bonita9931@gmail.com>

refactor: 메시지 조회 API 동적 쿼리 생성 로직 리팩터링 (#158)

* refactor: 메시지 조회 동적 조건 리팩터링

* test: 날짜로 조회할 경우, 해당 날짜를 포함하여 검색하도록 검증할 수 있게 픽스처를 수정

* refactor: isLast 검색 조건 리팩터링

* feat: jpaQueryFactory 생성자 주입 가능하도록 Bean 생성 Config 추가

test: 채널 구독에 대한 서비스 테스트 추가 (#152)

* test: ChannelSubscription Service 테스트 추가

* test: SlackEvent가 존재하지 않는 경우 test 추가

* refactor: 코드리뷰 반영
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

메시지 조회 API 동적 쿼리 생성부분 리팩터링
4 participants