Skip to content

Commit

Permalink
fix(be) #4 - book 상세 merge
Browse files Browse the repository at this point in the history
  • Loading branch information
G1Huh committed Jan 4, 2025
1 parent 1cdce54 commit a7954b3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import movlit.be.book.domain.Book;
import movlit.be.book.domain.BookComment;
import movlit.be.book.domain.BookCommentRequestDto;
import movlit.be.common.annotation.CurrentMemberId;
import movlit.be.common.exception.BookCommentAccessDenied;
import movlit.be.common.util.ids.BookCommentId;
import movlit.be.common.util.ids.BookId;
Expand Down Expand Up @@ -53,7 +52,7 @@ public class BookCommentController {

// 도서 리뷰 작성
@PostMapping("{bookId}/comments")
public String registerComment(@CurrentMemberId MemberId memberId, @PathVariable BookId bookId, @RequestBody BookCommentRequestDto commentDto) {
public String registerComment(@PathVariable BookId bookId, @RequestBody BookCommentRequestDto commentDto) {
// 임시 (추후 requestbody대신 session으로 memberId/email 받아오기)
MemberId memberIdTemp = new MemberId(commentDto.getMemberId());
System.out.println("############# memberID : " +memberIdTemp);
Expand All @@ -70,7 +69,7 @@ public String registerComment(@CurrentMemberId MemberId memberId, @PathVariable

// 도서 리뷰 수정
@PostMapping("{bookId}/comments/{bookCommentId}")
public ResponseEntity updateComment(@CurrentMemberId MemberId memberId, @PathVariable BookId bookId,
public ResponseEntity updateComment(@PathVariable BookId bookId,
@PathVariable BookCommentId bookCommentId, @RequestBody BookCommentRequestDto commentDto)
throws BookCommentAccessDenied {
// 임시 (추후 requestbody대신 session으로 memberId/email 받아오기)
Expand All @@ -90,7 +89,7 @@ public ResponseEntity updateComment(@CurrentMemberId MemberId memberId, @PathVar

// 도서 리뷰 삭제 - commentDto reuestBody 추후 삭제
@PostMapping("{bookId}/comments/{bookCommentId}/delete")
public ResponseEntity deleteComment(@CurrentMemberId MemberId memberId, @PathVariable BookId bookId,
public ResponseEntity deleteComment(@PathVariable BookId bookId,
@PathVariable BookCommentId bookCommentId, @RequestBody BookCommentRequestDto commentDto)
throws BookCommentAccessDenied {

Expand All @@ -111,7 +110,7 @@ public ResponseEntity deleteComment(@CurrentMemberId MemberId memberId, @PathVar

// 해당 도서 리뷰 좋아요(like) 하기
@PostMapping("{bookId}/comments/{bookCommentId}/likes/{memberTemp}")
public ResponseEntity addHearts(@CurrentMemberId MemberId memberId, @PathVariable BookId bookId,
public ResponseEntity addHearts(@PathVariable BookId bookId,
@PathVariable BookCommentId bookCommentId, @PathVariable String memberTemp){
//임시 - @CurrentMemberId 혹은 세션의 memberId로 원복필요
System.out.println("####멤버ID#### --> " + memberTemp);
Expand All @@ -128,7 +127,7 @@ public ResponseEntity addHearts(@CurrentMemberId MemberId memberId, @PathVariabl

// 해당 도서 리뷰 좋아요(like) 삭제
@DeleteMapping("{bookId}/comments/{bookCommentId}/likes/{memberTemp}")
public ResponseEntity removeHearts(@CurrentMemberId MemberId memberId, @PathVariable BookId bookId,
public ResponseEntity removeHearts(@PathVariable BookId bookId,
@PathVariable BookCommentId bookCommentId, @PathVariable String memberTemp)
throws Exception {
//임시 - @CurrentMemberId 혹은 세션의 memberId로 원복필요
Expand All @@ -144,4 +143,4 @@ public ResponseEntity removeHearts(@CurrentMemberId MemberId memberId, @PathVari
return ResponseEntity.ok().build();
}

}
}
2 changes: 1 addition & 1 deletion be/src/main/resources/application-db-local.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
spring:
datasource:
url: jdbc:mysql://localhost:3307/aladdinDB?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
url: jdbc:mysql://localhost:3306/venus?useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
username: root
password: 1234
jpa:
Expand Down
2 changes: 1 addition & 1 deletion be/src/test/java/movlit/be/acceptance/AcceptanceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public abstract class AcceptanceTest {
public static final DockerImageName MYSQL_IMAGE = DockerImageName.parse("mysql:8.0");
// public static final DockerImageName REDIS_IMAGE = DockerImageName.parse("redis:7.2");
public static final MySQLContainer<?> MYSQL = new MySQLContainer<>(MYSQL_IMAGE)
.withDatabaseName("venus").withUsername("root").withPassword("1111").withReuse(true);
.withDatabaseName("venus").withUsername("root").withPassword("1234").withReuse(true);
// public static final GenericContainer<?> REDIS = new GenericContainer<>(REDIS_IMAGE).withReuse(true);

static {
Expand Down

0 comments on commit a7954b3

Please sign in to comment.