Skip to content

[6차 스프린트 - Steady] 스테디용 Presigned URL 요청 기능 추가#176

Open
na-yk wants to merge 3 commits intodevfrom
feat/#175
Open

[6차 스프린트 - Steady] 스테디용 Presigned URL 요청 기능 추가#176
na-yk wants to merge 3 commits intodevfrom
feat/#175

Conversation

@na-yk
Copy link
Copy Markdown
Contributor

@na-yk na-yk commented Nov 30, 2023

✅ PR 체크리스트

  • 테스트
  • 문서화 작업

💡 어떤 작업을 하셨나요?

Issue Number : close #175

작업 내용
스테디 모집글에 들어갈 사진을 업로드하기 위한 presigned url을 제공하는 기능이 필요해졌습니다.
기존에는 프로필 사진 업로드용 Presigned URL 제공 기능을 user도메인 패키지에 두었는데 새로운 기능이 필요해지면서 presigned url 제공 기능을 각 도메인 패키지에 두지 않고 storage 패키지에 통합하여 하나의 controller와 service 클래스를 이용하도록 변경했습니다.
또한 스토리지에 용도별로 폴더를 분리하여 이미지를 저장하고자 했기 때문에 key pattern이 서로 달라야 하는데, 이를 ENUM으로 관리하도록 구현하였습니다.

📝리뷰어에게

구조나 클래스명과 같은 부분에서 피드백 부탁 드립니다!🙇‍♀️

@na-yk na-yk added this to the [6차 스프린트] milestone Nov 30, 2023
@na-yk na-yk requested review from K-jun98 and weonest November 30, 2023 07:50
@na-yk na-yk self-assigned this Nov 30, 2023
@github-actions
Copy link
Copy Markdown

Test Results

  26 files    26 suites   6s ⏱️
123 tests 123 ✔️ 0 💤 0
124 runs  124 ✔️ 0 💤 0

Results for commit 235a401.

Comment on lines +23 to +30
@GetMapping("/{purpose}")
public ResponseEntity<PutObjectUrlResponse> getImageUploadUrl(@PathVariable String purpose,
@RequestParam String fileName,
@Auth UserInfo userInfo) {
String keyPattern = ImageUploadPurpose.from(purpose).getKeyPattern();
PutObjectUrlResponse response = storageService.generatePutObjectUrl(fileName, keyPattern);
return ResponseEntity.ok(response);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

api 설계가 좋네요!

@GetMapping("/{purpose}")
public ResponseEntity<PutObjectUrlResponse> getImageUploadUrl(@PathVariable String purpose,
@RequestParam String fileName,
@Auth UserInfo userInfo) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

userInfo가 사용되지 않는 거라면 지워도 좋을 것 같아요.
아니면 기존의 JwtAuthenticationInterceptor의 동작을 좀 추가해서 파라미터 어노테이션 정보만 확인하는 것이 아니라 메서드 어노태이션 정보도 확인하게끔 하면 UserInfo를 사용하지 않을 수 있을 것 같네요!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[6차 스프린트 - Steady] 스테디용 Presigned URL 요청 기능 추가

2 participants