Conversation
| int month, | ||
| int driveCount | ||
| ) { | ||
| // public static List<AdminBizMonthlyResponse> toDto(List<MonthlyStatisticEntity> monthlyStatisticEntities) { |
There was a problem hiding this comment.
p1
사용하지 않는 주석은 지워주시면 감사하겠습니다!
There was a problem hiding this comment.
p1 사용하지 않는 주석은 지워주시면 감사하겠습니다!
수정했습니다
|
|
||
| if (response == null) | ||
| return new AdminBizStatisticResponse(0, 0, 0); | ||
| else |
There was a problem hiding this comment.
p5
else는 없는 게 가독성이 더 좋을 것 같습니다!
참고만 해주세요!
There was a problem hiding this comment.
p5 else는 없는 게 가독성이 더 좋을 것 같습니다! 참고만 해주세요!
수정했습니다
| int month, | ||
| int driveCount | ||
| ) { | ||
| // public static List<AdminBizMonthlyResponse> toDto(List<MonthlyStatisticEntity> monthlyStatisticEntities) { |
There was a problem hiding this comment.
필요 없는 코드면 지워도 좋을 것 같습니다!
There was a problem hiding this comment.
필요 없는 코드면 지워도 좋을 것 같습니다!
수정했습니다
| .toResponse(carCountWithBizName, carTypeCount, operationRateWithBizName, nonOperatedCarWithBizName)); | ||
| } | ||
|
|
||
| private Long mapToBizId(String bizName) { |
There was a problem hiding this comment.
해당 함수는 bizProvider에 있어도 좋을것 같습니다.
There was a problem hiding this comment.
해당 함수는 bizProvider에 있어도 좋을것 같습니다.
수정했습니다
| ) { | ||
| Long bizId = mapToBizId(adminStatisticRequest.bizName()); | ||
|
|
||
| return ApiResponse.success(HourlyGraphResponse |
There was a problem hiding this comment.
return ApiResponse.success(HourlyGraphResponse
.toResultList(adminStatisticProvider
.getAdminBizHourlyDriveCount(bizId, adminStatisticRequest.selectedDate())));
코드를 파악하기 조금 어려운 것 같아요
개인 취향이지만, 저는 이런식으로 작성합니다
return ApiResponse.success(
HourlyGraphResponse.toResultList(
adminStatisticProvider.getAdminBizHourlyDriveCount(
bizId, adminStatisticRequest.selectedDate()
)
)
);
There was a problem hiding this comment.
return ApiResponse.success(HourlyGraphResponse .toResultList(adminStatisticProvider .getAdminBizHourlyDriveCount(bizId, adminStatisticRequest.selectedDate())));코드를 파악하기 조금 어려운 것 같아요 개인 취향이지만, 저는 이런식으로 작성합니다
return ApiResponse.success( HourlyGraphResponse.toResultList( adminStatisticProvider.getAdminBizHourlyDriveCount( bizId, adminStatisticRequest.selectedDate() ) ) );
좋은 방법인 것 같습니다 파악하기도 좋고 실수도 적어지겠네요
| List<AdminBizMonthlyResponse> response = adminStatisticRepository.getTotalDriveCountInOneYear(bizId, | ||
| selectedDate); | ||
|
|
||
| if (response == null) { |
There was a problem hiding this comment.
값이 없다면
return new AdminBizStatisticResponse(0, 0, 0);
위 코드처럼 기본값을 내려주거나, 예외를 던져주는게 프론트측에서 처리하는 데 일관성이 생길 것 같은데, 어떻게 생각하시나요?
There was a problem hiding this comment.
값이 없다면 return new AdminBizStatisticResponse(0, 0, 0); 위 코드처럼 기본값을 내려주거나, 예외를 던져주는게 프론트측에서 처리하는 데 일관성이 생길 것 같은데, 어떻게 생각하시나요?
프론트에서는 map으로 배열을 처리하도록 되어있어서 List.of()로 빈 배열을 내려도 별다른 문제가 생기지 않는걸로 알고 있습니다
빈 배열과 0,0,0 기본값 모두 그래프에서는 동일하게 표현되어서 이대로 유지해도 괜찮을 것 같습니다
There was a problem hiding this comment.
배열이라 빈값이 가도 확실히 괜찮겠네요
좋습니다!
| )) | ||
| .from(monthlyStatisticEntity) | ||
| .where( | ||
| (bizId != null |
There was a problem hiding this comment.
bizId가 null이면 자연스럽게 True 처리되는거로 알고있는데, 같이 테스트해보고 검증하면 좋을 것 같습니다.
There was a problem hiding this comment.
bizId가 null이면 자연스럽게 True 처리되는거로 알고있는데, 같이 테스트해보고 검증하면 좋을 것 같습니다.
null일 경우 500을 뱉는걸로 기억하고 있는데 내일 한 번 다시 테스트해보겠습니다
| return bizDomainRepository.existsByBizRegNum(bizRegNum); | ||
| } | ||
|
|
||
| public BizEntity getBizByBizName(String bizName) { |
There was a problem hiding this comment.
Long GetBizIdByBizName으로 처리해도 좋을 것 같습니다.
There was a problem hiding this comment.
Long GetBizIdByBizName으로 처리해도 좋을 것 같습니다.
위에서 mapToBizId가 provider로 넘어가면서 사용하지 않는 메서드가 되었습니다. 이 메서드는 삭제 후 올리겠습니다
tracky-web/src/main/java/kernel360/trackyweb/car/domain/provider/CarDomainProvider.java
Show resolved
Hide resolved
| @PostMapping("/create-daily") | ||
| public String createDaily() { | ||
| schedulerService.monthlyStatistic(LocalDate.now().minusDays(1)); | ||
| return "ok"; |
There was a problem hiding this comment.
공통 응답 객체를 사용 안하신 이유가 있나요?
There was a problem hiding this comment.
공통 응답 객체를 사용 안하신 이유가 있나요?
테스트용 메서드였는데 같이 딸려 올라간 것 같습니다 수정해서 올렸습니다
59593a0 to
1824bcd
Compare
#️⃣연관된 이슈
📝작업 내용
관리자 통계 API 추가 및 프론트와 연결했습니다.
프론트도 PR 올렸습니다