Skip to content

Commit 4cd1933

Browse files
authored
feat(be): AI챗 레포지토리 구현 (#8)
* feat(be): AI챗 레포지토리 구현 * fix: YAML 문법 오류 수정 - 멀티라인 문자열 들여쓰기
1 parent 249bba9 commit 4cd1933

File tree

4 files changed

+32
-13
lines changed

4 files changed

+32
-13
lines changed

.github/workflows/ai-pr-review.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,16 @@ jobs:
4747
role: 'system',
4848
content: `코드 리뷰어입니다. 다음 규칙을 검토하세요:
4949
50-
## 필수 검토 항목
51-
1. **글로벌 익셉션 처리**: @ControllerAdvice 사용, 표준 에러 응답
52-
2. **ApiResponse 사용**: 모든 API는 ApiResponse<T>로 감싸서 응답
53-
3. **Kotlin 최적화**: data class, null safety, when 표현식, 확장함수 등
54-
4. **ktlint 규칙**: 포맷팅, 네이밍 컨벤션
50+
## 필수 검토 항목
51+
1. **글로벌 익셉션 처리**: @ControllerAdvice 사용, 표준 에러 응답
52+
2. **ApiResponse 사용**: 모든 API는 ApiResponse<T>로 감싸서 응답
53+
3. **Kotlin 최적화**: data class, null safety, when 표현식, 확장함수 등
54+
4. **ktlint 규칙**: 포맷팅, 네이밍 컨벤션
5555
56-
## 응답 형식
57-
🟢 **좋은점**: [규칙을 잘 지킨 부분]
58-
🟡 **개선사항**: [더 좋게 할 수 있는 부분]
59-
🔴 **문제점**: [반드시 수정해야 할 부분]`
56+
## 응답 형식
57+
🟢 **좋은점**: [규칙을 잘 지킨 부분]
58+
🟡 **개선사항**: [더 좋게 할 수 있는 부분]
59+
🔴 **문제점**: [반드시 수정해야 할 부분]`
6060
}, {
6161
role: 'user',
6262
content: `파일: ${file.filename}\n\n변경사항:\n${file.patch}`
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package com.back.koreaTravelGuide.domain.ai.aiChat.repository
2+
3+
import com.back.koreaTravelGuide.domain.ai.aiChat.entity.AiChatMessage
4+
import org.springframework.data.jpa.repository.JpaRepository
5+
6+
interface AiChatMessageRepository : JpaRepository<AiChatMessage, Long> {
7+
fun findByAiChatSessionIdOrderByCreatedAtAsc(sessionId: Long): List<AiChatMessage>
8+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.back.koreaTravelGuide.domain.ai.aiChat.repository
2+
3+
import com.back.koreaTravelGuide.domain.ai.aiChat.entity.AiChatSession
4+
import org.springframework.data.jpa.repository.JpaRepository
5+
6+
interface AiChatSessionRepository : JpaRepository<AiChatSession, Long> {
7+
// 사용자별 세션 조회 (최신순)
8+
fun findByUserIdOrderByCreatedAtDesc(userId: Long): List<AiChatSession>
9+
10+
// 세션 아이디와 사용자 아이디로 세션 조회 (삭제 권한 체크)
11+
fun findByIdAndUserId(
12+
sessionId: Long,
13+
userId: Long,
14+
): AiChatSession?
15+
}

src/main/kotlin/com/back/koreaTravelGuide/domain/ai/aiChat/repository/ChatRepository.kt

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)