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/9 monthly agenda #15

Merged
merged 14 commits into from
May 23, 2024
Merged

Conversation

OneK-2
Copy link
Collaborator

@OneK-2 OneK-2 commented May 23, 2024

✨ 요약

MonthlyAgena관련되어 CRUD기능과 테스트 코드를 작성했습니다.
연관 관계가 추가 되었기 때문에 data.sql을 다시 작성해야 할 것 같습니다.
window 환경에서 EmbededEedisEonfig에서 오류가 발생하는데, 로컬환경에서는 주석처리하여 사용했습니다.

조회 기능의 경우 agendaId 대신 year와 month를 통해 조회를 하도록 로직을 구성했는데, 시간만 낭비한 잘못된 선택이었는지 궁금합니다...



😎 해결한 이슈



@OneK-2 OneK-2 added Feat 기능 추가 test 테스트코드 추가 labels May 23, 2024
@OneK-2 OneK-2 added this to the v1.0.0 milestone May 23, 2024
@OneK-2 OneK-2 self-assigned this May 23, 2024
Copy link
Member

@minwoo1999 minwoo1999 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다 형님

LocalDateTime start = YearMonth.of(readMonthlyAgendaRequestDto.getYear(), readMonthlyAgendaRequestDto.getMonth()).atDay(1).atStartOfDay();
LocalDateTime end = YearMonth.of(readMonthlyAgendaRequestDto.getYear(), readMonthlyAgendaRequestDto.getMonth()).atEndOfMonth().atTime(23, 59, 59);

Optional<MonthlyAgenda> monthlyAgendaOptional = monthlyAgendaRepository.findByMemberIdAndCreatedAtBetween(currentUserId, start, end);
Copy link
Member

Choose a reason for hiding this comment

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

해당 부분을 orElseThrow로 처리해서 if else 문 안쓰고처리하는방법은 어떨까요!?

Copy link
Member

Choose a reason for hiding this comment

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

아아 빈배열 반환을 위해 저렇게 하신거군요 ! 이해했습니다

@@ -63,6 +63,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
.authorizeHttpRequests((authorizeRequests) ->
authorizeRequests
.requestMatchers("/api/v1/members/signup", "/api/v1/members/login/**","/api/v1/members/renew-access-token","/api/v1/members/logout").permitAll()
.requestMatchers("/api/v1/monthlyAgenda/**").permitAll()
Copy link
Member

Choose a reason for hiding this comment

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

저 경로 밑에 있는 경로 전부 오픈시키면 로그인 하지않은 유저들도 해당 API에 데이터에 접근할 수 있을 것 같아요! Member 등급 이상인 권한을 가진 유저들만 API해당 접근할 수있도록 수정해주시면 좋을 것같습니다!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

아 테스트용 설정했는데, 깜빡했습니다.!

Copy link
Member

@minwoo1999 minwoo1999 left a comment

Choose a reason for hiding this comment

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

추가 코멘트했습니다 rest api 쪽

summary = "이번달 아젠다 삭제",
description = "이번달 아젠다를 삭제하는 API, 현재는 필요하지 않음."
)
@DeleteMapping("/delete")
Copy link
Member

Choose a reason for hiding this comment

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

restful 규칙: 행위를 포함하지 않는다.
이거 혹시 / 나 행위가 포함되지않도록 하는건 어떨까요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

좋습니다! 수정하도록 할게요!

summary = "이번달 아젠다 수정",
description = "사용자가 설정한 이번달 아젠다를 수정하는 API"
)
@PutMapping("/update")
Copy link
Member

Choose a reason for hiding this comment

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

restful 규칙: 행위를 포함하지 않는다.
이거 혹시 / 나 행위가 포함되지않도록 하는건 어떨까요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

넵!

summary = "이번달 아젠다 등록",
description = "사용자가 입력한 이번달 아젠다를 저장하는 API"
)
@PostMapping("/create")
Copy link
Member

Choose a reason for hiding this comment

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

restful 규칙: 행위를 포함하지 않는다.
이거 혹시 / 나 행위가 포함되지않도록 하는건 어떨까요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

요기까지 다 확인했습니다 ㅎㅎ

@minwoo1999 minwoo1999 merged commit 7c8bf68 into rework-kr:develop May 23, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feat 기능 추가 test 테스트코드 추가
Projects
Status: 완료된 이슈 (Done)
Development

Successfully merging this pull request may close these issues.

[FEAT] 이번달 아젠다 기능 구현
2 participants