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] 과제 생성 시 S3 파일 업로드 기능 구현 #60

Merged
merged 9 commits into from
Nov 14, 2024

Conversation

sseung519
Copy link
Contributor

@sseung519 sseung519 commented Nov 13, 2024

관련 이슈

변경 사항

  • 컨트롤러 (AssignmentController.java)
    • addAssignment 메서드 수정: 파일 업로드 로직을 추가하고 @ModelAttribute를 사용하여 요청 데이터를 처리하도록 변경
  • DTO (AssignmentRequestDto.java)
    • AssignmentRequestDto에 파일 업로드 필드 추가 (List<MultipartFile> files)
  • 서비스 (AssignmentService.java)
    • addAssignment 메서드에서 S3 파일 업로드 후 과제와 파일 간의 연관 관계 설정 구현
    • 업로드된 파일을 AssignmentFile로 저장하도록 수정
  • 파일 엔티티 (AssignmentFile.java)
    • AssignmentAssignmentFile 간의 관계 설정 (@ManyToOne)
    • 단방향 관계를 관리하기 위한 setAssignment 메서드 추가
  • .gitignore 파일 업데이트
    • .DS_Store

스크린샷

기능 스크린샷
파일 업로드 파일 업로드 스크린샷
S3 S3 스크린샷

체크리스트

  • 코드 컨벤션을 준수하였습니까?
  • 모든 테스트를 통과하였습니까?
  • 관련 문서를 업데이트하였습니까?

추후 업무

  • 이미지 S3 연동 기능 구현

- @ModelAttribute를 사용해 addAssignment 메서드에서 파일 업로드 처리
- 과제 데이터와 파일 데이터를 통합하여 일관성 있게 요청 처리
- 과제 요청에 파일 데이터를 포함할 수 있도록 List<MultipartFile> files 필드 추가
- 파일 처리를 위한 getter와 setter 추가
- addAssignment 메서드에서 S3에 파일 업로드 기능 추가
- 업로드된 파일을 과제와 연결하고 관계를 관리하도록 수정
- AssignmentFile 엔티티를 활용한 과제-파일 매핑 설정
- @manytoone 관계를 Assignment와 설정
- 양방향 관계를 관리하기 위해 setAssignment 메서드 수정
@sseung519 sseung519 added the enhancement New feature or request label Nov 13, 2024
@sseung519 sseung519 self-assigned this Nov 13, 2024
Copy link
Member

@Chan-GN Chan-GN left a comment

Choose a reason for hiding this comment

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

S3 파일 업로드 기능이 잘 공유되고 있군요!
Setter 관련해서 코멘트 하나 남겨드리니 확인해보시면 좋겠습니다!

고생 많으셨습니다!

return assignmentFile;
}

private void setAssignment(Assignment assignment) {
Copy link
Member

Choose a reason for hiding this comment

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

이 setter 메서드가 필요한지 고민해보시면 좋겠습니다.
생성자의 매개변수에 추가하는건 어떠신가요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

다음 작업 시, 긍정적으로 반영해보겠습니다.

Copy link
Contributor

@hyerin315 hyerin315 left a comment

Choose a reason for hiding this comment

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

고생 많으셨습니다!

@sseung519 sseung519 merged commit ef55f89 into main Nov 14, 2024
@sseung519 sseung519 deleted the feature/55-upload-file-to-s3 branch November 14, 2024 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[FEAT] 과제 파일 업로드 S3 백엔드 구현
3 participants