feat: add lingxing connection test action

This commit is contained in:
2026-09-22 11:44:07 +08:00
parent 4391a69c7d
commit 33fc30911e
2 changed files with 58 additions and 3 deletions
@@ -40,6 +40,25 @@ export interface MojiaSkuSyncConfig {
autoSyncEnabled: boolean
}
export interface LingxingWarehouseTestResult {
whCode: string
reachable: boolean
matched: boolean
maintained: boolean
productSku?: string | null
barcode?: string | null
length?: number | null
width?: number | null
height?: number | null
weight?: number | null
message: string
}
export interface LingxingConnectionTestResult {
skuCode: string
warehouses: LingxingWarehouseTestResult[]
}
const basePath = '/platform/v1/firstleg/mojia-sku-sync'
export async function listMojiaSkuSync(query: MojiaSkuSyncQuery) {
@@ -56,6 +75,13 @@ export async function getMojiaSkuSyncConfig() {
return unwrapApiResponse(response)
}
export async function testLingxingConnection(skuCode: string) {
const response = await http.post<ApiEnvelope<LingxingConnectionTestResult>, ApiEnvelope<LingxingConnectionTestResult>>(
`${basePath}/test-connection`, { skuCode },
)
return unwrapApiResponse(response)
}
export async function updateMojiaSkuSync(id: string, data: {
skuCode: string
lengthCm: number