Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
2dc02ac
Fix: Remove CORS Error
DongilMin Jul 29, 2025
f973a38
Merge branch 'ON-AIR-mate:main' into main
DongilMin Jul 30, 2025
9ec0e84
Merge branch 'ON-AIR-mate:main' into main
DongilMin Jul 31, 2025
cd56562
Merge branch 'ON-AIR-mate:main' into main
DongilMin Jul 31, 2025
3281ab3
Merge branch 'ON-AIR-mate:main' into main
DongilMin Aug 1, 2025
7c9b937
Merge branch 'ON-AIR-mate:main' into main
DongilMin Aug 1, 2025
2e3d05f
Merge branch 'ON-AIR-mate:main' into main
DongilMin Aug 2, 2025
2aea0ec
Merge branch 'ON-AIR-mate:main' into main
DongilMin Aug 3, 2025
38f1772
Merge branch 'ON-AIR-mate:main' into main
DongilMin Aug 6, 2025
4935061
Fix: CORS ์„ค์ • ์ˆ˜์ •
DongilMin Aug 6, 2025
f08807f
Merge branch 'ON-AIR-mate:main' into main
DongilMin Aug 6, 2025
63b6ca0
fix: ๊ฒฝ๋กœ ์ˆ˜์ •
DongilMin Aug 6, 2025
82c1705
Merge branch 'ON-AIR-mate:main' into main
DongilMin Aug 7, 2025
1765f83
Merge branch 'ON-AIR-mate:main' into main
DongilMin Aug 7, 2025
8f39666
Merge branch 'ON-AIR-mate:main' into main
DongilMin Aug 7, 2025
138f543
Fix: Remove Auto Migration
DongilMin Aug 7, 2025
d9c6f4a
Merge branch 'main' of https://github.com/DongilMin/on-air-mate-backeโ€ฆ
DongilMin Aug 7, 2025
5ae7600
Merge branch 'ON-AIR-mate:main' into main
DongilMin Aug 9, 2025
3c522e4
Refacot: Ai-prompt
DongilMin Aug 9, 2025
605a787
Refact: AI PROMPT ์ˆ˜์ •
DongilMin Aug 9, 2025
da96021
Refact: ํ”„๋กฌํ”„ํŠธ ์ˆ˜์ •
DongilMin Aug 9, 2025
cee6f64
Merge branch 'main' into main
DongilMin Aug 9, 2025
c2c34b8
Refact: Prompt-ai
DongilMin Aug 9, 2025
b8f57b0
Merge branch 'main' of https://github.com/DongilMin/on-air-mate-backeโ€ฆ
DongilMin Aug 9, 2025
708db47
Fix: Add Friend route
DongilMin Aug 9, 2025
3bee22e
Prisma ํŒŒ์ผ ์„œ๋ฒ„ DB์™€ ๋™๊ธฐํ™”
DongilMin Aug 9, 2025
06b3554
Merge branch 'ON-AIR-mate:main' into main
DongilMin Aug 9, 2025
047a26a
Feat: Add Redirection HTTP to HTTPS Nginx System
DongilMin Aug 9, 2025
c455ba4
chore: Revert schema.prisma to upstream version
DongilMin Aug 9, 2025
cb992de
fix: Add HTTPS redirect middleware for production
DongilMin Aug 9, 2025
3880179
Merge branch 'main' into main
DongilMin Aug 9, 2025
89ac146
Formatting
DongilMin Aug 9, 2025
0ed1a91
Merge branch 'main' of https://github.com/DongilMin/on-air-mate-backeโ€ฆ
DongilMin Aug 9, 2025
b352403
DOCS: ์„œ๋ฒ„ URL ์„ค์ •
DongilMin Aug 9, 2025
6236c01
Merge branch 'ON-AIR-mate:main' into main
DongilMin Aug 10, 2025
54b16b6
Merge branch 'ON-AIR-mate:main' into main
DongilMin Aug 11, 2025
4be270b
Fix: swagger route
DongilMin Aug 11, 2025
54de74e
Fix: Prisma ํƒ€์ž… ๋ถˆ์ผ์น˜ ์ˆ˜์ •
DongilMin Aug 11, 2025
ee2d979
Merge branch 'main' into main
DongilMin Aug 11, 2025
674f043
Refact: ReceiverId๋ฅผ ๊ฐ์ฒด ํƒ€์ž…์œผ๋กœ ์ˆ˜์ •
DongilMin Aug 11, 2025
adac8f3
Refact: Formatting
DongilMin Aug 11, 2025
a6962a6
Merge branch 'main' of https://github.com/DongilMin/on-air-mate-backeโ€ฆ
DongilMin Aug 11, 2025
8e50435
refact: ์†Œ์ผ“์ด ๋ฎ์–ด์“ฐ๊ธฐ ํ—ˆ์šฉ
DongilMin Aug 11, 2025
b95d4e9
Merge branch 'ON-AIR-mate:main' into main
DongilMin Aug 13, 2025
d2082a3
Merge branch 'ON-AIR-mate:main' into main
DongilMin Aug 14, 2025
b077a6c
refact: Remove Token in upload image
DongilMin Aug 14, 2025
1dea919
fix: ai summary && friend request
DongilMin Aug 14, 2025
e390e87
feat: ์นœ๊ตฌ ์š”์ฒญ ๋กœ์ง ๊ฐœ์„  ๋ฐ AI ์š”์•ฝ ๊ธฐ๋Šฅ ์•ˆ์ •ํ™”
DongilMin Aug 16, 2025
360e121
feat: ai, friend ์ˆ˜์ •
DongilMin Aug 16, 2025
8ff63a3
Formatting
DongilMin Aug 16, 2025
25c182f
Merge branch 'main' into main
DongilMin Aug 16, 2025
3cb819c
Merge branch 'ON-AIR-mate:main' into main
DongilMin Aug 18, 2025
5bbc89f
Refact str to list
DongilMin Aug 18, 2025
c73faae
Merge branch 'ON-AIR-mate:main' into main
DongilMin Aug 20, 2025
3348461
Feat: Add Bookmark highlights in ai summary
DongilMin Aug 20, 2025
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
13 changes: 12 additions & 1 deletion src/dtos/aiSummaryDto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ export interface EmotionItem {
percentage: number; // ํผ์„ผํŠธ ๊ฐ’ (0-100)
}

/**
* ํ•˜์ด๋ผ์ดํŠธ(๋ถ๋งˆํฌ) ํ•ญ๋ชฉ
*/
export interface HighlightItem {
timeline: string; // "13:28" ํ˜•์‹
content: string; // ๋ถ๋งˆํฌ ๋ฉ”์‹œ์ง€
userId: number;
nickname: string;
}

/**
* AI ์ฑ„ํŒ… ์š”์•ฝ ์‘๋‹ต DTO
*/
Expand All @@ -21,7 +31,8 @@ export interface GenerateSummaryResponseDto {
roomTitle: string;
videoTitle: string;
topicSummary: string;
emotionAnalysis: EmotionItem[]; // string์—์„œ ๋ฐฐ์—ด๋กœ ๋ณ€๊ฒฝ
emotionAnalysis: EmotionItem[];
highlights: HighlightItem[];
timestamp: string;
}

Expand Down
42 changes: 41 additions & 1 deletion src/routes/aiSummaryRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,19 @@ const router = express.Router();
* example: ์˜์ƒ์ œ๋ชฉ
* topicSummary:
* type: string
* example: ์ „์ฒด ๋Œ€ํ™” ์ฃผ์ œ ์š”์•ฝ
* example: ์˜์ƒ์„ ๋ณด๋ฉฐ ์ฆ๊ฑฐ์šด ์‹œ๊ฐ„์„ ๋ณด๋ƒˆ๋„ค์š”!
* emotionAnalysis:
* type: array
* description: ๊ฐ์ •๋ณ„ ๋ถ„์„ ๊ฒฐ๊ณผ
* items:
* type: object
* properties:
* emotion:
* type: string
* example: ๊ธฐ์จ
* percentage:
* type: number
* example: 40
* example:
* - emotion: "๊ธฐ์จ"
* percentage: 40
Expand All @@ -63,6 +72,37 @@ const router = express.Router();
* percentage: 20
* - emotion: "์Šฌํ””"
* percentage: 10
* highlights:
* type: array
* description: ๋ถ๋งˆํฌ ํ•˜์ด๋ผ์ดํŠธ ๋ฆฌ์ŠคํŠธ
* items:
* type: object
* properties:
* timeline:
* type: string
* example: "13:28"
* content:
* type: string
* example: "์žฌ๋ฐŒ๋Š” ์žฅ๋ฉด"
* userId:
* type: number
* example: 123
* nickname:
* type: string
* example: "์‚ฌ์šฉ์ž๋‹‰๋„ค์ž„"
* example:
* - timeline: "13:28"
* content: "์žฌ๋ฐŒ๋Š” ์žฅ๋ฉด"
* userId: 123
* nickname: "ํ™๊ธธ๋™"
* - timeline: "27:18"
* content: "๊ฐ๋™์ ์ธ ๋ถ€๋ถ„"
* userId: 456
* nickname: "๊น€์ฒ ์ˆ˜"
* - timeline: "1:02:35"
* content: "๊ฒฐ์ •์  ์ˆœ๊ฐ„"
* userId: 789
* nickname: "์ด์˜ํฌ"
* timestamp:
* type: string
* format: date-time
Expand Down
43 changes: 41 additions & 2 deletions src/services/aiSummaryService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
ClaudeResponseDto,
AISummaryFeedbackData,
EmotionItem,
HighlightItem,
} from '../dtos/aiSummaryDto.js';

const BEDROCK_MODEL_ID = 'anthropic.claude-3-5-sonnet-20240620-v1:0';
Expand Down Expand Up @@ -105,10 +106,47 @@ export class AiSummaryService {
.join('\n')
.slice(0, MAX_CONTENT_LENGTH);

// 6. Claude 3.5 Sonnet ๋ชจ๋ธ ํ˜ธ์ถœ
// 6. ๋ถ๋งˆํฌ ์กฐํšŒ ์ถ”๊ฐ€
const bookmarks = await prisma.bookmark.findMany({
where: { roomId: data.roomId },
include: {
user: {
select: {
userId: true,
nickname: true,
},
},
},
orderBy: { timeline: 'asc' }, // ์‹œ๊ฐ„์ˆœ ์ •๋ ฌ
});

// ๋ถ๋งˆํฌ๋ฅผ ํ•˜์ด๋ผ์ดํŠธ ํ˜•์‹œใ„ฑ
const highlights: HighlightItem[] = bookmarks.map(bookmark => {
const totalSeconds = bookmark.timeline || 0;
const hours = Math.floor(totalSeconds / 3600);
const minutes = Math.floor((totalSeconds % 3600) / 60);
const seconds = totalSeconds % 60;

// HH:MM:SS ๋˜๋Š” MM:SS ํ˜•์‹์œผ๋กœ ๋ณ€ํ™˜
let timeline = '';
if (hours > 0) {
timeline = `${String(hours).padStart(2, '0')}:${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}`;
} else {
timeline = `${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}`;
}

return {
timeline,
content: bookmark.content || '',
userId: bookmark.user.userId,
nickname: bookmark.user.nickname,
};
});

// 7. Claude 3.5 Sonnet ๋ชจ๋ธ ํ˜ธ์ถœ (๊ธฐ์กด ์ฝ”๋“œ์™€ ๋™์ผ)
const summary = await this.callClaudeModel(chatContent, video.title);

// 7. ์ž„์‹œ summaryId ์ƒ์„ฑ
// 8. ์ž„์‹œ summaryId ์ƒ์„ฑ
const summaryId = `summary_${data.roomId}_${randomUUID()}`;

return {
Expand All @@ -117,6 +155,7 @@ export class AiSummaryService {
videoTitle: video.title,
topicSummary: summary.topicSummary,
emotionAnalysis: summary.emotionAnalysis,
highlights, // ๋ถ๋งˆํฌ ๋ฆฌ์ŠคํŠธ
timestamp: new Date().toISOString(),
};
}
Expand Down
Loading