-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/photo s3 #46
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
Open
khg9900
wants to merge
11
commits into
dev
Choose a base branch
from
feature/photo-s3
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feature/photo s3 #46
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
5d1419b
feat: TripPermissionService μΆκ°
khg9900 ffbf3da
feat: album λλ©μΈ κΈ°λ₯ ꡬν
khg9900 0799770
feat: S3 μ°λ μ€μ μΆκ°
khg9900 79f6667
feat: photo λλ©μΈ κΈ°λ₯ ꡬν
khg9900 e174ab1
docs: swagger docs μ 리
khg9900 e129f0d
fix: ScheduleServiceTest μ€ν μμ
khg9900 9dea065
chore: seed λ°μ΄ν° μ 리
khg9900 624c390
fix: μ¬μ©νμ§ μλ import μ κ±°
khg9900 7a523d4
QAlbum, QPhoto μΈμ€ν΄μ€λ₯Ό ν΄λμ€ νλλ‘ μΆμΆ
khg9900 b3a2d44
fix: coderabbitai μ½λ©νΈ μ μ©
khg9900 d83da7b
Merge branch 'dev' into feature/photo-s3
rabitis99 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
113 changes: 113 additions & 0 deletions
113
src/main/java/com/example/pventure/domain/photo/controller/PhotoController.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,113 @@ | ||
| package com.example.pventure.domain.photo.controller; | ||
|
|
||
| import com.example.pventure.domain.photo.docs.CreatePhotosDocs; | ||
| import com.example.pventure.domain.photo.docs.DeletePhotosDocs; | ||
| import com.example.pventure.domain.photo.docs.GenerateUploadUrlsDocs; | ||
| import com.example.pventure.domain.photo.docs.GetPhotoDocs; | ||
| import com.example.pventure.domain.photo.docs.GetPhotosByAlbumDocs; | ||
| import com.example.pventure.domain.photo.docs.GetUnassignedPhotosDocs; | ||
| import com.example.pventure.domain.photo.docs.MovePhotosDocs; | ||
| import com.example.pventure.domain.photo.dto.request.MovePhotoRequestDto; | ||
| import com.example.pventure.domain.photo.dto.request.PhotoRequestDto; | ||
| import com.example.pventure.domain.photo.dto.request.UploadUrlRequestDto; | ||
| import com.example.pventure.domain.photo.dto.response.PhotoDetailResponseDto; | ||
| import com.example.pventure.domain.photo.dto.response.PhotoResponseDto; | ||
| import com.example.pventure.domain.photo.dto.response.UploadUrlResponseDto; | ||
| import com.example.pventure.domain.photo.service.PhotoService; | ||
| import com.example.pventure.global.response.CustomResponse; | ||
| import com.example.pventure.global.response.CustomResponseHelper; | ||
| import io.swagger.v3.oas.annotations.tags.Tag; | ||
| import jakarta.validation.Valid; | ||
| import java.util.List; | ||
| import lombok.RequiredArgsConstructor; | ||
| import org.springframework.http.ResponseEntity; | ||
| import org.springframework.web.bind.annotation.DeleteMapping; | ||
| import org.springframework.web.bind.annotation.GetMapping; | ||
| import org.springframework.web.bind.annotation.PathVariable; | ||
| import org.springframework.web.bind.annotation.PostMapping; | ||
| import org.springframework.web.bind.annotation.PutMapping; | ||
| import org.springframework.web.bind.annotation.RequestBody; | ||
| import org.springframework.web.bind.annotation.RequestMapping; | ||
| import org.springframework.web.bind.annotation.RequestParam; | ||
| import org.springframework.web.bind.annotation.RestController; | ||
|
|
||
| @Tag(name = "Photo", description = "μ¬μ§ κ΄λ ¨ API") | ||
| @RestController | ||
| @RequestMapping("/trips/{tripId}") | ||
| @RequiredArgsConstructor | ||
| public class PhotoController { | ||
|
|
||
| private final PhotoService photoService; | ||
|
|
||
| @GenerateUploadUrlsDocs | ||
| @PostMapping("/photos/upload-urls") | ||
| public ResponseEntity<CustomResponse<List<UploadUrlResponseDto>>> generateUploadUrls( | ||
| @RequestParam Long userId, | ||
| @PathVariable Long tripId, | ||
| @Valid @RequestBody List<UploadUrlRequestDto> requestDtos | ||
| ) { | ||
| return CustomResponseHelper.ok(photoService.generateUploadUrls(userId, tripId, requestDtos)); | ||
| } | ||
|
|
||
| @CreatePhotosDocs | ||
| @PostMapping("/photos") | ||
| public ResponseEntity<CustomResponse<List<PhotoResponseDto>>> createPhotos( | ||
| @RequestParam Long userId, | ||
| @PathVariable Long tripId, | ||
| @RequestParam(required = false) Long albumId, | ||
| @Valid @RequestBody List<PhotoRequestDto> requestDtos | ||
| ) { | ||
| return CustomResponseHelper.created(photoService.createPhotos(userId, tripId, albumId, requestDtos)); | ||
| } | ||
|
|
||
| @GetPhotosByAlbumDocs | ||
| @GetMapping("/albums/{albumId}/photos") | ||
| public ResponseEntity<CustomResponse<List<PhotoResponseDto>>> getPhotosByAlbum( | ||
| @RequestParam Long userId, | ||
| @PathVariable Long tripId, | ||
| @PathVariable Long albumId | ||
| ) { | ||
| return CustomResponseHelper.ok(photoService.getPhotosByAlbum(userId, tripId, albumId)); | ||
| } | ||
|
|
||
| @GetUnassignedPhotosDocs | ||
| @GetMapping("/photos/unassigned") | ||
| public ResponseEntity<CustomResponse<List<PhotoResponseDto>>> getUnassignedPhotos( | ||
| @RequestParam Long userId, | ||
| @PathVariable Long tripId | ||
| ) { | ||
| return CustomResponseHelper.ok(photoService.getUnassignedPhotos(userId, tripId)); | ||
| } | ||
|
|
||
| @GetPhotoDocs | ||
| @GetMapping("/photos/{photoId}") | ||
| public ResponseEntity<CustomResponse<PhotoDetailResponseDto>> getPhoto( | ||
| @RequestParam Long userId, | ||
| @PathVariable Long tripId, | ||
| @PathVariable Long photoId | ||
| ) { | ||
| return CustomResponseHelper.ok(photoService.getPhoto(userId, tripId, photoId)); | ||
| } | ||
|
|
||
| @MovePhotosDocs | ||
| @PutMapping("/photos/move") | ||
| public ResponseEntity<Void> movePhotos( | ||
| @RequestParam Long userId, | ||
| @PathVariable Long tripId, | ||
| @Valid @RequestBody MovePhotoRequestDto requestDto | ||
| ) { | ||
| photoService.movePhotos(userId, tripId, requestDto.getTargetAlbumId(), requestDto.getPhotoIds()); | ||
| return CustomResponseHelper.noContent(); | ||
| } | ||
|
|
||
| @DeletePhotosDocs | ||
| @DeleteMapping("/photos") | ||
| public ResponseEntity<Void> deletePhotos( | ||
| @RequestParam Long userId, | ||
| @PathVariable Long tripId, | ||
| @RequestParam List<Long> photoIds | ||
| ) { | ||
| photoService.deletePhotos(userId, tripId, photoIds); | ||
| return CustomResponseHelper.noContent(); | ||
| } | ||
| } |
1 change: 0 additions & 1 deletion
1
src/main/java/com/example/pventure/domain/photo/controller/README.md
This file was deleted.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
src/main/java/com/example/pventure/domain/photo/docs/CreatePhotosDocs.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| package com.example.pventure.domain.photo.docs; | ||
|
|
||
| import io.swagger.v3.oas.annotations.Operation; | ||
| import io.swagger.v3.oas.annotations.responses.ApiResponse; | ||
| import java.lang.annotation.Documented; | ||
| import java.lang.annotation.ElementType; | ||
| import java.lang.annotation.Retention; | ||
| import java.lang.annotation.RetentionPolicy; | ||
| import java.lang.annotation.Target; | ||
|
|
||
| @Documented | ||
| @Target(ElementType.METHOD) | ||
| @Retention(RetentionPolicy.RUNTIME) | ||
| @Operation( | ||
| summary = PhotoSwaggerDocs.CREATE_PHOTOS_SUMMARY, | ||
| description = PhotoSwaggerDocs.CREATE_PHOTOS_DESCRIPTION | ||
| ) | ||
| @ApiResponse(responseCode = "201", description = "μ¬μ§ μμ± μ±κ³΅", useReturnTypeSchema = true) | ||
| @ApiResponse(responseCode = "400", description = "μλͺ»λ μμ²") | ||
| @ApiResponse(responseCode = "403", description = "νΈμ§ κΆν μμ") | ||
| @ApiResponse(responseCode = "404", description = "μ¬μ©μ λλ μ¬ν μμ") | ||
| public @interface CreatePhotosDocs {} |
21 changes: 21 additions & 0 deletions
21
src/main/java/com/example/pventure/domain/photo/docs/DeletePhotosDocs.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| package com.example.pventure.domain.photo.docs; | ||
|
|
||
| import io.swagger.v3.oas.annotations.Operation; | ||
| import io.swagger.v3.oas.annotations.responses.ApiResponse; | ||
| import java.lang.annotation.Documented; | ||
| import java.lang.annotation.ElementType; | ||
| import java.lang.annotation.Retention; | ||
| import java.lang.annotation.RetentionPolicy; | ||
| import java.lang.annotation.Target; | ||
|
|
||
| @Documented | ||
| @Target(ElementType.METHOD) | ||
| @Retention(RetentionPolicy.RUNTIME) | ||
| @Operation( | ||
| summary = PhotoSwaggerDocs.DELETE_PHOTO_SUMMARY, | ||
| description = PhotoSwaggerDocs.DELETE_PHOTO_DESCRIPTION | ||
| ) | ||
| @ApiResponse(responseCode = "204", description = "μμ μ±κ³΅") | ||
| @ApiResponse(responseCode = "403", description = "νΈμ§ κΆν μμ") | ||
| @ApiResponse(responseCode = "404", description = "μ¬μ©μ λλ μ¬ν λλ μ¬μ§ μμ") | ||
| public @interface DeletePhotosDocs {} |
22 changes: 22 additions & 0 deletions
22
src/main/java/com/example/pventure/domain/photo/docs/GenerateUploadUrlsDocs.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| package com.example.pventure.domain.photo.docs; | ||
|
|
||
| import io.swagger.v3.oas.annotations.Operation; | ||
| import io.swagger.v3.oas.annotations.responses.ApiResponse; | ||
| import java.lang.annotation.Documented; | ||
| import java.lang.annotation.ElementType; | ||
| import java.lang.annotation.Retention; | ||
| import java.lang.annotation.RetentionPolicy; | ||
| import java.lang.annotation.Target; | ||
|
|
||
| @Documented | ||
| @Target(ElementType.METHOD) | ||
| @Retention(RetentionPolicy.RUNTIME) | ||
| @Operation( | ||
| summary = PhotoSwaggerDocs.GENERATE_UPLOAD_URLS_SUMMARY, | ||
| description = PhotoSwaggerDocs.GENERATE_UPLOAD_URLS_DESCRIPTION | ||
| ) | ||
| @ApiResponse(responseCode = "200", description = "μ λ‘λ URL μμ± μ±κ³΅", useReturnTypeSchema = true) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 201μ§λ¦¬κ° μλ 200μΌλ‘ νμ μ΄μ κ° μμΌμ€ κΉμ? |
||
| @ApiResponse(responseCode = "400", description = "μλͺ»λ μμ²") | ||
| @ApiResponse(responseCode = "403", description = "νΈμ§ κΆν μμ") | ||
| @ApiResponse(responseCode = "404", description = "μ¬μ©μ λλ μ¬ν μμ") | ||
| public @interface GenerateUploadUrlsDocs {} | ||
21 changes: 21 additions & 0 deletions
21
src/main/java/com/example/pventure/domain/photo/docs/GetPhotoDocs.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| package com.example.pventure.domain.photo.docs; | ||
|
|
||
| import io.swagger.v3.oas.annotations.Operation; | ||
| import io.swagger.v3.oas.annotations.responses.ApiResponse; | ||
| import java.lang.annotation.Documented; | ||
| import java.lang.annotation.ElementType; | ||
| import java.lang.annotation.Retention; | ||
| import java.lang.annotation.RetentionPolicy; | ||
| import java.lang.annotation.Target; | ||
|
|
||
| @Documented | ||
| @Target(ElementType.METHOD) | ||
| @Retention(RetentionPolicy.RUNTIME) | ||
| @Operation( | ||
| summary = PhotoSwaggerDocs.GET_PHOTO_SUMMARY, | ||
| description = PhotoSwaggerDocs.GET_PHOTO_DESCRIPTION | ||
| ) | ||
| @ApiResponse(responseCode = "200", description = "μ‘°ν μ±κ³΅", useReturnTypeSchema = true) | ||
| @ApiResponse(responseCode = "403", description = "보기 κΆν μμ") | ||
| @ApiResponse(responseCode = "404", description = "μ¬μ©μ λλ μ¬ν λλ μ¬μ§ μμ") | ||
| public @interface GetPhotoDocs {} |
21 changes: 21 additions & 0 deletions
21
src/main/java/com/example/pventure/domain/photo/docs/GetPhotosByAlbumDocs.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| package com.example.pventure.domain.photo.docs; | ||
|
|
||
| import io.swagger.v3.oas.annotations.Operation; | ||
| import io.swagger.v3.oas.annotations.responses.ApiResponse; | ||
| import java.lang.annotation.Documented; | ||
| import java.lang.annotation.ElementType; | ||
| import java.lang.annotation.Retention; | ||
| import java.lang.annotation.RetentionPolicy; | ||
| import java.lang.annotation.Target; | ||
|
|
||
| @Documented | ||
| @Target(ElementType.METHOD) | ||
| @Retention(RetentionPolicy.RUNTIME) | ||
| @Operation( | ||
| summary = PhotoSwaggerDocs.GET_PHOTOS_BY_ALBUM_SUMMARY, | ||
| description = PhotoSwaggerDocs.GET_PHOTOS_BY_ALBUM_DESCRIPTION | ||
| ) | ||
| @ApiResponse(responseCode = "200", description = "μ‘°ν μ±κ³΅", useReturnTypeSchema = true) | ||
| @ApiResponse(responseCode = "403", description = "보기 κΆν μμ") | ||
| @ApiResponse(responseCode = "404", description = "μ¬μ©μ λλ μ¬ν μμ") | ||
| public @interface GetPhotosByAlbumDocs {} |
21 changes: 21 additions & 0 deletions
21
src/main/java/com/example/pventure/domain/photo/docs/GetUnassignedPhotosDocs.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| package com.example.pventure.domain.photo.docs; | ||
|
|
||
| import io.swagger.v3.oas.annotations.Operation; | ||
| import io.swagger.v3.oas.annotations.responses.ApiResponse; | ||
| import java.lang.annotation.Documented; | ||
| import java.lang.annotation.ElementType; | ||
| import java.lang.annotation.Retention; | ||
| import java.lang.annotation.RetentionPolicy; | ||
| import java.lang.annotation.Target; | ||
|
|
||
| @Documented | ||
| @Target(ElementType.METHOD) | ||
| @Retention(RetentionPolicy.RUNTIME) | ||
| @Operation( | ||
| summary = PhotoSwaggerDocs.GET_UNASSIGNED_PHOTOS_SUMMARY, | ||
| description = PhotoSwaggerDocs.GET_UNASSIGNED_PHOTOS_DESCRIPTION | ||
| ) | ||
| @ApiResponse(responseCode = "200", description = "μ‘°ν μ±κ³΅", useReturnTypeSchema = true) | ||
| @ApiResponse(responseCode = "403", description = "보기 κΆν μμ") | ||
| @ApiResponse(responseCode = "404", description = "μ¬μ©μ λλ μ¬ν μμ") | ||
| public @interface GetUnassignedPhotosDocs {} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.