-
Notifications
You must be signed in to change notification settings - Fork 1
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/#60 View Server - Log 조회 서비스 및 API 구현 #62
Conversation
- Lombok 의존을 추가했습니다. - MySQL R2DBC Driver를 추가했습니다.
- Log DB Entity를 구현했습니다. - DB Entity는 post-fix로 Data를 붙입니다.
- Log Domain Entity를 구현했습니다. - DB 엔티티와 매핑으로만 생성되도록 정적 팩토리 메서드를 활용했습니다.
- DB 엔티티와 도메인 엔티티를 매핑해주는 LogService를 구현했습니다. - 이에 따른 테스트를 추가했습니다.
- AppKey 기반 조회 이후 결과를 반환하는 서비스 로직을 구현했습니다. - 이에 따른 테스트를 추가했습니다.
- AppKey 기반 조회 이후 결과를 반환하는 API를 구현했습니다.
Risk Level 2 - /home/runner/work/Team5-Guys/Team5-Guys/logbat_view/src/main/java/info/logbat_view/domain/log/presentation/LogViewController.java The controller method 'getLogs' does not handle potential errors from 'logViewService.findLogs(appKey)'. Consider adding error handling to return appropriate HTTP responses. For example: @GetMapping(\"/{appKey}\")
public Flux<ResponseEntity<LogCommonResponse>> getLogs(@PathVariable String appKey) {
return logViewService.findLogs(appKey)
.map(ResponseEntity::ok)
.onErrorReturn(ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).build());
} Risk Level 2 - /home/runner/work/Team5-Guys/Team5-Guys/logbat_view/src/main/java/info/logbat_view/domain/log/application/LogViewService.java The method 'findLogs' directly maps the result from 'logService.findLogsByAppKey(appKey)'. Consider adding error handling to manage potential exceptions from the service call. For example: try {
return logService.findLogsByAppKey(appKey).map(LogCommonResponse::from);
} catch (Exception e) {
// Handle exception
} 🔍 Powered by Code Review GPT |
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.
webflux 신기하네요!! 좋아요!
@Getter | ||
@Table("logs") | ||
@AllArgsConstructor | ||
public class LogData { | ||
|
||
@Id | ||
private Long logId; | ||
private String appKey; | ||
private String level; | ||
private String data; | ||
private LocalDateTime timestamp; | ||
} |
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.
궁금한 점:
jdbc로 제가 직접 UUID를 저장할 때는 binary로 고쳐서 넣었는데,
r2dbc를 사용했을 때, 해당 작업이 자동으로 일어나는지 궁금합니다!!
DB Column이 BINARY(16)으로 지정되어 있습니다!
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.
누락된것 같습니다! :C
리팩토링 이슈에서 추가하도록 하겠습니다 :D
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.
불변성 객체로 변경 여부 한번 검토 부탁드립니다!
Spring Data Relational / Introduction / Object Mapping Fundamentals / General recommendations
|
||
@Getter | ||
@Table("logs") | ||
@AllArgsConstructor |
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.
이 단일 생성자를 통해서 객체를 생성하는 것 같아 final
을 사용해서 불변성 객체로 만들면 어떨지 제안드립니다!
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.
리팩 이슈에서 반영하도록 하겠습니다!
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.
코드 잘 봤습니다!
* init: 의존성 추가 - Lombok 의존을 추가했습니다. - MySQL R2DBC Driver를 추가했습니다. * feat: Log DB Entity 구현 - Log DB Entity를 구현했습니다. - DB Entity는 post-fix로 Data를 붙입니다. * feat: Log Domain Entity 구현 - Log Domain Entity를 구현했습니다. - DB 엔티티와 매핑으로만 생성되도록 정적 팩토리 메서드를 활용했습니다. * feat: Log Domain Mapping Service 구현 - DB 엔티티와 도메인 엔티티를 매핑해주는 LogService를 구현했습니다. - 이에 따른 테스트를 추가했습니다. * feat: Log 조회 기능 구현 - 서비스 - AppKey 기반 조회 이후 결과를 반환하는 서비스 로직을 구현했습니다. - 이에 따른 테스트를 추가했습니다. * feat: Log 조회 기능 구현 - API - AppKey 기반 조회 이후 결과를 반환하는 API를 구현했습니다.
🚀 작업 내용
Warning
페이지네이션 적용 예정입니다!
📸 이슈 번호