From c0667a57c4c375234ba859e478cd14ef4dade8bc Mon Sep 17 00:00:00 2001 From: hyeesw Date: Sun, 25 Aug 2024 18:14:23 +0900 Subject: [PATCH] =?UTF-8?q?[debug]=20#111=20=EC=98=A4=ED=94=88=ED=86=A1=20?= =?UTF-8?q?=EC=B0=B8=EC=97=AC=ED=95=98=EA=B8=B0=20=EC=97=90=EB=9F=AC=20?= =?UTF-8?q?=ED=99=95=EC=9D=B8=20(findByUserAndOpentalk)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../book/backend/domain/message/mapper/MessageMapper.java | 4 ++++ .../backend/domain/opentalk/service/OpentalkService.java | 1 + src/main/java/com/book/backend/global/SwaggerConfig.java | 5 ++--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/book/backend/domain/message/mapper/MessageMapper.java b/src/main/java/com/book/backend/domain/message/mapper/MessageMapper.java index d7b63995..c79411df 100644 --- a/src/main/java/com/book/backend/domain/message/mapper/MessageMapper.java +++ b/src/main/java/com/book/backend/domain/message/mapper/MessageMapper.java @@ -11,6 +11,7 @@ import com.book.backend.exception.CustomException; import com.book.backend.exception.ErrorCode; import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; import org.modelmapper.ModelMapper; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; @@ -19,6 +20,7 @@ @Component @RequiredArgsConstructor +@Slf4j public class MessageMapper { private final ModelMapper mapper; private final UserService userService; @@ -27,6 +29,7 @@ public class MessageMapper { @Transactional public Message convertToMessage(MessageRequestDto dto) { + log.trace("MessageMapper > convertToMessage()"); User user = userService.loadLoggedinUser(); if (user == null) { throw new CustomException(ErrorCode.USER_NOT_FOUND); @@ -44,6 +47,7 @@ public Message convertToMessage(MessageRequestDto dto) { } public MessageResponseDto convertToMessageResponseDto(Message message) { + log.trace("MessageMapper > convertToMessageResponseDto()"); User user = userRepository.findByLoginId(message.getUser().getLoginId()).orElseThrow(); return MessageResponseDto.builder() .nickname(user.getNickname()) diff --git a/src/main/java/com/book/backend/domain/opentalk/service/OpentalkService.java b/src/main/java/com/book/backend/domain/opentalk/service/OpentalkService.java index 1bcd9936..f26997eb 100644 --- a/src/main/java/com/book/backend/domain/opentalk/service/OpentalkService.java +++ b/src/main/java/com/book/backend/domain/opentalk/service/OpentalkService.java @@ -148,6 +148,7 @@ public OpentalkJoinResponseDto joinOpentalk(String isbn, int pageSize){ // 즐찾 여부 User user = userService.loadLoggedinUser(); boolean isFavorite = userOpentalkRepository.findByUserAndOpentalk(user, opentalk) != null; + log.debug("즐찾여부 문제?", isFavorite); return OpentalkJoinResponseDto.builder() .opentalkId(opentalk.getOpentalkId()) diff --git a/src/main/java/com/book/backend/global/SwaggerConfig.java b/src/main/java/com/book/backend/global/SwaggerConfig.java index 5d664d48..c7bae892 100644 --- a/src/main/java/com/book/backend/global/SwaggerConfig.java +++ b/src/main/java/com/book/backend/global/SwaggerConfig.java @@ -27,11 +27,10 @@ public OpenAPI api() { .addList("Bearer Token"); Server server = new Server(); - server.setUrl("https://www.readables.site"); + server.setUrl("localhost:8080"); return new OpenAPI() .components(new Components().addSecuritySchemes("Bearer Token", apiKey)) - .addSecurityItem(securityRequirement) - .addServersItem(server); + .addSecurityItem(securityRequirement); } }