Skip to content

Commit

Permalink
Merge pull request #104 from mummhy0811/main
Browse files Browse the repository at this point in the history
Fix: 개인 질문 엔지니어링 쿼리 수정
  • Loading branch information
mummhy0811 authored Nov 25, 2023
2 parents 565423d + d10a37f commit ba625bd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ private HttpEntity<ChatRequestDTO> getHttpEntity(ChatRequestDTO chatRequest) {
public String getKeyword(){
Random random = new Random();
random.setSeed(System.currentTimeMillis());
Long randomNum = (long) (random.nextInt(30) + 1);
Long randomNum = (long) (random.nextInt(70) + 1);
Optional<KeyWord> optionalKeyWord = iKeyWordRepository.findById(randomNum);
return optionalKeyWord.get().getKeyword();
}
Expand Down Expand Up @@ -153,7 +153,7 @@ public void getQuestions() {
String query4 = "나를 잘 표현할 수 있는 질문을 1개 추천해줘.";
query4 += "\n질문의 조건은 다음과 같아.";
query4 += "\n1.내가 어떤 사람인지 표현할 수 있을 만한 질문이어야해";
query4 += "\n2.조금은 유쾌한 질문이면 좋겠어.";
query4 += "\n2.장난스럽고 유쾌한 질문어어도 괜찮아.";
query4 += "\n3.다음 키워드와 관련된 질문이어야돼: ";
query4 += getKeyword();
query4 += "\n답변 형식은 '오늘의 질문: {오늘의 질문}' 이 형식으로 적어줘";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalTime;
import java.util.ArrayList;
import java.util.Date;
Expand Down Expand Up @@ -72,17 +71,13 @@ public Boolean canQuiz(String family_id){
Boolean canQuiz = true;
Date writeDate = new Date();
LocalTime now = LocalTime.now();
log.info("Tset1 ={}",writeDate);
if(now.getHour()<6){
Date dDate = new Date();
writeDate = new Date(dDate.getTime()+(1000*60*60*24*-1));
log.info("Tset2 ={}",writeDate);
}
Optional<Quiz> optionalQuiz = iQuizRepository.findQuizByWriteDate(family_id,writeDate);
log.info("Tset3 ={}",optionalQuiz);
// 같은 날에 퀴즈를 생성 했을 시
if(optionalQuiz.isPresent()){
log.info("Tset4 ={}",optionalQuiz.get());
canQuiz = false;
}

Expand Down

0 comments on commit ba625bd

Please sign in to comment.