-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[REFACTOR] 파일 시스템 버전에 따른 로직 분리 (#271)
* feat: 파일 버전 표시를 위한 클래스 추가 - yml 파일의 값을 읽은 후, 로컬/프로덕션 버전 정보를 저장하는 클래스 작성 * feat: 파일 응답 클래스 구조 변경 - accessURI를 source로 변경 - 파일 버전 정보(environment) 추가 - LOCAL / PROD * fix: 쿼리문 오류 수정 - PK 관련 에러 수정 * refactor: 버전 별 처리 방법 변경 - LOCAL 버전의 경우 파일을 다운로드 받아 BASE64로 인코딩한 문자열을 반환하도록 변경 - PROD 버전의 경우 파일에 접근할 수 있는 URI 반환
- Loading branch information
Showing
6 changed files
with
38 additions
and
11 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
src/main/java/com/genius/gitget/global/file/dto/FileEnv.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,19 @@ | ||
package com.genius.gitget.global.file.dto; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.core.env.Environment; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
public class FileEnv { | ||
private static Environment environment; | ||
|
||
@Autowired | ||
public FileEnv(Environment env) { | ||
environment = env; | ||
} | ||
|
||
public static String getFileEnvironment() { | ||
return environment.getProperty("file.mode").toUpperCase(); | ||
} | ||
} |
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
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
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
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
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