diff --git a/apps/web-antd/src/api/infra/codegen/index.ts b/apps/web-antd/src/api/infra/codegen/index.ts index 759c8ee2..992d41d2 100644 --- a/apps/web-antd/src/api/infra/codegen/index.ts +++ b/apps/web-antd/src/api/infra/codegen/index.ts @@ -65,7 +65,7 @@ export namespace InfraCodegenApi { } /** 更新代码生成请求 */ - export interface CodegenUpdateReq { + export interface CodegenUpdateReqVO { table: any | CodegenTable; columns: CodegenColumn[]; } @@ -106,25 +106,36 @@ export function getCodegenTable(tableId: number) { } /** 修改代码生成表定义 */ -export function updateCodegenTable(data: InfraCodegenApi.CodegenUpdateReq) { +export function updateCodegenTable(data: InfraCodegenApi.CodegenUpdateReqVO) { return requestClient.put('/infra/codegen/update', data); } /** 基于数据库的表结构,同步数据库的表和字段定义 */ export function syncCodegenFromDB(tableId: number) { - return requestClient.put(`/infra/codegen/sync-from-db?tableId=${tableId}`); + return requestClient.put( + '/infra/codegen/sync-from-db', + {}, + { + params: { tableId }, + }, + ); } /** 预览生成代码 */ export function previewCodegen(tableId: number) { return requestClient.get( - `/infra/codegen/preview?tableId=${tableId}`, + '/infra/codegen/preview', + { + params: { tableId }, + }, ); } /** 下载生成代码 */ export function downloadCodegen(tableId: number) { - return requestClient.download(`/infra/codegen/download?tableId=${tableId}`); + return requestClient.download('/infra/codegen/download', { + params: { tableId }, + }); } /** 获得表定义 */ diff --git a/apps/web-antd/src/api/infra/file/index.ts b/apps/web-antd/src/api/infra/file/index.ts index e7dc7891..edf06933 100644 --- a/apps/web-antd/src/api/infra/file/index.ts +++ b/apps/web-antd/src/api/infra/file/index.ts @@ -19,7 +19,7 @@ export namespace InfraFileApi { } /** 文件预签名地址 */ - export interface FilePresignedUrlResp { + export interface FilePresignedUrlRespVO { configId: number; // 文件配置编号 uploadUrl: string; // 文件上传 URL url: string; // 文件 URL @@ -27,7 +27,7 @@ export namespace InfraFileApi { } /** 上传文件 */ - export interface FileUploadReq { + export interface FileUploadReqVO { file: globalThis.File; directory?: string; } @@ -52,7 +52,7 @@ export function deleteFileList(ids: number[]) { /** 获取文件预签名地址 */ export function getFilePresignedUrl(name: string, directory?: string) { - return requestClient.get( + return requestClient.get( '/infra/file/presigned-url', { params: { name, directory }, @@ -67,7 +67,7 @@ export function createFile(data: InfraFileApi.File) { /** 上传文件 */ export function uploadFile( - data: InfraFileApi.FileUploadReq, + data: InfraFileApi.FileUploadReqVO, onUploadProgress?: AxiosProgressEvent, ) { // 特殊:由于 upload 内部封装,即使 directory 为 undefined,也会传递给后端 diff --git a/apps/web-antd/src/components/upload/use-upload.ts b/apps/web-antd/src/components/upload/use-upload.ts index ec3b2d58..2f46f9e9 100644 --- a/apps/web-antd/src/components/upload/use-upload.ts +++ b/apps/web-antd/src/components/upload/use-upload.ts @@ -135,7 +135,7 @@ export function getUploadUrl(): string { * @param file 文件 */ function createFile0( - vo: InfraFileApi.FilePresignedUrlResp, + vo: InfraFileApi.FilePresignedUrlRespVO, file: File, ): InfraFileApi.File { const fileVO = { diff --git a/apps/web-ele/src/api/infra/codegen/index.ts b/apps/web-ele/src/api/infra/codegen/index.ts index 5e83caf8..992d41d2 100644 --- a/apps/web-ele/src/api/infra/codegen/index.ts +++ b/apps/web-ele/src/api/infra/codegen/index.ts @@ -112,9 +112,13 @@ export function updateCodegenTable(data: InfraCodegenApi.CodegenUpdateReqVO) { /** 基于数据库的表结构,同步数据库的表和字段定义 */ export function syncCodegenFromDB(tableId: number) { - return requestClient.put('/infra/codegen/sync-from-db', { - params: { tableId }, - }); + return requestClient.put( + '/infra/codegen/sync-from-db', + {}, + { + params: { tableId }, + }, + ); } /** 预览生成代码 */