统一前后端代码格式化配置

This commit is contained in:
yml2213
2026-08-16 17:27:12 +08:00
parent 8705f6a6a1
commit 5c7c3e14e3
278 changed files with 6386 additions and 5500 deletions
@@ -37,59 +37,79 @@ export async function sendInternalNotification(input: NotificationInput = {}) {
}
const results = [
...(await Promise.all(barkRecipients.map(async (recipient: JsonObject) => {
try {
const result = await sendBarkNotification({
recipient,
title,
body,
group: `订单系统/${category}`,
...(bark.serverUrl !== undefined ? { serverUrl: bark.serverUrl } : {}),
...(input.url !== undefined ? { url: input.url } : {}),
})
return mapNotificationResult('bark', recipient, recipient.deviceKey, true, '', result.status, result.response)
} catch (error) {
logWarn('[notification/bark]', 'Bark 内部通知发送失败', {
recipientId: recipient.id,
recipientName: recipient.name,
error,
})
return mapNotificationResult(
'bark',
recipient,
recipient.deviceKey,
false,
error instanceof Error ? error.message : 'Bark 内部通知发送失败',
isPlainObject(error) ? Number(error.statusCode || 0) || 0 : 0,
isPlainObject(error) ? error.context || null : null,
)
}
}))),
...(await Promise.all(wpushRecipients.map(async (recipient: JsonObject) => {
try {
const result = await sendWpushNotification({
recipient,
title,
body,
})
return mapNotificationResult('wpush', recipient, recipient.apiKey, true, '', result.status, result.response)
} catch (error) {
logWarn('[notification/wpush]', 'WPush 内部通知发送失败', {
recipientId: recipient.id,
recipientName: recipient.name,
error,
})
return mapNotificationResult(
'wpush',
recipient,
recipient.apiKey,
false,
error instanceof Error ? error.message : 'WPush 内部通知发送失败',
isPlainObject(error) ? Number(error.statusCode || 0) || 0 : 0,
isPlainObject(error) ? error.context || null : null,
)
}
}))),
...(await Promise.all(
barkRecipients.map(async (recipient: JsonObject) => {
try {
const result = await sendBarkNotification({
recipient,
title,
body,
group: `订单系统/${category}`,
...(bark.serverUrl !== undefined ? { serverUrl: bark.serverUrl } : {}),
...(input.url !== undefined ? { url: input.url } : {}),
})
return mapNotificationResult(
'bark',
recipient,
recipient.deviceKey,
true,
'',
result.status,
result.response,
)
} catch (error) {
logWarn('[notification/bark]', 'Bark 内部通知发送失败', {
recipientId: recipient.id,
recipientName: recipient.name,
error,
})
return mapNotificationResult(
'bark',
recipient,
recipient.deviceKey,
false,
error instanceof Error ? error.message : 'Bark 内部通知发送失败',
isPlainObject(error) ? Number(error.statusCode || 0) || 0 : 0,
isPlainObject(error) ? error.context || null : null,
)
}
}),
)),
...(await Promise.all(
wpushRecipients.map(async (recipient: JsonObject) => {
try {
const result = await sendWpushNotification({
recipient,
title,
body,
})
return mapNotificationResult(
'wpush',
recipient,
recipient.apiKey,
true,
'',
result.status,
result.response,
)
} catch (error) {
logWarn('[notification/wpush]', 'WPush 内部通知发送失败', {
recipientId: recipient.id,
recipientName: recipient.name,
error,
})
return mapNotificationResult(
'wpush',
recipient,
recipient.apiKey,
false,
error instanceof Error ? error.message : 'WPush 内部通知发送失败',
isPlainObject(error) ? Number(error.statusCode || 0) || 0 : 0,
isPlainObject(error) ? error.context || null : null,
)
}
}),
)),
]
return {