From b36a08adc7781ecd97b2059ccb33a3a53e5dcb4b Mon Sep 17 00:00:00 2001 From: chenhao Date: Wed, 22 Apr 2026 16:06:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E7=83=AD=E8=AF=8D?= =?UTF-8?q?=E7=BB=84=E7=AD=9B=E9=80=89=E5=8A=9F=E8=83=BD=E5=B9=B6=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E7=9B=B8=E5=85=B3API=E5=92=8C=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 `HotWords.tsx` 中添加热词组筛选选项,并更新 `useEffect` 依赖 - 更新 `hotword.ts` 和 `HotWordController.java` 以支持 `hotWordGroupId` 参数 - 在 `MeetingDetail.tsx` 中添加 `getPinyinSuggestion` API 调用,优化热词创建逻辑 --- .../controller/biz/HotWordController.java | 2 ++ frontend/src/api/business/hotword.ts | 1 + frontend/src/pages/business/HotWords.tsx | 14 +++++++++- frontend/src/pages/business/MeetingDetail.tsx | 27 ++++++++++++------- 4 files changed, 34 insertions(+), 10 deletions(-) diff --git a/backend/src/main/java/com/imeeting/controller/biz/HotWordController.java b/backend/src/main/java/com/imeeting/controller/biz/HotWordController.java index 06e605e..1ef643d 100644 --- a/backend/src/main/java/com/imeeting/controller/biz/HotWordController.java +++ b/backend/src/main/java/com/imeeting/controller/biz/HotWordController.java @@ -80,6 +80,7 @@ public class HotWordController { @RequestParam(defaultValue = "10") Integer size, @RequestParam(required = false) String word, @RequestParam(required = false) String category, + @RequestParam(required = false) Long hotWordGroupId, @RequestParam(required = false) Long tenantId) { LoginUser loginUser = (LoginUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); Long targetTenantId = Boolean.TRUE.equals(loginUser.getIsPlatformAdmin()) ? tenantId : null; @@ -87,6 +88,7 @@ public class HotWordController { LambdaQueryWrapper wrapper = new LambdaQueryWrapper() .like(word != null && !word.isEmpty(), HotWord::getWord, word) .eq(category != null && !category.isEmpty(), HotWord::getCategory, category) + .eq(hotWordGroupId != null, HotWord::getHotWordGroupId, hotWordGroupId) .orderByDesc(HotWord::getCreatedAt); wrapper.eq(targetTenantId != null, HotWord::getTenantId, targetTenantId); diff --git a/frontend/src/api/business/hotword.ts b/frontend/src/api/business/hotword.ts index 0350148..008c108 100644 --- a/frontend/src/api/business/hotword.ts +++ b/frontend/src/api/business/hotword.ts @@ -35,6 +35,7 @@ export const getHotWordPage = (params: { size: number; word?: string; category?: string; + hotWordGroupId?: number; tenantId?: number; }) => { return http.get<{ code: string; data: { records: HotWordVO[]; total: number }; msg: string }>( diff --git a/frontend/src/pages/business/HotWords.tsx b/frontend/src/pages/business/HotWords.tsx index 9382b17..9c278d0 100644 --- a/frontend/src/pages/business/HotWords.tsx +++ b/frontend/src/pages/business/HotWords.tsx @@ -83,6 +83,7 @@ const HotWords: React.FC = () => { const [size, setSize] = useState(10); const [searchWord, setSearchWord] = useState(""); const [searchCategory, setSearchCategory] = useState(undefined); + const [searchGroupId, setSearchGroupId] = useState(undefined); const [modalVisible, setModalVisible] = useState(false); const [editingId, setEditingId] = useState(null); @@ -103,7 +104,7 @@ const HotWords: React.FC = () => { useEffect(() => { void fetchData(); - }, [current, searchCategory, searchWord, size]); + }, [current, searchCategory, searchGroupId, searchWord, size]); useEffect(() => { void loadGroupOptions(); @@ -117,6 +118,7 @@ const HotWords: React.FC = () => { size, word: searchWord, category: searchCategory, + hotWordGroupId: searchGroupId, tenantId: isPlatformAdmin ? activeTenantId : undefined, }); if (res.data?.data) { @@ -396,6 +398,16 @@ const HotWords: React.FC = () => { ))} + } diff --git a/frontend/src/pages/business/MeetingDetail.tsx b/frontend/src/pages/business/MeetingDetail.tsx index 9d70e97..913c042 100644 --- a/frontend/src/pages/business/MeetingDetail.tsx +++ b/frontend/src/pages/business/MeetingDetail.tsx @@ -42,7 +42,7 @@ import { updateSpeakerInfo, } from '../../api/business/meeting'; import { getAiModelDefault, getAiModelPage, AiModelVO } from '../../api/business/aimodel'; -import { getHotWordPage, saveHotWord } from '../../api/business/hotword'; +import { getHotWordPage, getPinyinSuggestion, saveHotWord } from '../../api/business/hotword'; import { getPromptPage, PromptTemplateVO } from '../../api/business/prompt'; import { listUsers } from '../../api'; import { useDict } from '../../hooks/useDict'; @@ -977,15 +977,24 @@ const MeetingDetail: React.FC = () => { await Promise.all( toCreate.map((word) => - saveHotWord({ - word, - pinyinList: [], - matchStrategy: 1, - category: '', - weight: 2, - status: 1, + (async () => { + let pinyinList: string[] = []; + try { + const pinyinRes = await getPinyinSuggestion(word); + pinyinList = (pinyinRes.data?.data || []).map((item) => item.trim()).filter(Boolean); + } catch { + pinyinList = []; + } + return saveHotWord({ + word, + pinyinList, + matchStrategy: 1, + category: '', + weight: 2, + status: 1, remark: meeting ? `来源于会议:${meeting.title}` : '来源于会议关键词', - }), + }); + })(), ), );