-
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.
Merge pull request #75 from YAPP-Github/dev
[PROD 배포] v.
- Loading branch information
Showing
35 changed files
with
1,243 additions
and
249 deletions.
There are no files selected for viewing
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
26 changes: 26 additions & 0 deletions
26
photo-service/src/main/java/kr/mafoo/photo/api/ObjectStorageApi.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,26 @@ | ||
package kr.mafoo.photo.api; | ||
|
||
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.PreSignedUrlResponse; | ||
import org.springframework.validation.annotation.Validated; | ||
import org.springframework.web.bind.annotation.*; | ||
import reactor.core.publisher.Mono; | ||
|
||
@Validated | ||
@Tag(name = "Object Storage 관련 API", description = "Object Storage 관련 API") | ||
@RequestMapping("/v1/object-storage") | ||
public interface ObjectStorageApi { | ||
|
||
@Operation(summary = "Pre-signed Url 요청", description = "Pre-signed Url 목록을 발급합니다.") | ||
@PostMapping | ||
Mono<PreSignedUrlResponse> createPreSignedUrls( | ||
@RequestMemberId | ||
String memberId, | ||
|
||
@RequestBody | ||
ObjectStoragePreSignedUrlRequest request | ||
); | ||
} |
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
37 changes: 37 additions & 0 deletions
37
photo-service/src/main/java/kr/mafoo/photo/api/RecapApi.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,37 @@ | ||
package kr.mafoo.photo.api; | ||
|
||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.Parameter; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import jakarta.validation.Valid; | ||
import kr.mafoo.photo.annotation.RequestMemberId; | ||
import kr.mafoo.photo.controller.dto.request.RecapCreateRequest; | ||
import kr.mafoo.photo.controller.dto.response.RecapResponse; | ||
import org.springframework.http.server.reactive.ServerHttpRequest; | ||
import org.springframework.validation.annotation.Validated; | ||
import org.springframework.web.bind.annotation.*; | ||
import reactor.core.publisher.Mono; | ||
|
||
@Validated | ||
@Tag(name = "리캡 관련 API", description = "리캡 생성 API") | ||
@RequestMapping("/v1/recaps") | ||
public interface RecapApi { | ||
@Operation(summary = "리캡 생성", description = "앨범의 리캡을 생성합니다.") | ||
@PostMapping | ||
Mono<RecapResponse> createRecap( | ||
@RequestMemberId | ||
String memberId, | ||
|
||
@Valid | ||
@RequestBody | ||
RecapCreateRequest request, | ||
|
||
@Parameter(description = "정렬 종류", example = "ASC | DESC") | ||
@RequestParam(required = false) | ||
String sort, | ||
|
||
// Authorization Header를 받아올 목적 | ||
ServerHttpRequest serverHttpRequest | ||
); | ||
|
||
} |
24 changes: 24 additions & 0 deletions
24
photo-service/src/main/java/kr/mafoo/photo/config/FFmpegConfig.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,24 @@ | ||
package kr.mafoo.photo.config; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import net.bramp.ffmpeg.FFmpeg; | ||
import net.bramp.ffmpeg.FFmpegExecutor; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
import java.io.IOException; | ||
|
||
@Slf4j | ||
@Configuration | ||
public class FFmpegConfig { | ||
|
||
@Value("${ffmpeg.path}") | ||
private String ffmpegPath; | ||
|
||
@Bean | ||
public FFmpegExecutor ffMpegExecutor() throws IOException { | ||
FFmpeg ffmpeg = new FFmpeg(ffmpegPath); | ||
return new FFmpegExecutor(ffmpeg); | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
photo-service/src/main/java/kr/mafoo/photo/config/RequestBodyCachingFilter.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,46 @@ | ||
//package kr.mafoo.photo.config; | ||
// | ||
//import org.springframework.core.io.buffer.DataBuffer; | ||
//import org.springframework.core.io.buffer.DataBufferUtils; | ||
//import org.springframework.http.server.reactive.ServerHttpRequest; | ||
//import org.springframework.http.server.reactive.ServerHttpRequestDecorator; | ||
//import org.springframework.stereotype.Component; | ||
//import org.springframework.web.server.ServerWebExchange; | ||
//import org.springframework.web.server.ServerWebExchangeDecorator; | ||
//import org.springframework.web.server.WebFilter; | ||
//import org.springframework.web.server.WebFilterChain; | ||
//import reactor.core.publisher.Flux; | ||
//import reactor.core.publisher.Mono; | ||
// | ||
//@Component | ||
//public class RequestBodyCachingFilter implements WebFilter { | ||
// | ||
// // TODO: 추후 정리 필요 | ||
// | ||
// @Override | ||
// public Mono<Void> filter(ServerWebExchange exchange, WebFilterChain chain) { | ||
// return DataBufferUtils.join(exchange.getRequest().getBody()) | ||
// .flatMap(dataBuffer -> { | ||
// byte[] bytes = new byte[dataBuffer.readableByteCount()]; | ||
// dataBuffer.read(bytes); | ||
// DataBufferUtils.release(dataBuffer); | ||
// | ||
// ServerHttpRequestDecorator decoratedRequest = new ServerHttpRequestDecorator(exchange.getRequest()) { | ||
// @Override | ||
// public Flux<DataBuffer> getBody() { | ||
// return Flux.just(exchange.getResponse().bufferFactory().wrap(bytes)); | ||
// } | ||
// }; | ||
// | ||
// ServerWebExchangeDecorator decoratedExchange = new ServerWebExchangeDecorator(exchange) { | ||
// @Override | ||
// public ServerHttpRequest getRequest() { | ||
// return decoratedRequest; | ||
// } | ||
// }; | ||
// | ||
// return chain.filter(decoratedExchange); | ||
// }); | ||
// } | ||
//} | ||
// |
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
26 changes: 26 additions & 0 deletions
26
photo-service/src/main/java/kr/mafoo/photo/controller/ObjectStorageController.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,26 @@ | ||
package kr.mafoo.photo.controller; | ||
|
||
import kr.mafoo.photo.api.ObjectStorageApi; | ||
import kr.mafoo.photo.controller.dto.request.*; | ||
import kr.mafoo.photo.controller.dto.response.PreSignedUrlResponse; | ||
import kr.mafoo.photo.service.ObjectStorageService; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.web.bind.annotation.RestController; | ||
import reactor.core.publisher.Mono; | ||
|
||
@RequiredArgsConstructor | ||
@RestController | ||
public class ObjectStorageController implements ObjectStorageApi { | ||
|
||
private final ObjectStorageService objectStorageService; | ||
|
||
@Override | ||
public Mono<PreSignedUrlResponse> createPreSignedUrls( | ||
String memberId, | ||
ObjectStoragePreSignedUrlRequest request | ||
) { | ||
return objectStorageService | ||
.createPreSignedUrls(request.fileNames(), memberId) | ||
.map(PreSignedUrlResponse::fromStringArray); | ||
} | ||
} |
Oops, something went wrong.