Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 18 additions & 12 deletions server/src/main/java/com/soopgyeol/api/domain/enums/Category.java
Original file line number Diff line number Diff line change
@@ -1,28 +1,34 @@
package com.soopgyeol.api.domain.enums;

public enum Category {
FOOD("음식", "https://soopgyeolbucket.s3.ap-northeast-2.amazonaws.com/FOOD.jpg"),
TRANSPORT("교통", "https://soopgyeolbucket.s3.ap-northeast-2.amazonaws.com/TRANSPORTATION.jpg"),
CLOTHING("의류", "https://soopgyeolbucket.s3.ap-northeast-2.amazonaws.com/CLOTHING.jpg"),
HOUSING_ENERGY("주거 및 에너지", "https://soopgyeolbucket.s3.ap-northeast-2.amazonaws.com/HOUSING_ENERGY.jpg"),
RECYCLE_WASTE("리사이클 & 폐기물", "https://soopgyeolbucket.s3.ap-northeast-2.amazonaws.com/RECYCLE.jpg"),
LIFESTYLE_CONSUMPTION("라이프스타일 & 소비", "https://soopgyeolbucket.s3.ap-northeast-2.amazonaws.com/LIFESTYLE.jpg"),
ETC("기타", "https://soopgyeolbucket.s3.ap-northeast-2.amazonaws.com/ETC.JPG");
FOOD("음식", "https://soopgyeolbucket.s3.ap-northeast-2.amazonaws.com/FOOD.png","https://soopgyeolbucket.s3.ap-northeast-2.amazonaws.com/CHALLENGE_FOOD.png"),
TRANSPORT("교통", "https://soopgyeolbucket.s3.ap-northeast-2.amazonaws.com/TRANSPORTATION.png", "https://soopgyeolbucket.s3.ap-northeast-2.amazonaws.com/CHALLENGE_TRANSPORTATION.png"),
CLOTHING("의류", "https://soopgyeolbucket.s3.ap-northeast-2.amazonaws.com/CLOTHING.png", "https://soopgyeolbucket.s3.ap-northeast-2.amazonaws.com/CHALLENGE_CLOTHING.png"),
HOUSING_ENERGY("주거 및 에너지", "https://soopgyeolbucket.s3.ap-northeast-2.amazonaws.com/HOUSING_ENERGY.png", "https://soopgyeolbucket.s3.ap-northeast-2.amazonaws.com/CHALLENGE_HOUSING_ENERGY.png"),
RECYCLE_WASTE("리사이클 & 폐기물", "https://soopgyeolbucket.s3.ap-northeast-2.amazonaws.com/RECYCLE.png", "https://soopgyeolbucket.s3.ap-northeast-2.amazonaws.com/CHALLENGE_RECYCLE.png"),
LIFESTYLE_CONSUMPTION("라이프스타일 & 소비", "https://soopgyeolbucket.s3.ap-northeast-2.amazonaws.com/LIFESTYLE.png", "https://soopgyeolbucket.s3.ap-northeast-2.amazonaws.com/CHALLENGE_LIFESTYLE.png"),
ETC("기타", "https://soopgyeolbucket.s3.ap-northeast-2.amazonaws.com/ETC.png", "https://soopgyeolbucket.s3.ap-northeast-2.amazonaws.com/CHALLENGE_ETC.png");

private final String description;
private final String imageUrl;
private final String searchImageUrl;
private final String challengeImageUrl;

Category(String description, String imageUrl) {
Category(String description, String searchImageUrl, String challengeImageUrl) {
this.description = description;
this.imageUrl = imageUrl;
this.searchImageUrl = searchImageUrl;
this.challengeImageUrl = challengeImageUrl;
}

public String getDescription() {
return description;
}

public String getImageUrl() {
return imageUrl;
public String getSearchImageUrl() {
return searchImageUrl;
}

public String getChallengeImageUrl() {
return challengeImageUrl;
}

public static Category fromString(String value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public CarbonAnalysisResponse analyzeAndSave(String userInput) {
.carbonGrams(savedItem.getCarbonValue())
.growthPoint(savedItem.getGrowthPoint())
.explanation(savedItem.getExplanation())
.categoryImageUrl(savedItem.getCategory().getImageUrl())
.categoryImageUrl(savedItem.getCategory().getSearchImageUrl())
.build();
}

Expand Down Expand Up @@ -77,7 +77,7 @@ public CarbonAnalysisResponse analyzeByKeyword(String keyword, Category category
.carbonGrams(savedItem.getCarbonValue())
.growthPoint(savedItem.getGrowthPoint())
.explanation(savedItem.getExplanation())
.categoryImageUrl(savedItem.getCategory().getImageUrl())
.categoryImageUrl(savedItem.getCategory().getSearchImageUrl())
.challengeId(challengeId)
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public ChallengeTodayResponse getTodayChallengeForUser(Long userId) {
.category(dailyChallenge.getCategory())
.progressCount(userChallenge.getProgressCount())
.isCompleted(userChallenge.isCompleted())
.categoryImageUrl(dailyChallenge.getCategory().getImageUrl())
.categoryImageUrl(dailyChallenge.getCategory().getChallengeImageUrl())
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public AIChallengePromptResult generateChallenge() {
- challengeTitle은 15자 이내의 짧고 명확한 챌린지 제목
- rewardMoney는 너가 판단하기에 챌린지 난이도에 따라 5 ~ 20으로 줘!
- carbonKeyword는 기존 탄소 소비 분석 기능에서 사용하는 실생활 소비 키워드여야 해 (예: 다회용컵, 채식, 대중교통, 전기차, 에너지 절약, 음식물 쓰레기 줄이기 등)
- category는 FOOD, TRANSPORTATION, CLOTHING, HOUSING_ENERGY, RECYCLE_WASTE, LIFESTYLE_CONSUMPTION 중 하나
- category는 FOOD, TRANSPORT, CLOTHING, HOUSING_ENERGY, RECYCLE_WASTE, LIFESTYLE_CONSUMPTION 중 하나
{
"challengeTitle": (챌린지명),
"category": (위 category 중 하나),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public CarbonAnalysisResponse analyzeCarbon(String userInput) {
품목명과, 탄소량 설명은 반드시 한글로 대답해줘.


FOOD, TRANSPORTATION, CLOTHING, HOUSING_ENERGY, RECYCLE_WASTE, LIFESTYLE_CONSUMPTION, ETC 중 하나
FOOD, TRANSPORT, CLOTHING, HOUSING_ENERGY, RECYCLE_WASTE, LIFESTYLE_CONSUMPTION, ETC 중 하나

"growthPoint"는 사용자의 해당 활동 또는 소비에 따라서 탄소가 절감되는 정도를 너가 판단해서 0~20점 사이로 점수를 줘.
ETC는 탄소량, growthPoint 모두 0점으로 줘.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.