Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
thguss committed Aug 28, 2024
2 parents ad31196 + 4968af3 commit eb82dc9
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 12 deletions.
35 changes: 27 additions & 8 deletions src/main/java/com/soptie/server/temporary/data/ThemeData.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ public static String getColor(long id) {
};
}

public static String getBackgroundImageUrl(long id) {
public static String getHappinessBackgroundUrl(long id) {
return switch ((int)id) {
case 1 ->
"https://softie-data-image.s3.ap-northeast-2.amazonaws.com/background/%E1%84%80%E1%85%AA%E1%86%AB%E1%84%80%E1%85%A8_%E1%84%8A%E1%85%A1%E1%87%82%E1%84%80%E1%85%B5.png";
"https://github.com/Team-Sopetit/sopetit-image/blob/main/happiness/card/img_happycard_1ver2@3x.png?raw=true";
case 2 ->
"https://softie-data-image.s3.ap-northeast-2.amazonaws.com/background/%E1%84%92%E1%85%A1%E1%86%AB_%E1%84%80%E1%85%A5%E1%86%AF%E1%84%8B%E1%85%B3%E1%86%B7_%E1%84%89%E1%85%A5%E1%86%BC%E1%84%8C%E1%85%A1%E1%86%BC.png";
"https://github.com/Team-Sopetit/sopetit-image/blob/main/happiness/card/img_happycard_3ver2@3x.png?raw=true";
case 3 ->
"https://softie-data-image.s3.ap-northeast-2.amazonaws.com/background/%E1%84%82%E1%85%A1%E1%84%8B%E1%85%AA_%E1%84%8E%E1%85%B5%E1%86%AB%E1%84%92%E1%85%A2%E1%84%8C%E1%85%B5%E1%84%80%E1%85%B5.png";
"https://github.com/Team-Sopetit/sopetit-image/blob/main/happiness/card/img_happycard_4ver2@3x.png?raw=true";
case 4 ->
"https://softie-data-image.s3.ap-northeast-2.amazonaws.com/background/%E1%84%86%E1%85%A1%E1%84%8B%E1%85%B3%E1%86%B7_%E1%84%8E%E1%85%A2%E1%86%BC%E1%84%80%E1%85%B5%E1%86%B7.png";
"https://github.com/Team-Sopetit/sopetit-image/blob/main/happiness/card/img_happycard_5ver2@3x.png?raw=true";
case 5 ->
"https://softie-data-image.s3.ap-northeast-2.amazonaws.com/background/%E1%84%80%E1%85%A5%E1%86%AB%E1%84%80%E1%85%A1%E1%86%BC%E1%84%92%E1%85%A1%E1%86%AB_%E1%84%86%E1%85%A9%E1%86%B7.png";
"https://github.com/Team-Sopetit/sopetit-image/blob/main/happiness/card/img_happycard_6ver2@3x.png?raw=true";
case 6 ->
"https://softie-data-image.s3.ap-northeast-2.amazonaws.com/background/%E1%84%90%E1%85%A9%E1%86%BC%E1%84%90%E1%85%A9%E1%86%BC%E1%84%92%E1%85%A1%E1%86%AB_%E1%84%90%E1%85%A9%E1%86%BC%E1%84%8C%E1%85%A1%E1%86%BC.png";
"https://github.com/Team-Sopetit/sopetit-image/blob/main/happiness/card/img_happycard_7ver2@3x.png?raw=true";
default ->
"https://softie-data-image.s3.ap-northeast-2.amazonaws.com/background/%E1%84%89%E1%85%A1%E1%86%AB%E1%84%84%E1%85%B3%E1%86%BA%E1%84%92%E1%85%A1%E1%86%AB_%E1%84%8B%E1%85%B5%E1%86%AF%E1%84%89%E1%85%A1%E1%86%BC.png";
"https://github.com/Team-Sopetit/sopetit-image/blob/main/happiness/card/img_happycard_2ver2@3x.png?raw=true";
};
}

Expand All @@ -51,4 +51,23 @@ public static String getIconImageUrl(long id) {
"https://softie-data-image.s3.ap-northeast-2.amazonaws.com/icon/%E1%84%89%E1%85%A1%E1%86%AB%E1%84%84%E1%85%B3%E1%86%BA%E1%84%92%E1%85%A1%E1%86%AB_%E1%84%8B%E1%85%B5%E1%86%AF%E1%84%89%E1%85%A1%E1%86%BC.png";
};
}

public static String getDailyBackgroundImageUrl(long id) {
return switch ((int)id) {
case 1 ->
"https://github.com/Team-Sopetit/sopetit-image/blob/main/routine/daily/small_kindness/background.png?raw=true";
case 2 ->
"https://github.com/Team-Sopetit/sopetit-image/blob/main/routine/daily/overcome_helplessness/background.png?raw=true";
case 3 ->
"https://github.com/Team-Sopetit/sopetit-image/blob/main/routine/daily/restful_sleep/background.png?raw=true";
case 4 ->
"https://github.com/Team-Sopetit/sopetit-image/blob/main/routine/daily/environmental_guard/background.png?raw=true";
case 5 ->
"https://github.com/Team-Sopetit/sopetit-image/blob/main/routine/daily/healthly_body/background.png?raw=true";
case 6 ->
"https://github.com/Team-Sopetit/sopetit-image/blob/main/routine/daily/chubby_bank_account/background.png?raw=true";
default ->
"https://github.com/Team-Sopetit/sopetit-image/blob/main/routine/daily/fresh_start/background.png?raw=true";
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static DailyThemeResponse of(Theme theme) {
.themeId(theme.getId())
.name(theme.getName())
.iconImageUrl(ThemeData.getIconImageUrl(theme.getId()))
.backgroundImageUrl(ThemeData.getBackgroundImageUrl(theme.getId()))
.backgroundImageUrl(ThemeData.getDailyBackgroundImageUrl(theme.getId()))
.build();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public record GetDailyRoutinesResponse(

public static GetDailyRoutinesResponse of(long themeId, List<Routine> routines) {
return GetDailyRoutinesResponse.builder()
.backgroundImageUrl(ThemeData.getBackgroundImageUrl(themeId))
.backgroundImageUrl(ThemeData.getDailyBackgroundImageUrl(themeId))
.routines(routines.stream().map(DailyRoutineResponse::of).toList())
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static GetHappinessSubRoutinesResponse of(Theme theme, Challenge challeng
.name(theme.getName())
.nameColor(ThemeData.getColor(theme.getId()))
.iconImageUrl(ThemeData.getIconImageUrl(theme.getId()))
.contentImageUrl(ThemeData.getBackgroundImageUrl(theme.getId()))
.contentImageUrl(ThemeData.getHappinessBackgroundUrl(theme.getId()))
.subRoutines(missions.stream().map(HappinessSubRoutineResponse::of).toList())
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ private record ThemeServiceResponse(
private static ThemeServiceResponse of(Theme theme) {
return ThemeServiceResponse.builder()
.iconImageUrl(ThemeData.getIconImageUrl(theme.getId()))
.cardImageUrl(ThemeData.getBackgroundImageUrl(theme.getId()))
.cardImageUrl(ThemeData.getHappinessBackgroundUrl(theme.getId()))
.name(theme.getName())
.color(ThemeData.getColor(theme.getId()))
.build();
Expand Down

0 comments on commit eb82dc9

Please sign in to comment.