This commit is contained in:
2026-08-03 14:58:17 +08:00
parent bc44a7942d
commit ee997ae894
17 changed files with 1694 additions and 303 deletions
+29
View File
@@ -34,6 +34,20 @@ export interface SavePlatformExpressCompanyRequest {
remark: string | null
}
export interface PlatformExpressCompanyImportError {
row: number
field: string
message: string
}
export interface PlatformExpressCompanyImportResult {
fileName: string
totalRows: number
importedRows: number
success: boolean
errors: PlatformExpressCompanyImportError[]
}
const basePath = '/platform/v1/express-companies'
export async function listPlatformExpressCompanies(
@@ -98,3 +112,18 @@ export async function changePlatformExpressCompanyStatus(
})
return unwrapApiResponse(response)
}
export async function downloadPlatformExpressCompanyImportTemplate() {
return http.get<Blob, Blob>(`${basePath}/import-template`, { responseType: 'blob' })
}
export async function importPlatformExpressCompanies(tenantId: number, file: File) {
const formData = new FormData()
formData.append('file', file)
const response = await http.post<ApiEnvelope<PlatformExpressCompanyImportResult>, ApiEnvelope<PlatformExpressCompanyImportResult>>(
`${basePath}/import`,
formData,
{ params: { tenantId } },
)
return unwrapApiResponse(response)
}