-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[REFACTOR] Pick 존재 여부 확인 API + OpenGraph 획득 방식 리팩토링 (#699)
* ✨ feat: OpenGraph 획득 클래스 분리 * chore: 매직넘버는 var 말고 타입 명시 * refactor: openGraph 클래스로 리팩토링 * fix: 프론트엔드 요청 반영 (url 픽 존재 여부 확인 API) * chore: 미사용 메서드 제거 * chore: 미사용 import 제거 * refactor: openGraph 반복 코드 리팩토링 * chore: 주석 추가
- Loading branch information
1 parent
78a431f
commit 9a2bb2e
Showing
11 changed files
with
278 additions
and
87 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
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 |
---|---|---|
|
@@ -25,4 +25,9 @@ public record FolderPickList( | |
) { | ||
} | ||
|
||
public record PickExists( | ||
Boolean exist, | ||
PickApiResponse.Pick pick | ||
) { | ||
} | ||
} |
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
62 changes: 62 additions & 0 deletions
62
backend/techpick-api/src/main/java/techpick/api/lib/opengraph/Metadata.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,62 @@ | ||
package techpick.api.lib.opengraph; | ||
|
||
/** | ||
* @author minkyeu kim | ||
* OpenGraph 표준에 따른 데이터 형식 | ||
* 참고 - https://ogp.me/ | ||
*/ | ||
public class Metadata { | ||
|
||
/*************************************** | ||
* Basic Metadata (required) | ||
***************************************/ | ||
|
||
// The title of your object as it should appear within the graph, e.g., "The Rock". | ||
public static final MetadataTag TITLE = MetadataTag.of("og:title"); | ||
|
||
// The type of your object, e.g., "video.movie". | ||
// Depending on the type you specify, other properties may also be required. | ||
public static final MetadataTag TYPE = MetadataTag.of("og:type"); | ||
|
||
// An image URL which should represent your object within the graph. | ||
public static final MetadataTag IMAGE = MetadataTag.of("og:image"); | ||
|
||
// The canonical URL of your object that will be used as its permanent ID in the graph, e.g., "https://www.imdb.com/title/tt0117500/". | ||
public static final MetadataTag URL = MetadataTag.of("og:url"); | ||
|
||
/*************************************** | ||
* Optional Metadata | ||
***************************************/ | ||
|
||
// A URL to an audio file to accompany this object. | ||
public static final MetadataTag AUDIO = MetadataTag.of("og:audio"); | ||
|
||
// A one to two sentence description of your object. | ||
public static final MetadataTag DESCRIPTION = MetadataTag.of("og:description"); | ||
|
||
// The word that appears before this object's title in a sentence. An enum of (a, an, the, "", auto). If auto is | ||
// chosen, the consumer of your data should chose between "a" or "an". Default is "" (blank). | ||
public static final MetadataTag DETERMINER = MetadataTag.of("og:determiner"); | ||
|
||
// The locale these tags are marked up in. Of the format language_TERRITORY. Default is en_US. | ||
public static final MetadataTag LOCALE = MetadataTag.of("og:locale"); | ||
|
||
// An array of other locales this page is available in. | ||
public static final MetadataTag LOCALE_ALTERNATE = MetadataTag.of("og:locale:alternate"); | ||
|
||
// If your object is part of a larger web site, the name which should be | ||
// displayed for the overall site. e.g.,"IMDb". | ||
public static final MetadataTag SITE_NAME = MetadataTag.of("og:site_name"); | ||
|
||
// A URL to a video file that complements this object. | ||
public static final MetadataTag VIDEO = MetadataTag.of("og:video"); | ||
|
||
/** | ||
* VO for metadata key | ||
*/ | ||
public record MetadataTag(String key) { | ||
public static MetadataTag of(String key) { | ||
return new MetadataTag(key); | ||
} | ||
} | ||
} |
Oops, something went wrong.