-
Notifications
You must be signed in to change notification settings - Fork 2
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
[FEAT] 동방 현황 기능을 구현합니다. #145
Conversation
- 개발자가 실수 : IllegalStateException - 사용자가 실수 : IllegalArgumentException
- ActiveDeviceFinder : Active 상태인 Device를 판별하고 찾는 역할 - ActiveDeviceRepository : Active 상태인 Device를 저장하는 역할 - ActiveTimeCalculator : Active 상태와 관련된 시간을 계산하는 역할
- Events : 이벤트 관련 static 유틸 - EventConfiguration : 이벤트와 관련된 설정 클래스 - Event : 이벤트의 최상위 계층 인터페이스
- ActiveDeviceFinded : ActiveDevice를 찾은 이벤트 - ActiveDeviceEventHandler : ActiveDevice와 관련된 이벤트를 처리하는 핸들러
- findAll 메소드 추가
- ActiveDeviceListResponse : Active 상태인 기기들 정보의 응답 - ActiveDeviceResponse : Active 상태인 기기 정보의 응답
- DeviceRepository 추가 - Device 엔티티 추가 (임시)
- device의 주인을 찾는 메소드 - device들의 주인을 찾는 메소드
- ActiveDeviceViewer : query DB에서 ActiveDevice 를 조회하는 Viewer - ActiveDevice : query DB에서 조회한 ActiveDevice 클래스
- api-query-jpa 모듈에서 사용할 조회용 엔티티
- main api 모듈의 ActiveDeviceViewer 구현체
- Objects.nonNull 메소드로 null인 요소 배제
- find -> activeDeviceFind - inActiveDeviceFind 메소드 추가
- 임시적으로 구현 - 추후 리팩토링 예정 - 스프링 스케줄러 사용
- ActiveDevice 와 관련된 이벤트 핸들러 - ActiveDeviceFinded 이벤트 처리 - InActiveDeviceFinded 이벤트 처리
- findByUpdatedAtAfterOrderByUpdatedAtDesc : ActiveDevice 들을 찾기 위함
- 이벤트 핸들러에서 Log 정보 필요
- findAll() : 모니터 로그 전부 조회 - findByUpdatedAtAfterOrderByUpdatedAtDesc : ActiveDevice 찾는 데 필요
- ActiveDeviceFinder -> DeviceStatusManager
- SpringActiveDeviceFinder -> SpringDeviceStatusManager
- ActiveDeviceEventHandler -> DeviceStatusEventHandler
- findByMemberId
- ActiveDeviceFilter : 이미 Active 인 경우 이벤트에서 제외 - InActiveDeviceFilter : 이미 InActive 인 경우 이벤트에서 제외
- DeviceStatusEventHandler 삭제 - ActiveDeviceEventHandler 와 InActiveDeviceEventHandler 로 분리 - ActiveDeviceEventHandler 저장 로직 수정
- inactiveTime null로 초기화
- Duration.abs 메소드 사용
- 연속 접속 시간 계산 로직 수정 - TODO 추가
- activeTime -> connectedTime - inActiveTime -> disConnectedTime
- ActiveDeviceRepository 생성 - ActiveDeviceJpaViewer JPA 적용
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.
Code review by ChatGPT
import jakarta.persistence.Id; | ||
import jakarta.persistence.FetchType; | ||
import jakarta.persistence.JoinColumn; | ||
import jakarta.persistence.OneToMany; |
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.
이 코드 패치에 대한 간단한 코드 리뷰는 다음과 같습니다:
-
이 코드는 jakarta.persistence.JoinColumn을 가져오는 데 세미콜론이 누락되어 있어서 코드가 완전하지 않았습니다. 이 패치는 이 문제를 해결합니다.
-
개선 제안은 없습니다. 이는 이전 코드에 문제가 있었고, 이 패치가 그 문제를 정확하게 해결했기 때문입니다.
-
에러가 나는 요소가 있었지만, 수정 된 코드에서는 파악되지 않습니다.
-
이 코드를 통합하면 이전 버전의 오류가 해결될 것입니다.
그러나 이 코드의 기능 및 행동이 올바르게 작동하는지 확인하려면 전체 프로젝트나 이 코드 패치가 적용되는 다른 코드 부분을 보고 이해하거나, 이 변경 사항에 대한 테스트 케이스가 필요합니다. 이 패치가 별도의 기능을 수정하는 경우, 해당 기능은 단위 테스트를 통해 완전히 테스트되어야 합니다.
[REFACTOR] ActiveDevice JPA 적용
close #119
📌 관련 이슈
#119
✨ PR 내용
🤓 리뷰어에게