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

[DEV-28] 커스텀 수강과목 수정 api 분리 생성 삭제 #249

Conversation

Hoya324
Copy link
Member

@Hoya324 Hoya324 commented Apr 10, 2024

Issue

✅ 작업 내용

  • 수강과목을 list 형태로 받아와 저장, 삭제하던 방식에서 단건으로 id를 받아 수강과목을 추가하고 삭제하도록 분리했습니다.
  • 수강과목이 추가되면 이수학점이 증가하고, 수강과목이 삭제되면 이수학점 역시 줄어들도록 GenerateOrModifyCompletedCreditUseCase 를 사용하여 이수학점을 동기화 시켜주었습니다.

변경된 api 명세

스크린샷 2024-04-10 18 41 03

@Hoya324 Hoya324 self-assigned this Apr 10, 2024
Copy link

Copy link
Member

@5uhwann 5uhwann left a comment

Choose a reason for hiding this comment

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

확인했습니다! 분리된 UseCase가 기존 UseCase와 명확히 분리되도록 정의만 되면 될거 같습니다!

Comment on lines 28 to 30
public void generateTakenLecture(@LoginUser Long userId,
@Valid @RequestBody GenerateTakenLectureRequest generateTakenLectureRequest) {
generateTakenLectureUseCase.generateTakenLecture(userId, generateTakenLectureRequest.getLectureId());
Copy link
Member

Choose a reason for hiding this comment

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

컨트롤러 메서드 명을 더 명확하게 해주는 것이 좋을거 같습니다!
ex. addCustomizedTakenLecture

Copy link
Member Author

Choose a reason for hiding this comment

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

436ace8

f651662

변경완료했습니다!

}

@DeleteMapping("{taken-lecture-id}")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
@DeleteMapping("{taken-lecture-id}")
@DeleteMapping("{takenLectureId}")

Copy link
Member Author

@Hoya324 Hoya324 Apr 11, 2024

Choose a reason for hiding this comment

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

@UseCase
@Transactional
@RequiredArgsConstructor
public class DeleteTakenLectureServiceById implements DeleteTakenLectureUseCase {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
public class DeleteTakenLectureServiceById implements DeleteTakenLectureUseCase {
public class DeleteTakenLectureService implements DeleteTakenLectureUseCase {

Copy link
Member Author

Choose a reason for hiding this comment

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

package com.plzgraduate.myongjigraduatebe.takenlecture.application.usecase.save;


public interface GenerateTakenLectureUseCase {
Copy link
Member

Choose a reason for hiding this comment

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

pdf 파싱으로 생성되는 TakenLecture 유스케이스와 구분할 수 있도록 행동을 명확하게 정의한 유스케이스명을 사용하는 것이 좋을거 같습니다!

Copy link
Member Author

Choose a reason for hiding this comment

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

@@ -37,6 +39,7 @@ public class TakenLectureJpaEntity extends TimeBaseEntity {

private Integer year;

@Enumerated(EnumType.STRING)
Copy link
Member

Choose a reason for hiding this comment

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

해당 변경으로 인한 실제 운영디비의 값 변경에 대한 내용은 따로 문서화 부탁드립니다!

@github-actions github-actions bot added the D-5 label Apr 11, 2024
Copy link

sonarcloud bot commented Apr 11, 2024

@stophwan stophwan added the ♻️ refactor 기본의 로직 변경 없이 코드 개선 label Apr 11, 2024
@github-actions github-actions bot added D-4 and removed D-5 labels Apr 12, 2024
Copy link
Member

@5uhwann 5uhwann left a comment

Choose a reason for hiding this comment

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

👍

@Hoya324 Hoya324 merged commit 834c517 into develop Apr 12, 2024
3 checks passed
@Hoya324 Hoya324 deleted the refactor/DEV-28-커스텀-수강과목-수정-API-분리-생성-삭제 branch April 12, 2024 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D-4 ♻️ refactor 기본의 로직 변경 없이 코드 개선 size/XL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants