合并 dev_11.9_2 到 dev_11.13
This commit is contained in:
@@ -362,6 +362,9 @@ export function saveAdminManualConfig(payload: {
|
||||
canonicalProductId?: number | null
|
||||
enabled?: boolean
|
||||
note?: string
|
||||
semiAutoEnabled?: boolean
|
||||
semiAutoPlatform?: '' | 'huya' | 'weibo'
|
||||
semiAutoConfig?: Record<string, unknown>
|
||||
}) {
|
||||
return apiPost<ManualFulfillmentConfig>('/api/v1/admin/cost-center/manual-configs', payload)
|
||||
}
|
||||
|
||||
@@ -10,6 +10,12 @@ export type DevMockStatus = {
|
||||
description: string
|
||||
steps: string[]
|
||||
}>
|
||||
semiAuto?: {
|
||||
defaultConnectorMode: 'embedded' | 'external' | 'mock'
|
||||
externalConnectorConfigured: boolean
|
||||
mockConnectorAvailable: boolean
|
||||
platform: string
|
||||
}
|
||||
}
|
||||
|
||||
export type DevMockCreateResult = {
|
||||
@@ -45,6 +51,23 @@ export type DevMockKuaishouIndustryVoucherResult = {
|
||||
}>
|
||||
}
|
||||
|
||||
export type DevMockSemiAutoResult = {
|
||||
platform: 'semi_auto'
|
||||
semiAutoPlatform: 'huya' | 'weibo'
|
||||
orderId: number
|
||||
orderNo: string
|
||||
orderItemId: number
|
||||
fulfillmentId: number
|
||||
configId: number
|
||||
taskId: number
|
||||
skuKey: string
|
||||
connectorMode: 'embedded' | 'external' | 'mock'
|
||||
connectorConfigured: boolean
|
||||
customerPath: string
|
||||
adminPath: string
|
||||
tips: string[]
|
||||
}
|
||||
|
||||
export function fetchDevMockStatus() {
|
||||
return apiGet<DevMockStatus>('/api/v1/admin/dev-mock/status')
|
||||
}
|
||||
@@ -66,6 +89,19 @@ export function createKuaishouIndustryVoucherDevMock(payload: { sellerId?: strin
|
||||
)
|
||||
}
|
||||
|
||||
export function createSemiAutoDevMock(payload: {
|
||||
platform?: 'huya' | 'weibo'
|
||||
orderNo?: string
|
||||
skuName?: string
|
||||
quantity?: number
|
||||
pageTitle?: string
|
||||
pageDescription?: string
|
||||
browserTargetUrl?: string
|
||||
connectorMode?: 'embedded' | 'external' | 'mock'
|
||||
}) {
|
||||
return apiPost<DevMockSemiAutoResult>('/api/v1/admin/dev-mock/semi-auto', payload)
|
||||
}
|
||||
|
||||
export function buildOpen91QueryDevMock(payload: {
|
||||
orderNo: string
|
||||
execute?: boolean
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
import { apiGet, apiPost } from '@/lib/http'
|
||||
import type {
|
||||
SemiAutoCredentialExport,
|
||||
SemiAutoTaskDetail,
|
||||
SemiAutoTaskListResult,
|
||||
} from '@/types/admin/semi-auto'
|
||||
|
||||
export function fetchAdminSemiAutoTasks(params: Record<string, unknown> = {}) {
|
||||
return apiGet<SemiAutoTaskListResult>('/api/v1/admin/semi-auto/tasks', params)
|
||||
}
|
||||
|
||||
export function fetchAdminSemiAutoTask(taskId: number) {
|
||||
return apiGet<SemiAutoTaskDetail>(`/api/v1/admin/semi-auto/tasks/${taskId}`)
|
||||
}
|
||||
|
||||
export function exportAdminSemiAutoCredential(taskId: number) {
|
||||
return apiPost<SemiAutoCredentialExport>(
|
||||
`/api/v1/admin/semi-auto/tasks/${taskId}/credential/export`,
|
||||
{},
|
||||
)
|
||||
}
|
||||
|
||||
export function claimAdminSemiAutoTask(taskId: number) {
|
||||
return apiPost<SemiAutoTaskDetail>(`/api/v1/admin/semi-auto/tasks/${taskId}/claim`, {})
|
||||
}
|
||||
|
||||
export function syncAdminSemiAutoTask(taskId: number) {
|
||||
return apiPost<SemiAutoTaskDetail>(`/api/v1/admin/semi-auto/tasks/${taskId}/sync`, {})
|
||||
}
|
||||
|
||||
export function createAdminSemiAutoBrowserSession(taskId: number, targetUrl?: string) {
|
||||
return apiPost<{ ticket: string; expiresAt: string; targetUrl: string }>(
|
||||
`/api/v1/admin/semi-auto/tasks/${taskId}/browser-session`,
|
||||
{ targetUrl: targetUrl || '' },
|
||||
)
|
||||
}
|
||||
|
||||
export function completeAdminSemiAutoTask(
|
||||
taskId: number,
|
||||
payload: {
|
||||
note?: string
|
||||
externalOrderNo?: string
|
||||
costFen?: number
|
||||
screenshots?: Array<Record<string, unknown>>
|
||||
},
|
||||
) {
|
||||
return apiPost<SemiAutoTaskDetail>(`/api/v1/admin/semi-auto/tasks/${taskId}/complete`, payload)
|
||||
}
|
||||
|
||||
export function cancelAdminSemiAutoTask(taskId: number, reason: string) {
|
||||
return apiPost<SemiAutoTaskDetail>(`/api/v1/admin/semi-auto/tasks/${taskId}/cancel`, { reason })
|
||||
}
|
||||
Reference in New Issue
Block a user