mirror of
https://github.com/yyhuni/xingrin.git
synced 2026-01-31 11:46:16 +08:00
- Add wecom notification channel configuration to mock notification settings - Initialize wecom with disabled state and empty webhook URL by default - Update notification settings response to include wecom configuration - Enable WeChat Work as an alternative notification channel alongside Discord
41 lines
1.0 KiB
TypeScript
41 lines
1.0 KiB
TypeScript
import type {
|
|
NotificationSettings,
|
|
GetNotificationSettingsResponse,
|
|
UpdateNotificationSettingsResponse,
|
|
} from '@/types/notification-settings.types'
|
|
|
|
export const mockNotificationSettings: NotificationSettings = {
|
|
discord: {
|
|
enabled: true,
|
|
webhookUrl: 'https://discord.com/api/webhooks/1234567890/abcdefghijklmnop',
|
|
},
|
|
wecom: {
|
|
enabled: false,
|
|
webhookUrl: '',
|
|
},
|
|
categories: {
|
|
scan: true,
|
|
vulnerability: true,
|
|
asset: true,
|
|
system: false,
|
|
},
|
|
}
|
|
|
|
export function getMockNotificationSettings(): GetNotificationSettingsResponse {
|
|
return mockNotificationSettings
|
|
}
|
|
|
|
export function updateMockNotificationSettings(
|
|
settings: NotificationSettings
|
|
): UpdateNotificationSettingsResponse {
|
|
// 模拟更新设置
|
|
Object.assign(mockNotificationSettings, settings)
|
|
|
|
return {
|
|
message: 'Notification settings updated successfully',
|
|
discord: mockNotificationSettings.discord,
|
|
wecom: mockNotificationSettings.wecom,
|
|
categories: mockNotificationSettings.categories,
|
|
}
|
|
}
|