refactor: optimize notification and subscription query using index (#5414)

### What type of PR is this?
/kind improvement
/area core
/milestone 2.13.x

### What this PR does / why we need it:
使用索引机制优化通知和订阅查询以提高性能

how to test it
测试通知列表不报错即可

### Does this PR introduce a user-facing change?

```release-note
使用索引机制优化通知和订阅查询以提高性能
```
This commit is contained in:
guqing
2024-02-27 19:53:13 +08:00
committed by GitHub
parent d2f569699b
commit 11114416fa
17 changed files with 242 additions and 300 deletions

View File

@@ -31,7 +31,7 @@ const {
queryFn: async () => {
const { data } = await apiClient.notification.listUserNotifications({
username: currentUser?.metadata.name as string,
unRead: activeTab.value === "unread",
fieldSelector: [`spec.unread=${activeTab.value === "unread"}`],
});
return data;