Skip to content

Commit

Permalink
[CHORE] 감정에 따른 주류 return api 주석처리 및 etc file
Browse files Browse the repository at this point in the history
[CHORE] 감정에 따른 주류 return api 주석처리 및 etc file
  • Loading branch information
SunYerim authored Jul 2, 2024
2 parents cd21e41 + 1e319f1 commit c169d83
Show file tree
Hide file tree
Showing 20 changed files with 136 additions and 114 deletions.
Binary file modified .gradle/8.8/executionHistory/executionHistory.bin
Binary file not shown.
Binary file modified .gradle/8.8/executionHistory/executionHistory.lock
Binary file not shown.
Binary file modified .gradle/8.8/fileHashes/fileHashes.bin
Binary file not shown.
Binary file modified .gradle/8.8/fileHashes/fileHashes.lock
Binary file not shown.
Binary file modified .gradle/8.8/fileHashes/resourceHashesCache.bin
Binary file not shown.
Binary file modified .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
Binary file modified .gradle/file-system.probe
Binary file not shown.
Binary file modified build/libs/drinktionary-0.0.1-SNAPSHOT-plain.jar
Binary file not shown.
Binary file modified build/libs/drinktionary-0.0.1-SNAPSHOT.jar
Binary file not shown.

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions build/reports/tests/test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ <h1>Test Summary</h1>
</td>
<td>
<div class="infoBox" id="duration">
<div class="counter">0.304s</div>
<div class="counter">0.297s</div>
<p>duration</p>
</div>
</td>
Expand Down Expand Up @@ -85,7 +85,7 @@ <h2>Packages</h2>
<td>1</td>
<td>0</td>
<td>0</td>
<td>0.304s</td>
<td>0.297s</td>
<td class="success">100%</td>
</tr>
</tbody>
Expand All @@ -112,7 +112,7 @@ <h2>Classes</h2>
<td>1</td>
<td>0</td>
<td>0</td>
<td>0.304s</td>
<td>0.297s</td>
<td class="success">100%</td>
</tr>
</tbody>
Expand All @@ -126,7 +126,7 @@ <h2>Classes</h2>
<input id="line-wrapping-toggle" type="checkbox" autocomplete="off"/>
</label>
</div>Generated by
<a href="http://www.gradle.org">Gradle 8.8</a> at 2024. 6. 26. 오전 12:35:44</p>
<a href="http://www.gradle.org">Gradle 8.8</a> at 2024. 7. 1. 오후 3:35:17</p>
</div>
</div>
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ <h1>Package com.sunjoo.drinktionary</h1>
</td>
<td>
<div class="infoBox" id="duration">
<div class="counter">0.304s</div>
<div class="counter">0.297s</div>
<p>duration</p>
</div>
</td>
Expand Down Expand Up @@ -83,7 +83,7 @@ <h2>Classes</h2>
<td>1</td>
<td>0</td>
<td>0</td>
<td>0.304s</td>
<td>0.297s</td>
<td class="success">100%</td>
</tr>
</table>
Expand All @@ -96,7 +96,7 @@ <h2>Classes</h2>
<input id="line-wrapping-toggle" type="checkbox" autocomplete="off"/>
</label>
</div>Generated by
<a href="http://www.gradle.org">Gradle 8.8</a> at 2024. 6. 26. 오전 12:35:44</p>
<a href="http://www.gradle.org">Gradle 8.8</a> at 2024. 7. 1. 오후 3:35:17</p>
</div>
</div>
</body>
Expand Down

Large diffs are not rendered by default.

Binary file modified build/test-results/test/binary/output.bin
Binary file not shown.
Binary file modified build/test-results/test/binary/output.bin.idx
Binary file not shown.
Binary file modified build/test-results/test/binary/results.bin
Binary file not shown.
Binary file modified build/tmp/compileJava/previous-compilation-data.bin
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.sunjoo.drinktionary.controller;

import com.sunjoo.drinktionary.dto.*;
import com.sunjoo.drinktionary.entity.Drink;
import com.sunjoo.drinktionary.entity.DrinkType;
import com.sunjoo.drinktionary.entity.Sentiment;
import com.sunjoo.drinktionary.service.DrinkService;
import com.sunjoo.drinktionary.service.ReviewService;
import lombok.RequiredArgsConstructor;
Expand Down Expand Up @@ -81,11 +83,23 @@ public ResponseEntity<ReviewResponse> createReview(@RequestHeader("Authorization

// 주류 리뷰 리스트 조회
@GetMapping("/{drink_id}/reviews")
public ResponseEntity<ReviewResponses> findReviewsById(@RequestHeader("userNo") String userNo, @PathVariable(value = "drink_id") Long drinkId) {
public ResponseEntity<ReviewResponses> findReviewsById(@RequestHeader("Authorization") String token, @PathVariable(value = "drink_id") Long drinkId) {
final ReviewResponses reviews = reviewService.getReviews(drinkId);

return ResponseEntity.ok(reviews);
}

// 감정에 따른 주류 반환
// @GetMapping("/recommend")
// public ResponseEntity<?> recommendSentiment(@RequestHeader("Authorization") String token, @RequestParam String sentiment) {
// Sentiment sentimentEnum;
// sentimentEnum = Sentiment.valueOf(sentiment.toUpperCase());
//
// Drink drink = drinkService.getRecommendDrink(sentimentEnum);
//
// final DrinkResponse drinkResponse = drinkService.
// return ResponseEntity.ok(drinkResponse);
// }
//

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
import com.sunjoo.drinktionary.dto.ReviewResponse;
import com.sunjoo.drinktionary.dto.WriteReviewRequest;
import com.sunjoo.drinktionary.entity.DrinkType;
import com.sunjoo.drinktionary.entity.Sentiment;
import com.sunjoo.drinktionary.repository.DrinkRepository;
import com.sunjoo.drinktionary.dto.DrinkResponse;
import com.sunjoo.drinktionary.entity.Drink;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -111,4 +113,10 @@ public ReviewResponse postReview(final Long drinkId, final WriteReviewRequest re
return reviewService.postReview(drink, request, token);
}

public Drink getRecommendDrink(final Sentiment sentiment) {
final List<Drink> drinks = drinkRepository.findBySentiment(sentiment);
Collections.shuffle(drinks);

return drinks.get(0);
}
}
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spring:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://sunjoo-drinktionary.clau8wyu484y.ap-northeast-2.rds.amazonaws.com:3306/sunjoo?useSSL=false&useUnicode=true&serverTimezone=Asia/Seoul&allowPublicKeyRetrieval=true&createDatabaseIfNotExist=true
username: root
password: drinktionary0606
password: sunjoo-drinktionary0628
jpa:
hibernate:
ddl-auto: validate
Expand Down

0 comments on commit c169d83

Please sign in to comment.