docs: 全文档合规检查与修正 - 代码示例规范/行数准确性/路径一致性/状态同步
This commit is contained in:
@@ -193,14 +193,20 @@ import "server-only"
|
||||
import type { NotificationChannelSender, ChannelRecipient } from "./types"
|
||||
import type { NotificationPayload, ChannelSendResult, NotificationChannel } from "../types"
|
||||
|
||||
const channel: NotificationChannel = "your_channel" as NotificationChannel
|
||||
// 注意:先在 types.ts 的 NotificationChannel 联合类型中添加 "your_channel"
|
||||
const channel: NotificationChannel = "your_channel"
|
||||
|
||||
class YourChannelSender implements NotificationChannelSender {
|
||||
readonly channel = channel
|
||||
async send(payload: NotificationPayload, recipient: ChannelRecipient): Promise<ChannelSendResult> {
|
||||
// 实现发送逻辑
|
||||
}
|
||||
async sendBatch(items) { /* ... */ }
|
||||
async sendBatch(
|
||||
items: Array<{ payload: NotificationPayload; recipient: ChannelRecipient }>
|
||||
): Promise<ChannelSendResult[]> {
|
||||
// 实现批量发送逻辑
|
||||
return []
|
||||
}
|
||||
}
|
||||
|
||||
export function createYourSender(): NotificationChannelSender {
|
||||
|
||||
Reference in New Issue
Block a user