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

Refactor #116 일정 생성 로직 수정 #116

Merged
merged 15 commits into from
Feb 10, 2025

Conversation

hyxklee
Copy link
Member

@hyxklee hyxklee commented Jan 31, 2025

PR 내용

  • 정기모임 생성을 weeth 서비스 페이지로 이전함에 따라 api를 수정했습니다.
  • 공통된 변수를 Schedule 객체로 옮겼고, meeting에서만 쓰이는 code를 meeting에 유지했습니다.
  • 연도 일정을 볼 때 요구사항에 맞게 년도-학기를 받아서 저장된 기수에 맞는 데이터를 반환하도록 수정했습니다

PR 세부사항

  • 단일 API에서 type을 체크해 일정/정기모임을 생성 및 수정할 수 있게 api를 수정했습니다
  • 삭제는 개별 api로 받도록 했습니다
  • Event와 Meeting 생성시 dto가 완전히 동일하기 때문에 ScheduleDto를 사용해 한 번에 관리할 수 있도록 수정했습니다.
  • 사용하지 않는 메서드와 dto는 제거했습니다.
  • weekNumber, memberCount 등 사라진 변수들에 대한 dto들도 함께 수정했습니다

관련 스크린샷

image image

주의사항

  • 정기모임 생성시 출석 객체 생성, 삭제 테스트는 완료 됐습니다
  • 하지만 제가 빼먹은 케이스가 있을 수 있으니 함께 유심히 봐주시면 감사하겠습니다.

체크 리스트

  • 리뷰어 설정
  • Assignee 설정
  • Label 설정
  • 제목 양식 맞췄나요? (ex. #0 Feat: 기능 추가)
  • 변경 사항에 대한 테스트

@hyxklee hyxklee requested review from jj0526 and huncozyboy January 31, 2025 10:31
@hyxklee hyxklee self-assigned this Jan 31, 2025
Copy link
Member

@huncozyboy huncozyboy left a comment

Choose a reason for hiding this comment

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

고생하셨습니다 ! -228... 대공사였네요

PR에 적힌 내용대로 Event dto, Meting Dto가 삭제되면서
Schedule Dto로 통합되는 과정에서 빠진 내용들은 없는지, 삭제된 메서드 중에 불필요하게 중복된 메서드가 정리되었는지, 필요한 메서드가 누락된 것은 없는지 위주로 확인했습니다

추후에 출석 자동화 작업시에 해당 변경된 내용 참고해서 반영해서 작업하도록 하겠습니다

return CommonResponse.createSuccess(EVENT_UPDATE_SUCCESS.getMessage());
}

@DeleteMapping("/{eventId}")
@Operation(summary="일정 삭제")
@Operation(summary = "일정 삭제")
public CommonResponse<Void> delete(@PathVariable Long eventId) {
eventUseCase.delete(eventId);
Copy link
Member

Choose a reason for hiding this comment

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

일정과 정기모임을 생성이랑 수정해주는건 단일 API고
삭제는 type을 받지않고, 개별 API로 처리해주신건 의도된 설계인거죠 ??

Copy link
Member Author

Choose a reason for hiding this comment

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

네네 맞습니당

Comment on lines +44 to +48
if (dto.type() == Type.EVENT) {
eventUseCase.update(eventId, dto, userId);
} else {
meetingUseCase.update(dto, userId, eventId);
}
Copy link
Member

Choose a reason for hiding this comment

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

type을 체크해줘서 일정이랑 정기모임별로 생성 및 수정이 가능하도록 개선한 내용이네용 👍🏻

public Map<Integer, List<Response>> findByYearly(LocalDateTime start, LocalDateTime end) {
List<Response> events = eventGetService.find(start, end);
List<Response> meetings = meetingGetService.find(start, end);
public Map<Integer, List<Response>> findByYearly(Integer year, Integer semester) {
Copy link
Member

Choose a reason for hiding this comment

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

해당 부분에서 일정 조회할때 연도랑 학기 단위로 조회 가능하도록 변경된거 또한 확인했습니다 !

Copy link
Collaborator

@jj0526 jj0526 left a comment

Choose a reason for hiding this comment

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

수고하셨습니다~!

@Parameter(hidden = true) @CurrentUser Long userId) {
eventUseCase.save(dto, userId);
if (dto.type() == Type.EVENT) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

dto에서 타입을 받아 경우에 따라 저장하는거 확인했습니다!

@NotBlank String content,
@NotBlank String location,
@NotBlank String requiredItem,
@NotNull Type type,
Copy link
Collaborator

Choose a reason for hiding this comment

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

update에 type이 필요 없지 않을까요?

Copy link
Member Author

Choose a reason for hiding this comment

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

수정도 한 API에서 진행을 해서 기존 type을 그대로 받아서 확인을 통해 event인지 meeting인지 구분 해줘야한다고 판단했습니다!

@hyxklee hyxklee merged commit 24ce2fd into develop Feb 10, 2025
2 checks passed
@hyxklee hyxklee deleted the refactor/#93/일정-생성-로직-수정 branch February 10, 2025 01:51
@hyxklee hyxklee linked an issue Feb 10, 2025 that may be closed by this pull request
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.

Refactor #93 정기모임/일정 생성 로직 수정
3 participants