feat: add kuaidi100 logistics sync
This commit is contained in:
@@ -253,6 +253,9 @@ export interface AdminOrderDetail {
|
||||
tracking_no: string;
|
||||
tracking_status: string;
|
||||
tracking_status_text: string;
|
||||
provider_status_text: string;
|
||||
sync_status_text: string;
|
||||
sync_error: string;
|
||||
latest_desc: string;
|
||||
latest_time: string;
|
||||
nodes: Array<{
|
||||
@@ -266,6 +269,9 @@ export interface AdminOrderDetail {
|
||||
tracking_no: string;
|
||||
tracking_status: string;
|
||||
tracking_status_text: string;
|
||||
provider_status_text: string;
|
||||
sync_status_text: string;
|
||||
sync_error: string;
|
||||
latest_desc: string;
|
||||
latest_time: string;
|
||||
nodes: Array<{
|
||||
@@ -1183,6 +1189,37 @@ export interface AdminExpressCompanyItem {
|
||||
updated_at: string;
|
||||
}
|
||||
|
||||
export interface AdminExpressCompanyCatalogItem {
|
||||
id: number;
|
||||
company_name: string;
|
||||
company_code: string;
|
||||
company_type: string;
|
||||
display_text: string;
|
||||
source: string;
|
||||
synced_at: string;
|
||||
}
|
||||
|
||||
export interface AdminExpressCompanyRecognitionCandidate {
|
||||
company_name: string;
|
||||
company_code: string;
|
||||
official_name?: string;
|
||||
display_text: string;
|
||||
length_pre?: number;
|
||||
source: string;
|
||||
}
|
||||
|
||||
export interface AdminExpressCompanyRecognitionResult {
|
||||
input: string;
|
||||
tracking_no: string;
|
||||
company_code: string;
|
||||
company_name: string;
|
||||
status: string;
|
||||
status_text: string;
|
||||
error_message?: string;
|
||||
resolved: null | AdminExpressCompanyRecognitionCandidate;
|
||||
candidates: AdminExpressCompanyRecognitionCandidate[];
|
||||
}
|
||||
|
||||
export interface AdminExpressCompanyPayload {
|
||||
id?: number;
|
||||
company_name: string;
|
||||
@@ -2288,6 +2325,37 @@ export const adminApi = {
|
||||
};
|
||||
}>;
|
||||
},
|
||||
getExpressCompanyCatalog(params?: { keyword?: string; limit?: number }) {
|
||||
return request.get("/api/admin/express-company/catalog", { params }) as Promise<{
|
||||
code: number;
|
||||
message: string;
|
||||
data: {
|
||||
list: AdminExpressCompanyCatalogItem[];
|
||||
total: number;
|
||||
synced_at: string;
|
||||
};
|
||||
}>;
|
||||
},
|
||||
syncExpressCompanyCatalog() {
|
||||
return request.post("/api/admin/express-company/catalog/sync") as Promise<{
|
||||
code: number;
|
||||
message: string;
|
||||
data: {
|
||||
total: number;
|
||||
inserted: number;
|
||||
updated: number;
|
||||
backfilled: number;
|
||||
synced_at: string;
|
||||
};
|
||||
}>;
|
||||
},
|
||||
recognizeExpressCompany(data: { tracking_no: string; company_name?: string; company_code?: string }) {
|
||||
return request.post("/api/admin/express-company/recognize", data) as Promise<{
|
||||
code: number;
|
||||
message: string;
|
||||
data: AdminExpressCompanyRecognitionResult;
|
||||
}>;
|
||||
},
|
||||
saveExpressCompany(data: AdminExpressCompanyPayload) {
|
||||
return request.post("/api/admin/express-company/save", data) as Promise<{
|
||||
code: number;
|
||||
|
||||
Reference in New Issue
Block a user