-
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.
Browse files
Browse the repository at this point in the history
Refactor/#76
- Loading branch information
Showing
43 changed files
with
438 additions
and
330 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
dodam-api/src/main/java/b1nd/dodamapi/auth/handler/AuthController.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
2 changes: 1 addition & 1 deletion
2
dodam-api/src/main/java/b1nd/dodamapi/auth/usecase/AuthUseCase.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
4 changes: 2 additions & 2 deletions
4
dodam-api/src/main/java/b1nd/dodamapi/banner/BannerController.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
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
37 changes: 37 additions & 0 deletions
37
dodam-api/src/main/java/b1nd/dodamapi/common/util/YoutubeApiUtil.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 b1nd.dodamapi.common.util; | ||
|
||
import b1nd.dodamcore.common.util.HtmlConverter; | ||
import b1nd.dodamcore.wakeupsong.application.dto.res.YoutubeApiRes; | ||
import b1nd.dodamcore.wakeupsong.application.dto.res.YoutubeRes; | ||
import b1nd.dodamcore.wakeupsong.domain.exception.WakeupSongUrlMalformedException; | ||
|
||
import java.util.Optional; | ||
|
||
public final class YoutubeApiUtil { | ||
|
||
private YoutubeApiUtil() { | ||
} | ||
|
||
static public YoutubeApiRes.Thumbnail getThumbnailUrl(YoutubeApiRes.Snippet snippet) { | ||
Optional<YoutubeApiRes.Thumbnail> standard = Optional.ofNullable(snippet.getThumbnails().getStandard()); | ||
return standard.orElseGet(() -> snippet.getThumbnails().getHigh()); | ||
} | ||
|
||
static public String getVideoId(String videoUrl){ | ||
try { | ||
return videoUrl.split("/?v=")[1].split("&")[0]; | ||
} catch (IndexOutOfBoundsException e) { | ||
throw new WakeupSongUrlMalformedException(); | ||
} | ||
} | ||
|
||
static public YoutubeRes getYoutubeRes(YoutubeApiRes.SearchItem item) { | ||
return new YoutubeRes( | ||
HtmlConverter.of(item.getSnippet().getTitle()), | ||
item.getId().getVideoId(), | ||
"https://www.youtube.com/watch?v=" + item.getId().getVideoId(), | ||
item.getSnippet().getChannelTitle(), | ||
YoutubeApiUtil.getThumbnailUrl(item.getSnippet()).getUrl() | ||
); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
dodam-api/src/main/java/b1nd/dodamapi/conference/handler/ConferenceController.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
2 changes: 1 addition & 1 deletion
2
dodam-api/src/main/java/b1nd/dodamapi/conference/usecase/ConferenceUseCase.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
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
4 changes: 2 additions & 2 deletions
4
dodam-api/src/main/java/b1nd/dodamapi/member/handler/MemberController.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
2 changes: 1 addition & 1 deletion
2
dodam-api/src/main/java/b1nd/dodamapi/member/usecase/MemberCommandUseCase.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
2 changes: 1 addition & 1 deletion
2
dodam-api/src/main/java/b1nd/dodamapi/member/usecase/MemberQueryUseCase.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
4 changes: 2 additions & 2 deletions
4
dodam-api/src/main/java/b1nd/dodamapi/nightstudy/handler/NightStudyController.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
4 changes: 2 additions & 2 deletions
4
dodam-api/src/main/java/b1nd/dodamapi/nightstudy/usecase/NightStudyUseCase.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
4 changes: 2 additions & 2 deletions
4
dodam-api/src/main/java/b1nd/dodamapi/outgoing/handler/OutGoingController.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
4 changes: 2 additions & 2 deletions
4
dodam-api/src/main/java/b1nd/dodamapi/outgoing/usecase/OutGoingUseCase.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
4 changes: 2 additions & 2 deletions
4
dodam-api/src/main/java/b1nd/dodamapi/outsleeping/handler/OutSleepingController.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
4 changes: 2 additions & 2 deletions
4
dodam-api/src/main/java/b1nd/dodamapi/outsleeping/usecase/OutSleepingUseCase.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
4 changes: 2 additions & 2 deletions
4
dodam-api/src/main/java/b1nd/dodamapi/point/handler/PointController.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
4 changes: 2 additions & 2 deletions
4
dodam-api/src/main/java/b1nd/dodamapi/point/usecase/PointReasonUseCase.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
4 changes: 2 additions & 2 deletions
4
dodam-api/src/main/java/b1nd/dodamapi/point/usecase/PointUseCase.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
4 changes: 2 additions & 2 deletions
4
dodam-api/src/main/java/b1nd/dodamapi/recruit/RecruitController.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
4 changes: 2 additions & 2 deletions
4
dodam-api/src/main/java/b1nd/dodamapi/schedule/ScheduleController.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
2 changes: 1 addition & 1 deletion
2
dodam-api/src/main/java/b1nd/dodamapi/upload/UploadController.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
Oops, something went wrong.