message push config

This commit is contained in:
yoan
2024-09-23 23:13:34 +08:00
parent 5422f17fab
commit 4c9095400e
13 changed files with 727 additions and 60 deletions

View File

@@ -1,9 +1,50 @@
export type Setting = {
id?: string;
name?: string;
content: EmailsSetting;
content?: EmailsSetting | NotifyTemplates | NotifyChannels;
};
type EmailsSetting = {
export type EmailsSetting = {
emails: string[];
};
export type NotifyTemplates = {
notifyTemplates: NotifyTemplate[];
};
export type NotifyTemplate = {
title: string;
content: string;
};
export type NotifyChannels = {
dingtalk?: NotifyChannel;
telegram?: NotifyChannel;
webhook?: NotifyChannel;
};
export type NotifyChannel =
| NotifyChannelDingTalk
| NotifyChannelTelegram
| NotifyChannelWebhook;
export type NotifyChannelDingTalk = {
accessToken: string;
secret: string;
enabled: boolean;
};
export type NotifyChannelTelegram = {
apiToken: string;
enabled: boolean;
};
export type NotifyChannelWebhook = {
url: string;
enabled: boolean;
};
export const defaultNotifyTemplate: NotifyTemplate = {
title: "您有{COUNT}张证书即将过期",
content: "有{COUNT}张证书即将过期,域名分别为{DOMAINS},请保持关注!",
};