StorageController.ts
1.55 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
import {AxiosResponse, AxiosStatic} from 'axios';
import dayjs, {Dayjs} from 'dayjs';
import {Vehicle} from "lib/src/entity/vehicle/entity/Vehicle";
import {FileInfo} from "lib/src/core/bean/FileInfo";
// region 前端扩展导入包
// endregion
/**
* @author kepler
*/
export class StorageController {
/**
*/
static removeVehicleAlbum(axios: AxiosStatic, filePath: string, vehicleId: number): Promise<AxiosResponse<void>> {
return axios.delete('upload/removeVehicleAlbum', {params: {filePath: filePath, vehicleId: vehicleId}});
}
/**
* 更新车辆图片
* @param vehicle
* @return int
*/
static updateVehicleAlbums(axios: AxiosStatic, vehicle: Vehicle): Promise<AxiosResponse<number>> {
return axios.post('upload/updateVehicleAlbums', vehicle);
}
/**
* 富文本图片上传
* @param file
* @param request
* @return Map
* @throws FileStorageException
*/
static uploadPasteImage(axios: AxiosStatic, file: any): Promise<AxiosResponse<any>> {
return axios.post('upload/uploadRichTextImage', null, {params: {file: file}});
}
/**
*/
static uploadVehicleAlbum(axios: AxiosStatic, file: any, vehicleId: number, fileSubtype: string, directory: string, cache: boolean | undefined | null): Promise<AxiosResponse<FileInfo>> {
return axios.post('upload/uploadVehicleAlbum', null, {params: {file: file, vehicleId: vehicleId, fileSubtype: fileSubtype, directory: directory, cache: cache}});
}
// region 前端扩展代码区
// endregion
}