Skip to content

Commit fa1ca3d

Browse files
authored
Merge pull request #103 from TEAM-Cherrish/develop
[Deploy] demo 변경사항 배포
2 parents fc9639a + e6dcefd commit fa1ca3d

26 files changed

Lines changed: 102 additions & 104 deletions

File tree

.github/workflows/cd-dev.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ name: CD Dev
33
on:
44
push:
55
branches:
6-
- develop
6+
- release
7+
- main
78

89
permissions:
910
id-token: write

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: CI
33
on:
44
pull_request:
55
branches:
6+
- release
67
- develop
78
- main
89

src/main/java/com/sopt/cherrish/domain/challenge/core/domain/model/ChallengeStatistics.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,11 @@ public void adjustCompletedCount(int delta) {
8383
}
8484
}
8585

86-
public double getProgressPercentage() {
86+
public int getProgressPercentage() {
8787
if (totalRoutineCount == 0) {
88-
return 0.0;
88+
return 0;
8989
}
90-
double percentage = (double) completedCount / totalRoutineCount * 100;
91-
return Math.round(percentage * 10.0) / 10.0; // 소수점 1자리까지 반올림
90+
return (int) Math.round((double) completedCount / totalRoutineCount * 100);
9291
}
9392

9493
/**

src/main/java/com/sopt/cherrish/domain/challenge/core/presentation/dto/response/ChallengeDetailResponseDto.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ public record ChallengeDetailResponseDto(
2323
@Schema(description = "현재 일차", example = "3")
2424
int currentDay,
2525

26-
@Schema(description = "전체 진행률 (%)", example = "37.5")
27-
double progressPercentage,
26+
@Schema(description = "전체 진행률 (%)", example = "38")
27+
int progressPercentage,
2828

2929
@Schema(description = "체리 레벨 (1-4)", example = "2")
3030
int cherryLevel,

src/main/java/com/sopt/cherrish/domain/challenge/demo/domain/model/DemoChallengeStatistics.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,11 @@ public void updateCherryLevel() {
7777
this.cherryLevel = calculateCherryLevel();
7878
}
7979

80-
public double getProgressPercentage() {
80+
public int getProgressPercentage() {
8181
if (totalRoutineCount == 0) {
82-
return 0.0;
82+
return 0;
8383
}
84-
double percentage = (double) completedCount / totalRoutineCount * 100;
85-
return Math.round(percentage * 10.0) / 10.0;
84+
return (int) Math.round((double) completedCount / totalRoutineCount * 100);
8685
}
8786

8887
/**

src/main/java/com/sopt/cherrish/domain/challenge/recommendation/application/service/AiChallengeRecommendationService.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,8 @@ public AiRecommendationResponseDto generateRecommendation(Integer homecareRoutin
5151
OpenAiChallengeRecommendationResponseDto.class
5252
);
5353

54-
log.info("AI 챌린지 추천 생성 완료: title={}", aiResponse.challengeTitle());
54+
log.info("AI 챌린지 추천 생성 완료: routines={}", aiResponse.routines());
5555

56-
return AiRecommendationResponseDto.of(
57-
aiResponse.challengeTitle(),
58-
aiResponse.routines()
59-
);
56+
return AiRecommendationResponseDto.of(aiResponse.routines());
6057
}
6158
}

src/main/java/com/sopt/cherrish/domain/challenge/recommendation/infrastructure/openai/OpenAiChallengeRecommendationResponseDto.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
* Infrastructure 계층의 외부 API 응답 DTO
1010
*/
1111
public record OpenAiChallengeRecommendationResponseDto(
12-
@JsonProperty("challenge_title")
13-
String challengeTitle,
14-
1512
@JsonProperty("routines")
1613
List<String> routines
1714
) {

src/main/java/com/sopt/cherrish/domain/challenge/recommendation/infrastructure/prompt/ChallengePromptTemplate.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,13 @@ public class ChallengePromptTemplate {
1111
private static final String CHALLENGE_RECOMMENDATION_TEMPLATE = """
1212
당신은 피부 홈케어 전문가입니다.
1313
사용자가 선택한 홈케어 루틴 카테고리: "{homecareContent}"
14-
15-
위 카테고리에 맞는 7일 챌린지를 설계해주세요.
16-
17-
응답 형식:
18-
1. 챌린지 제목: 흥미롭고 동기부여가 되는 한글 제목 (최대 30자)
19-
2. 실천 루틴 리스트: 하루 3-5개의 구체적인 실천 항목 (각 최대 50자)
20-
14+
15+
위 카테고리에 맞는 7일 챌린지 실천 루틴을 추천해주세요.
16+
17+
답 형식: routines 배열에 하루 3-5개의 구체적인 실천 항목(각 최대 50자)
18+
2119
응답은 반드시 다음 JSON 형식으로만 답변하세요:
2220
{{
23-
"challenge_title": "챌린지 제목",
2421
"routines": ["루틴1", "루틴2", "루틴3", "루틴4", "루틴5"]
2522
}}
2623
""";

src/main/java/com/sopt/cherrish/domain/challenge/recommendation/presentation/dto/response/AiRecommendationResponseDto.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,10 @@
66

77
@Schema(description = "AI 챌린지 추천 응답")
88
public record AiRecommendationResponseDto(
9-
@Schema(description = "AI가 생성한 챌린지 제목", example = "피부 보습 7일 챌린지")
10-
String challengeTitle,
11-
129
@Schema(description = "추천 루틴 리스트 (3-5개)")
1310
List<String> routines
1411
) {
15-
public static AiRecommendationResponseDto of(String challengeTitle, List<String> routines) {
16-
return new AiRecommendationResponseDto(challengeTitle, routines);
12+
public static AiRecommendationResponseDto of(List<String> routines) {
13+
return new AiRecommendationResponseDto(routines);
1714
}
1815
}

src/main/java/com/sopt/cherrish/domain/maindashboard/application/facade/MainDashboardFacade.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public MainDashboardResponseDto getMainDashboard(Long userId) {
5353

5454
// 3. 챌린지 데이터 (활성 챌린지 없으면 0)
5555
Integer cherryLevel = 0;
56-
Double challengeRate = 0.0;
56+
Integer challengeRate = 0;
5757
String challengeName = null;
5858

5959
var challengeOpt = challengeService.findActiveChallengeWithStatistics(userId);

0 commit comments

Comments
 (0)