Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
import jakarta.validation.constraints.NotBlank;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;

@Getter
@NoArgsConstructor
@ToString(exclude = {"password", "email"})
public class LoginRequest {

@NotBlank(message = "이메일은 필수입니다")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;

@Getter
@NoArgsConstructor
@ToString(exclude = {"password", "email"})
public class SignupRequest {

@NotBlank(message = "닉네임은 필수입니다")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class ChatController {
)
@PostMapping("/query")
public CommonResponse<ChatResponse> sendMessage(@RequestBody ChatRequest request) {
log.info("chat request: {}", request.getQuery());
log.info("챗봇 요청 처리 시작");

try {
ChatResponse response = chatService.processUserQuery(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;

@Schema(description = "채팅 요청 DTO")
@Getter
@Builder(toBuilder = true)
@NoArgsConstructor
@AllArgsConstructor
@ToString(exclude = {"query"})
public class ChatRequest {
@Schema(description = "사용자 질문", example = "k-pop 루트 추천해줘")
@NotBlank
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public void addDocumentFile(String id, File file, Map<String, Object> metadata)
* @return 유사도 순으로 정렬된 검색 결과 목록
*/
public List<DocumentSearchResult> similaritySearch(String query, int maxResults) {
log.debug("유사도 검색 시작 - 질의: '{}', 최대 결과: {}", query, maxResults);
log.debug("유사도 검색 시작 - 최대 결과: {}", maxResults);

try {
// 검색 요청 구성
Expand All @@ -139,7 +139,7 @@ public List<DocumentSearchResult> similaritySearch(String query, int maxResults)
.map(this::mapToSearchResult)
.collect(Collectors.toList());
} catch (Exception e) {
log.error("유사도 검색 실패 - 질의: '{}'", query, e);
log.error("유사도 검색 실패", e);
throw new SimilarityProcessingException();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void initializeVectorStore() {
* 상태 기반 대화 처리를 지원하며, 세션 연속성을 보장합니다.
*/
public ChatResponse processUserQuery(ChatRequest request) {
log.info("Processing user query: {} (language: {})", request.getQuery(), request.getLanguage());
log.info("사용자 쿼리 처리 시작 (언어: {})", request.getLanguage());

// 1. 언어 검증 및 설정
String validatedLanguage = languageService.validateAndGetLanguage(request.getLanguage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ private ChatContext mergeContexts(ChatContext existingContext, ChatContext extra
* AI 파싱 실패 시 fallback 로직
*/
private ChatContext extractContextFallback(String query, ChatContext existingContext) {
log.info("Using fallback context extraction for query: {}", query);
log.info("fallback context extraction 사용");

ChatContext.ChatContextBuilder builder = existingContext != null ?
existingContext.toBuilder() : ChatContext.builder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public List<RelatedResponseDto> fetchRelatedPlaces(double latitude, double longi
JsonNode items = om.readTree(body).at("/response/body/items/item");

if (items.isArray()) {
log.info("📍 locationBasedList2 {}건 lat={}, lon={}", items.size(), latitude, longitude);
log.info("📍 locationBasedList2 {}건 조회됨", items.size());

for (JsonNode it : items) {
String address = it.path("addr1").asText("");
Expand All @@ -115,12 +115,12 @@ public List<RelatedResponseDto> fetchRelatedPlaces(double latitude, double longi
));
}
} else {
log.warn("⚠️ locationBasedList2 결과 없음 lat={}, lon={}", latitude, longitude);
log.warn("⚠️ locationBasedList2 결과 없음");
}

return out;
} catch (Exception e) {
log.error("❌ locationBasedList2 호출 실패 lat={}, lon={}", latitude, longitude, e);
log.error("❌ locationBasedList2 호출 실패", e);
}
return List.of();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
import com.mey.backend.domain.user.entity.User;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.ToString;

@Getter
@AllArgsConstructor
@ToString(exclude = {"email"})
public class UserInfoResponse {
private Long id;
private String nickname;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;

@Getter
@NoArgsConstructor
@ToString(exclude = {"password", "email"})
@Schema(description = "사용자 정보 수정 요청")
public class UserInfoUpdateRequest {

Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/mey/backend/domain/user/entity/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
@Getter
@Setter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@ToString(exclude = {"password", "email"})
public class User implements UserDetails {

@Id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ public class UserDetailsServiceImpl implements UserDetailsService {
@Override
public UserDetails loadUserByUsername(String email) throws UsernameNotFoundException {
return userRepository.findByEmail(email)
.orElseThrow(() -> new UsernameNotFoundException("User not found: " + email));
.orElseThrow(() -> new UsernameNotFoundException("User not found"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public ResponseEntity<Object> handleGeneral(GeneralException generalException, H
public ResponseEntity<Object> handleOthers(Exception e, WebRequest request) {
CommonResponse<Object> body = CommonResponse.onFailure(ErrorStatus.INTERNAL_SERVER_ERROR.getCode(),
ErrorStatus.INTERNAL_SERVER_ERROR.getMessage(),
e.getMessage());
null);

return super.handleExceptionInternal(e, body, HttpHeaders.EMPTY,
ErrorStatus.INTERNAL_SERVER_ERROR.getHttpStatus(), request);
Expand Down
7 changes: 5 additions & 2 deletions src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ spring:

logging:
level:
com.mey.backend: DEBUG
org.springframework.web: DEBUG
com.mey.backend: INFO
org.springframework.web: WARN
org.springframework.security: WARN
org.hibernate.tool.schema.internal: warn
org.hibernate.sql: warn
org.springframework.web.servlet.DispatcherServlet: ERROR
org.springframework.security.web.FilterChainProxy: ERROR
10 changes: 8 additions & 2 deletions src/main/resources/application-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,11 @@ spring:

logging:
level:
com.mey.backend: INFO
org.springframework.web: WARN
com.mey.backend: WARN
org.springframework.web: ERROR
org.springframework.security: ERROR
org.hibernate.sql: ERROR
org.springframework.web.servlet.DispatcherServlet: ERROR
org.springframework.security.web.FilterChainProxy: ERROR
org.springframework.boot.autoconfigure: ERROR
root: WARN