Skip to content
Merged
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
10 changes: 5 additions & 5 deletions src/domain/match/match.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class MatchService {
results.map(async (item) => {
try {
const percent = item.similarity_score > 1 ? item.similarity_score : item.similarity_score * 100;
const status = percent >= 90 ? MatchingStatus.FOUND : MatchingStatus.NOT_FOUND;
const status = percent >= 85 ? MatchingStatus.FOUND : MatchingStatus.NOT_FOUND;

const feed = await this.feedRepository.findOne({ where: { id: item.feed_id }, relations: ['author'] });
if (!feed) throw new CommonException(ErrorCode.NOT_FOUND_FEED);
Expand All @@ -71,7 +71,7 @@ export class MatchService {
similarity: percent,
saved: true,
message:
percent >= 90
percent >= 85
? `잃어버린 동물을 제보해주셨어요! 유사도 ${Math.round(percent)}%!`
: undefined,
};
Expand All @@ -81,7 +81,7 @@ export class MatchService {
})
);

// 90% 이상만 응답
// 85% 이상만 응답
return allResults.filter(
(item): item is {
feed_id: number;
Expand All @@ -90,7 +90,7 @@ export class MatchService {
similarity: number;
saved: boolean;
message: string;
} => !!item && item.saved && typeof item.similarity === 'number' && item.similarity >= 90
} => !!item && item.saved && typeof item.similarity === 'number' && item.similarity >= 85
);
}

Expand All @@ -116,7 +116,7 @@ export class MatchService {
const matchingResults = await this.matchingResultRepository.find({
where: {
feed: { id: In(feedIds) },
similarity: MoreThanOrEqual(90),
similarity: MoreThanOrEqual(85),
},
relations: ['user', 'feed'],
});
Expand Down
Loading