新单只路由 affiliate_dash(未命中走 manual_dispatch);历史飞飞/乐玩任务保留只读 stub,避免订单重同步失败。同步清理 cloudtentacles 调度、Admin 写路径与相关 env。 Co-authored-by: Cursor <cursoragent@cursor.com>
76 lines
1.6 KiB
TypeScript
76 lines
1.6 KiB
TypeScript
import { apiGet, apiPost } from '@/lib/http'
|
|
|
|
export type DevMockStatus = {
|
|
enabled: boolean
|
|
nodeEnv: string
|
|
defaultUid: string
|
|
platforms: Array<{
|
|
key: string
|
|
name: string
|
|
description: string
|
|
steps: string[]
|
|
}>
|
|
}
|
|
|
|
export type DevMockCreateResult = {
|
|
platform: 'affiliate_dash'
|
|
orderId: number
|
|
orderNo: string
|
|
taskId: number
|
|
taskNo: string
|
|
claimToken: string
|
|
claimUrl: string
|
|
frontendClaimUrl: string
|
|
expectedUid: string
|
|
step: string
|
|
productName: string
|
|
tips: string[]
|
|
open91QueryHint: string
|
|
}
|
|
|
|
export type DevMockOpen91QueryResult = {
|
|
endpoint: string
|
|
requestBody: Record<string, unknown>
|
|
curl: string
|
|
response: unknown
|
|
}
|
|
|
|
export type DevMockKuaishouIndustryVoucherResult = {
|
|
createdCount: number
|
|
sellerId: string
|
|
vouchers: Array<{
|
|
voucherCode: string
|
|
oid: string
|
|
status: string
|
|
}>
|
|
}
|
|
|
|
export function fetchDevMockStatus() {
|
|
return apiGet<DevMockStatus>('/api/v1/admin/dev-mock/status')
|
|
}
|
|
|
|
export function createAffiliateDashDevMock(payload: {
|
|
step?: string
|
|
uid?: string
|
|
orderNo?: string
|
|
productName?: string
|
|
productSku?: string
|
|
}) {
|
|
return apiPost<DevMockCreateResult>('/api/v1/admin/dev-mock/affiliate-dash', payload)
|
|
}
|
|
|
|
export function createKuaishouIndustryVoucherDevMock(payload: { sellerId?: string } = {}) {
|
|
return apiPost<DevMockKuaishouIndustryVoucherResult>(
|
|
'/api/v1/admin/dev-mock/kuaishou-industry/vouchers',
|
|
payload,
|
|
)
|
|
}
|
|
|
|
export function buildOpen91QueryDevMock(payload: {
|
|
orderNo: string
|
|
execute?: boolean
|
|
baseUrl?: string
|
|
}) {
|
|
return apiPost<DevMockOpen91QueryResult>('/api/v1/admin/dev-mock/open91/query', payload)
|
|
}
|