operation.ts
2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import { ApiClient } from '../core/client';
export interface Page<T> {
records: T[];
total: number;
}
export interface Contract {
id: string;
contractNo?: string;
evalOrderNo?: string;
licensePlate?: string;
vin?: string;
carBrand?: string;
carSeriesName?: string;
carTypeName?: string;
electronicContractStatus?: number;
contractProcessNode?: string;
vehicleImgUrl?: string;
[key: string]: unknown;
}
export interface Sunshine {
id: string;
sellerMerchantName?: string;
sellerMerchantId?: string;
carType?: string;
sunlightInspiresPrice?: number;
createdDate?: string;
[key: string]: unknown;
}
class OperationApi extends ApiClient {
contracts(data: Record<string, unknown>) {
return this.post<Page<Contract>>('/evalElectronicContract/page', data);
}
contract(id: string) {
return this.post<Contract>('/evalElectronicContract/detail', { id });
}
contractFile(id: string) {
return this.post<{ url?: string }>('/evalElectronicContract/getContractFileUrl', { id });
}
importContract(fileUrl: string) {
return this.post<unknown>('/evalElectronicContract/importContract', { fileUrl });
}
sunshine(data: Record<string, unknown>) {
return this.post<Page<Sunshine>>('/sunlightInspiresConfig/page', data);
}
sunshineDetail(id: string) {
return this.post<Sunshine>('/sunlightInspiresConfig/details', { id });
}
sunshineLog(id: string) {
return this.post<Array<Record<string, unknown>>>('/sunlightInspiresConfig/log/page', { id });
}
createSunshine(data: Record<string, unknown>) {
return this.post<unknown>('/sunlightInspiresConfig/create', data);
}
updateSunshine(data: Record<string, unknown>) {
return this.post<unknown>('/sunlightInspiresConfig/edit', data);
}
deleteSunshine(id: string) {
return this.post<unknown>('/sunlightInspiresConfig/delete', { id });
}
exportSunshine(data: Record<string, unknown>) {
return this.post<unknown>('/sunlightInspiresConfig/export', data);
}
}
export const operationApi = new OperationApi();