Skip to content

Commit

Permalink
풀 리퀘스트 병합 #126
Browse files Browse the repository at this point in the history
pr
  • Loading branch information
J-Yong99 authored May 2, 2024
2 parents cb6a3da + 109ce85 commit 0ae10f1
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ public class Receipt extends BaseEntity {
@Column(name = "neutral")
private Float neutral;

// disgust
@Column(name = "disgust")
private Float disgust;

@Column(name = "receipt_theme_type", nullable = false)
private String receiptThemeType;
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ public static class getReceipt {

private Float neutral;

private Float disgust;

private String receiptThemeType;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ private ReceiptRequestDTO.getReceipt mapToReceiptDTO(Receipt receipt) {
.sad(receipt.getSad())
.angry(receipt.getAngry())
.neutral(receipt.getNeutral())
.disgust(receipt.getDisgust())
.receiptThemeType(receipt.getReceiptThemeType())
.build();
}
Expand All @@ -98,10 +99,12 @@ public Map<String, Float> getCardViewCount(Trip trip) {
Float sad = 0f;
Float angry = 0f;
Float neutral = 0f;
Float disgust = 0f;
emotionMap.put("happy", 0f);
emotionMap.put("sad", 0f);
emotionMap.put("angry", 0f);
emotionMap.put("neutral", 0f);
emotionMap.put("disgust", 0f);
emotionMap.put("total", 0f);
int cardViewCount = 0;
for (TripFile tripFile : tripFiles) {
Expand All @@ -111,6 +114,7 @@ public Map<String, Float> getCardViewCount(Trip trip) {
happy += cardView.getHappy();
sad += cardView.getSad();
angry += cardView.getAngry();
disgust += cardView.getDisgust();
neutral += cardView.getNeutral();
}
}
Expand Down Expand Up @@ -142,7 +146,8 @@ public void createReceipt(Long userId, ReceiptRequestDTO.createReceipt createRec
float sad = map.get("sad");
float angry = map.get("angry");
float neutral = map.get("neutral");
float total = happy + sad + angry + neutral;
float disgust = map.get("disgust");
float total = happy + sad + angry + neutral + disgust;

// 영수증 생성
Receipt receipt = Receipt.builder()
Expand All @@ -159,6 +164,7 @@ public void createReceipt(Long userId, ReceiptRequestDTO.createReceipt createRec
.sad(sad / total)
.angry(angry / total)
.neutral(neutral / total)
.disgust(disgust / total)
.receiptThemeType(createReceipt.getReceiptThemeType())
.build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ <h4 id="_예약일_전부_조회_http_response"><a class="link" href="#_예약
"detailMsg" : "",
"data" : {
"cardViews" : [ {
"bookedDate" : "2024-05-01"
"bookedDate" : "2024-05-02"
}, {
"bookedDate" : "2023-10-10"
} ]
Expand Down Expand Up @@ -2814,8 +2814,8 @@ <h4 id="_여행_등록_http_request"><a class="link" href="#_여행_등록_http_
Host: localhost:8080

{
"startDate" : "2024-05-01",
"endDate" : "2024-05-02",
"startDate" : "2024-05-02",
"endDate" : "2024-05-03",
"tripName" : "test"
}</code></pre>
</div>
Expand Down Expand Up @@ -2847,8 +2847,8 @@ <h4 id="_여행_등록_request_body"><a class="link" href="#_여행_등록_reque
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight nowrap"><code class="language-json hljs" data-lang="json">{
"startDate" : "2024-05-01",
"endDate" : "2024-05-02",
"startDate" : "2024-05-02",
"endDate" : "2024-05-03",
"tripName" : "test"
}</code></pre>
</div>
Expand Down Expand Up @@ -3013,22 +3013,22 @@ <h4 id="_여행_목록_조회_http_response"><a class="link" href="#_여행_목
"trips" : [ {
"id" : 1,
"email" : "test",
"startDate" : "2024-05-01",
"endDate" : "2024-05-02",
"startDate" : "2024-05-02",
"endDate" : "2024-05-03",
"analyzingCount" : 0,
"tripName" : "test"
}, {
"id" : 2,
"email" : "test",
"startDate" : "2024-05-01",
"endDate" : "2024-05-02",
"startDate" : "2024-05-02",
"endDate" : "2024-05-03",
"analyzingCount" : 1,
"tripName" : "test"
}, {
"id" : 3,
"email" : "test",
"startDate" : "2024-05-01",
"endDate" : "2024-05-02",
"startDate" : "2024-05-02",
"endDate" : "2024-05-03",
"analyzingCount" : 2,
"tripName" : "test"
} ]
Expand Down Expand Up @@ -3122,8 +3122,8 @@ <h4 id="_여행_수정_http_request"><a class="link" href="#_여행_수정_http_

{
"tripId" : 1,
"startDate" : "2024-05-01",
"endDate" : "2024-05-02",
"startDate" : "2024-05-02",
"endDate" : "2024-05-03",
"tripName" : "test"
}</code></pre>
</div>
Expand Down Expand Up @@ -3156,8 +3156,8 @@ <h4 id="_여행_수정_request_body"><a class="link" href="#_여행_수정_reque
<div class="content">
<pre class="highlightjs highlight nowrap"><code class="language-json hljs" data-lang="json">{
"tripId" : 1,
"startDate" : "2024-05-01",
"endDate" : "2024-05-02",
"startDate" : "2024-05-02",
"endDate" : "2024-05-03",
"tripName" : "test"
}</code></pre>
</div>
Expand Down Expand Up @@ -3823,7 +3823,7 @@ <h4 id="_영수증_목록_조회_http_response"><a class="link" href="#_영수
<div class="content">
<pre class="highlightjs highlight nowrap"><code class="language-http hljs" data-lang="http">HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1724
Content-Length: 1793

{
"status" : 200,
Expand All @@ -3847,6 +3847,7 @@ <h4 id="_영수증_목록_조회_http_response"><a class="link" href="#_영수
"sad" : 20.0,
"angry" : 20.95,
"neutral" : 19.05,
"disgust" : 0.0,
"receiptThemeType" : "A"
}, {
"id" : 2,
Expand All @@ -3864,6 +3865,7 @@ <h4 id="_영수증_목록_조회_http_response"><a class="link" href="#_영수
"sad" : 20.0,
"angry" : 20.95,
"neutral" : 19.05,
"disgust" : 0.0,
"receiptThemeType" : "B"
}, {
"id" : 3,
Expand All @@ -3881,6 +3883,7 @@ <h4 id="_영수증_목록_조회_http_response"><a class="link" href="#_영수
"sad" : 20.0,
"angry" : 20.95,
"neutral" : 19.05,
"disgust" : 0.0,
"receiptThemeType" : "A"
} ],
"pagination" : {
Expand Down Expand Up @@ -4011,6 +4014,11 @@ <h4 id="_영수증_목록_조회_response_fields"><a class="link" href="#_영수
<td class="tableblock halign-left valign-top"><p class="tableblock">중립적인 감정 비율</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>data.receiptList[].disgust</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>Number</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">역겨운 감정 비율</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>data.receiptList[].receiptThemeType</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>String</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">영수증 테마 타입</p></td>
Expand Down Expand Up @@ -4189,19 +4197,19 @@ <h4 id="_여행의_모든_파일_조회_http_response"><a class="link" href="#_
"id" : 1,
"tripId" : 1,
"email" : "test",
"yearDate" : "2024-05-01",
"yearDate" : "2024-05-02",
"analyzingCount" : 1
}, {
"id" : 2,
"tripId" : 2,
"email" : "test",
"yearDate" : "2024-05-02",
"yearDate" : "2024-05-03",
"analyzingCount" : 2
}, {
"id" : 3,
"tripId" : 3,
"email" : "test",
"yearDate" : "2024-05-03",
"yearDate" : "2024-05-04",
"analyzingCount" : 1
} ]
}
Expand Down Expand Up @@ -4284,19 +4292,19 @@ <h4 id="_여행의_모든_파일_조회_response_body"><a class="link" href="#_
"id" : 1,
"tripId" : 1,
"email" : "test",
"yearDate" : "2024-05-01",
"yearDate" : "2024-05-02",
"analyzingCount" : 1
}, {
"id" : 2,
"tripId" : 2,
"email" : "test",
"yearDate" : "2024-05-02",
"yearDate" : "2024-05-03",
"analyzingCount" : 2
}, {
"id" : 3,
"tripId" : 3,
"email" : "test",
"yearDate" : "2024-05-03",
"yearDate" : "2024-05-04",
"analyzingCount" : 1
} ]
}
Expand Down Expand Up @@ -4410,19 +4418,19 @@ <h4 id="_일상기록_조회_http_response"><a class="link" href="#_일상기록
"id" : 1,
"tripId" : 1,
"email" : "test",
"yearDate" : "2024-05-01",
"yearDate" : "2024-05-02",
"analyzingCount" : 1
}, {
"id" : 2,
"tripId" : 2,
"email" : "test",
"yearDate" : "2024-05-02",
"yearDate" : "2024-05-03",
"analyzingCount" : 2
}, {
"id" : 3,
"tripId" : 3,
"email" : "test",
"yearDate" : "2024-05-03",
"yearDate" : "2024-05-04",
"analyzingCount" : 1
} ]
}
Expand Down Expand Up @@ -4483,19 +4491,19 @@ <h4 id="_일상기록_조회_response_body"><a class="link" href="#_일상기록
"id" : 1,
"tripId" : 1,
"email" : "test",
"yearDate" : "2024-05-01",
"yearDate" : "2024-05-02",
"analyzingCount" : 1
}, {
"id" : 2,
"tripId" : 2,
"email" : "test",
"yearDate" : "2024-05-02",
"yearDate" : "2024-05-03",
"analyzingCount" : 2
}, {
"id" : 3,
"tripId" : 3,
"email" : "test",
"yearDate" : "2024-05-03",
"yearDate" : "2024-05-04",
"analyzingCount" : 1
} ]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,17 @@ public SchedulerResponseDTO.AIModelRunResponseDTO getIncompleteCardViews() throw
log.info("cards.size : " + cards.size());
for (CardView card : cards) {
AiModelRunResponseDTO.RunModel ret = aiService.runAi(card.getRecordFileName(), card.getTripFile().getTrip().getUser().getId());
log.info("ret.status : " + ret.getStatus());
log.info("ret.text : " + ret.getText());
log.info("ret.happy : " + ret.getEmotions().getHappy());
log.info("ret.sad : " + ret.getEmotions().getSad());
log.info("ret.angry : " + ret.getEmotions().getAngry());
log.info("ret.neutral : " + ret.getEmotions().getNeutral());
log.info("ret.disgust : " + ret.getEmotions().getDisgust());
log.info("ret.error : " + ret.getError());
log.info("ret.file_name : " + ret.getFile_name());
log.info("ret.file_path : " + ret.getFile_path());
if (Objects.equals(ret.getStatus(), "200")){
log.info("ret.status : " + ret.getStatus());
log.info("ret.text : " + ret.getText());
log.info("ret.happy : " + ret.getEmotions().getHappy());
log.info("ret.sad : " + ret.getEmotions().getSad());
log.info("ret.angry : " + ret.getEmotions().getAngry());
log.info("ret.neutral : " + ret.getEmotions().getNeutral());
log.info("ret.disgust : " + ret.getEmotions().getDisgust());
log.info("ret.error : " + ret.getError());
log.info("ret.file_name : " + ret.getFile_name());
log.info("ret.file_path : " + ret.getFile_path());
card.setRecordFileStatus("DONE");
card.setStt(ret.getText());
card.setHappy(ret.getEmotions().getHappy());
Expand Down

0 comments on commit 0ae10f1

Please sign in to comment.