-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
96 additions
and
1 deletion.
There are no files selected for viewing
68 changes: 68 additions & 0 deletions
68
photo-service/src/main/java/kr/mafoo/photo/controller/SumoneController.java
This file contains 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,68 @@ | ||
package kr.mafoo.photo.controller; | ||
|
||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import kr.mafoo.photo.annotation.RequestMemberId; | ||
import kr.mafoo.photo.controller.dto.request.ObjectStoragePreSignedUrlRequest; | ||
import kr.mafoo.photo.controller.dto.response.AlbumResponse; | ||
import kr.mafoo.photo.controller.dto.response.PhotoResponse; | ||
import kr.mafoo.photo.controller.dto.response.PreSignedUrlResponse; | ||
import kr.mafoo.photo.controller.dto.response.SumoneBulkUrlRequest; | ||
import kr.mafoo.photo.controller.dto.response.SumoneSummaryResponse; | ||
import kr.mafoo.photo.domain.enums.AlbumType; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.validation.annotation.Validated; | ||
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.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
import reactor.core.publisher.Flux; | ||
import reactor.core.publisher.Mono; | ||
|
||
@RequiredArgsConstructor | ||
@Validated | ||
@Tag(name = "썸원 이벤트용 API") | ||
@RestController | ||
@RequestMapping("/v1/sumone") | ||
public class SumoneController { | ||
@Operation(summary = "통계 api") | ||
@GetMapping("/summary") | ||
public SumoneSummaryResponse getSummary() { | ||
return new SumoneSummaryResponse(1024); | ||
} | ||
|
||
@Operation(summary = "앨범 생성 api") | ||
@PostMapping("/albums") | ||
public Mono<AlbumResponse> createAlbum() { | ||
return Mono.just(new AlbumResponse("test_album_id", "야뿌들", AlbumType.SUMONE, "6")); | ||
} | ||
|
||
@Operation(summary = "앨범에 이미지 url 추가") | ||
@PostMapping("/albums/{albumId}/photos") | ||
public Flux<PhotoResponse> addPhotos( | ||
@PathVariable String albumId, | ||
@RequestBody SumoneBulkUrlRequest request | ||
) { | ||
return Flux.empty(); | ||
} | ||
|
||
@Operation(summary = "앨범에 이미지 조회") | ||
@GetMapping("/albums/{albumId}/photos") | ||
public Flux<PhotoResponse> getPhotos( | ||
@PathVariable String albumId | ||
) { | ||
return Flux.empty(); | ||
} | ||
|
||
@Operation(summary = "Pre-signed Url 요청", description = "Pre-signed Url 목록을 발급합니다.") | ||
@PostMapping("/albums/{albumId}/presigned-urls") | ||
Mono<PreSignedUrlResponse> createPreSignedUrls( | ||
@PathVariable String albumId, | ||
@RequestBody | ||
ObjectStoragePreSignedUrlRequest request | ||
) { | ||
return Mono.empty(); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
photo-service/src/main/java/kr/mafoo/photo/controller/dto/response/SumoneBulkUrlRequest.java
This file contains 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,15 @@ | ||
package kr.mafoo.photo.controller.dto.response; | ||
|
||
import io.swagger.v3.oas.annotations.media.ArraySchema; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
@Schema(description = "파일(url) 사진 n건 업로드 요청") | ||
public record SumoneBulkUrlRequest( | ||
@ArraySchema( | ||
schema = @Schema(description = "파일 URL 목록"), | ||
arraySchema = @Schema(example = "[\"file_url_1\", \"file_url_2\", \"file_url_3\"]") | ||
) | ||
String[] fileUrls | ||
) { | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
...o-service/src/main/java/kr/mafoo/photo/controller/dto/response/SumoneSummaryResponse.java
This file contains 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,11 @@ | ||
package kr.mafoo.photo.controller.dto.response; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
@Schema(description = "리캡 응답") | ||
public record SumoneSummaryResponse( | ||
@Schema(description = "사용자 수", example = "1565") | ||
int userCount | ||
){ | ||
|
||
} |
This file contains 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 |
---|---|---|
|
@@ -6,5 +6,6 @@ public enum AlbumType { | |
BASKETBALL, | ||
BUILDING, | ||
STARFALL, | ||
SMILE_FACE | ||
SMILE_FACE, | ||
SUMONE | ||
} |