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

feat: 영양사님 엑셀 다운로드 기능 구현 #947

Merged
merged 3 commits into from
Oct 6, 2024

Conversation

dradnats1012
Copy link
Contributor

🔥 연관 이슈

🚀 작업 내용

  1. 영양사님께서 기간을 지정하면 식단을 엑셀형식으로 다운로드 받을 수 있는 기능을 구현했습니다
  2. isCafeteria라는 Boolean 값을 통해 학생식당만 필터링 가능
  3. 이미지를 넣는 방식은 찾아봐야함

💬 리뷰 중점사항

  • 코드가 지저분합니다..

image

@dradnats1012 dradnats1012 self-assigned this Oct 5, 2024
@github-actions github-actions bot added the 기능 새로운 기능을 개발합니다. label Oct 5, 2024
Copy link

github-actions bot commented Oct 5, 2024

Unit Test Results

319 tests   318 ✔️  1m 38s ⏱️
  36 suites      1 💤
  36 files        0

Results for commit 8c58f13.

♻️ This comment has been updated with latest results.

Copy link
Collaborator

@songsunkook songsunkook left a comment

Choose a reason for hiding this comment

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

고생하셨습니다! 👍


@ApiResponses(
value = {
@ApiResponse(responseCode = "201"),
Copy link
Collaborator

Choose a reason for hiding this comment

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

A

실제로는 200이 반환되고 있는 것 아닌가요??

Copy link
Contributor Author

Choose a reason for hiding this comment

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

헉 감삼다

@@ -90,4 +111,103 @@ public CoopLoginResponse coopLogin(CoopLoginRequest request) {

return CoopLoginResponse.of(accessToken, savedToken.getRefreshToken());
}

public ByteArrayInputStream generateCoopExcel(LocalDate startDate, LocalDate endDate, Boolean isCafeteria) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

A

coopExcel 말고 diningExcel은 어떻게 생각하세요??

Copy link
Contributor

Choose a reason for hiding this comment

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

A

저도 diningExcel 좋은 것 같습니다

Copy link
Contributor Author

Choose a reason for hiding this comment

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

음 영양사님이 쓰시는거라서 coop으로 했는데 반환되는건 결국 식단이니까 dining 가 좋을것 같네요

@@ -44,6 +62,8 @@ public class CoopService {
private final PasswordEncoder passwordEncoder;
private final JwtProvider jwtProvider;

private final int CELL_NUM = 8;
Copy link
Collaborator

Choose a reason for hiding this comment

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

A

이건 어디서 사용하는 상수인가요?? 용도를 파악하기 힘든 것 같아요

Copy link
Contributor Author

Choose a reason for hiding this comment

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

cell 만들때 for문에 상수 들어가 있는게 보기 안좋아서 따로 뺐습니다!

Copy link
Contributor

@kih1015 kih1015 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 71 to 73
return ExcelResponseBuilder.buildExcelResponse(excelFile, startDate, endDate);

}
Copy link
Contributor

Choose a reason for hiding this comment

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

A

공백 들어가 있습니다

Comment on lines 123 to 126
}


try (Workbook workbook = new XSSFWorkbook()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

A

공백 한 줄 지워도 될 것 같아요!

Copy link
Contributor

@Choon0414 Choon0414 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다!

@@ -90,4 +111,103 @@ public CoopLoginResponse coopLogin(CoopLoginRequest request) {

return CoopLoginResponse.of(accessToken, savedToken.getRefreshToken());
}

public ByteArrayInputStream generateCoopExcel(LocalDate startDate, LocalDate endDate, Boolean isCafeteria) {
Copy link
Contributor

Choose a reason for hiding this comment

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

A

저도 diningExcel 좋은 것 같습니다

dinings.forEach(dining -> {
Row row = sheet.createRow(rowIdx.getAndIncrement());
row.createCell(0).setCellValue(dining.getDate().toString());
row.createCell(1).setCellValue(dining.getType().toString());
Copy link
Contributor

Choose a reason for hiding this comment

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

A

type을 enum으로 반환하기보다 이름(diningName)로 반환하는건 어떠신가요?
dining.getType() → "BREAKFAST"
dining.getType().getDiningName() → "아침"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

오 좋아요
이건 생각 못했네용 👍

@dradnats1012 dradnats1012 merged commit b10555f into develop Oct 6, 2024
4 checks passed
@dradnats1012 dradnats1012 deleted the feature/coop-monthly-excel branch October 6, 2024 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
기능 새로운 기능을 개발합니다.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

엑셀 다운로드 기능 (사진 포함)
4 participants