开始多平台 多店铺整改

This commit is contained in:
yml
2026-04-08 22:21:11 +08:00
parent d5b10e3f7f
commit a2b09c89e8
40 changed files with 1750 additions and 685 deletions
@@ -3,7 +3,10 @@ import { getDb } from '../db/client.js'
export function createWebhookEvent(input) {
const result = getDb().prepare(`
INSERT INTO webhook_events (
provider,
platform,
shop_id,
shop_name,
event_type,
event_key,
signature_valid,
@@ -14,9 +17,12 @@ export function createWebhookEvent(input) {
process_error,
related_order_id,
created_at
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
`).run(
input.provider,
input.platform,
input.shopId,
input.shopName,
input.eventType,
input.eventKey,
input.signatureValid ? 1 : 0,
@@ -60,6 +66,7 @@ export function getWebhookEventById(eventId) {
export function listWebhookEvents({
page = 1,
pageSize = 20,
provider = '',
platform = '',
processed = '',
relatedOrderId = '',
@@ -70,6 +77,11 @@ export function listWebhookEvents({
const filters = []
const params = []
if (provider) {
filters.push('provider = ?')
params.push(provider)
}
if (platform) {
filters.push('platform = ?')
params.push(platform)