-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from Mojacknong/feature_76/응원말-API
Feature 76/응원말 api
- Loading branch information
Showing
9 changed files
with
104 additions
and
40 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
14 changes: 14 additions & 0 deletions
14
.../java/com/modernfarmer/farmusspring/domain/user/dto/response/EncouragementMessageDto.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,14 @@ | ||
package com.modernfarmer.farmusspring.domain.user.dto.response; | ||
|
||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@NoArgsConstructor | ||
@AllArgsConstructor(staticName = "of") | ||
@Getter | ||
public class EncouragementMessageDto { | ||
|
||
String encouragementMessage; | ||
} |
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
40 changes: 40 additions & 0 deletions
40
src/main/java/com/modernfarmer/farmusspring/domain/user/util/EncouragementMessages.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,40 @@ | ||
package com.modernfarmer.farmusspring.domain.user.util; | ||
|
||
|
||
public enum EncouragementMessages { | ||
채소값절약(new String[]{ | ||
"채소를 직접 길러_식비를 줄여보세요!", | ||
"직접 기른 채소로_알뜰하고 현명한 식사를 해봐요!", | ||
"오늘도 채솟값_알뜰하게 아끼는 중!", | ||
"홈파밍으로 지출은 줄이고_성취감은 더해봐요", | ||
"직접 기른 채소로_매일 알뜰하게, 매일 특별하게!" | ||
}), | ||
신선하고안전한식재료(new String[]{ | ||
"파머님, 직접 기른 채소로_건강한 삶을 챙겨봐요!", | ||
"파머님의 사랑으로_오늘도 쑥쑥 자라는 중", | ||
"직접 기른 채소를_먹을 수 있는 그날까지!", | ||
"신선함으로 가득 채워지는 식탁, _ 늘 함께할게요!", | ||
"눈으로 보는 재미, 입으로 맛보는_홈파밍의 즐거움!" | ||
}), | ||
스트레스해소와정서적안정(new String[]{ | ||
"바쁜 일상에서 잠깐 벗어나_텃밭을 가꿔봐요", | ||
"홈파밍을 하며_마음의 안정을 느껴봐요!", | ||
"스트레스 받는 하루, _ 홈파밍으로 힐링하세요", | ||
"나만의 채소를 키우며_소소한 성취감을 느껴보세요", | ||
"성취감은 꾸준함에서! _ 오늘도 함께 성장해요" | ||
}); | ||
private final String[] messages; | ||
|
||
EncouragementMessages(String[] messages) { | ||
this.messages = messages; | ||
} | ||
|
||
public String getRandomMessage() { | ||
int index = (int) (Math.random() * messages.length); | ||
return messages[index]; | ||
} | ||
|
||
public static String getRandomMessageByKey(EncouragementMessages key) { | ||
return key.getRandomMessage(); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/com/modernfarmer/farmusspring/domain/user/util/RamdomFunction.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,12 @@ | ||
package com.modernfarmer.farmusspring.domain.user.util; | ||
|
||
import java.util.Random; | ||
|
||
public class RamdomFunction { | ||
|
||
private static final Random RANDOM = new Random(); | ||
|
||
public static int getRandomIntInRange(int start, int end) { | ||
return RANDOM.nextInt(end - start + 1) + start; | ||
} | ||
} |