From 8e613e8b812f705eb008ceb8fd89664db4430e56 Mon Sep 17 00:00:00 2001 From: xingyu4j Date: Tue, 26 Nov 2024 12:50:19 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20api=20=E4=BF=9D=E6=8C=81=E7=BB=9F?= =?UTF-8?q?=E4=B8=80=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web-antd/src/api/infra/codegen/index.ts | 46 +++++++++---------- .../src/api/infra/data-source-config/index.ts | 24 +++++----- .../src/api/system/dict-data/index.ts | 28 +++++------ 3 files changed, 49 insertions(+), 49 deletions(-) diff --git a/apps/web-antd/src/api/infra/codegen/index.ts b/apps/web-antd/src/api/infra/codegen/index.ts index 0276b198..8b3d22c4 100644 --- a/apps/web-antd/src/api/infra/codegen/index.ts +++ b/apps/web-antd/src/api/infra/codegen/index.ts @@ -243,70 +243,70 @@ export namespace CodegenApi { } // 查询列表代码生成表定义 -export const getCodegenTableList = (dataSourceConfigId: number) => { +export function getCodegenTableList(dataSourceConfigId: number) { return requestClient.get( `/infra/codegen/table/list?dataSourceConfigId=${dataSourceConfigId}`, ); -}; +} // 查询列表代码生成表定义 -export const getCodegenTablePage = (params: PageParam) => { +export function getCodegenTablePage(params: PageParam) { return requestClient.get( '/infra/codegen/table/page', { params }, ); -}; +} // 查询详情代码生成表定义 -export const getCodegenTable = (id: number) => { +export function getCodegenTable(id: number) { return requestClient.get( `/infra/codegen/detail?tableId=${id}`, ); -}; +} // 新增代码生成表定义 -export const createCodegenTable = (data: CodegenApi.CodegenCreateListReqVO) => { +export function createCodegenTable(data: CodegenApi.CodegenCreateListReqVO) { return requestClient.post('/infra/codegen/create', data); -}; +} // 修改代码生成表定义 -export const updateCodegenTable = (data: CodegenApi.CodegenUpdateReqVO) => { +export function updateCodegenTable(data: CodegenApi.CodegenUpdateReqVO) { return requestClient.put('/infra/codegen/update', data); -}; +} // 基于数据库的表结构,同步数据库的表和字段定义 -export const syncCodegenFromDB = (id: number) => { +export function syncCodegenFromDB(id: number) { return requestClient.put(`/infra/codegen/sync-from-db?tableId=${id}`); -}; +} // 预览生成代码 -export const previewCodegen = (id: number) => { +export function previewCodegen(id: number) { return requestClient.get(`/infra/codegen/preview?tableId=${id}`); -}; +} // 下载生成代码 -export const downloadCodegen = (id: number) => { +export function downloadCodegen(id: number) { return requestClient.download(`/infra/codegen/download?tableId=${id}`); -}; +} // 获得表定义 -export const getSchemaTableList = (params: { +export function getSchemaTableList(params: { comment?: string; dataSourceConfigId: number; name?: string; -}) => { +}) { return requestClient.get( '/infra/codegen/db/table/list', { params }, ); -}; +} // 基于数据库的表结构,创建代码生成器的表定义 -export const createCodegenList = (data: CodegenApi.CodegenCreateListReqVO) => { +export function createCodegenList(data: CodegenApi.CodegenCreateListReqVO) { return requestClient.post('/infra/codegen/create-list', data); -}; +} // 删除代码生成表定义 -export const deleteCodegenTable = (id: number) => { +export function deleteCodegenTable(id: number) { return requestClient.delete(`/infra/codegen/delete?tableId=${id}`); -}; +} diff --git a/apps/web-antd/src/api/infra/data-source-config/index.ts b/apps/web-antd/src/api/infra/data-source-config/index.ts index 33559c9c..207c684a 100644 --- a/apps/web-antd/src/api/infra/data-source-config/index.ts +++ b/apps/web-antd/src/api/infra/data-source-config/index.ts @@ -18,34 +18,34 @@ export namespace DataSourceConfigApi { } } // 新增数据源配置 -export const createDataSourceConfig = ( +export function createDataSourceConfig( data: DataSourceConfigApi.DataSourceConfigSaveReqVO, -) => { +) { return requestClient.post('/infra/data-source-config/create', data); -}; +} // 修改数据源配置 -export const updateDataSourceConfig = ( +export function updateDataSourceConfig( data: DataSourceConfigApi.DataSourceConfigSaveReqVO, -) => { +) { return requestClient.put('/infra/data-source-config/update', data); -}; +} // 删除数据源配置 -export const deleteDataSourceConfig = (id: number) => { +export function deleteDataSourceConfig(id: number) { return requestClient.delete(`/infra/data-source-config/delete?id=${id}`); -}; +} // 查询数据源配置详情 -export const getDataSourceConfig = (id: number) => { +export function getDataSourceConfig(id: number) { return requestClient.get( `/infra/data-source-config/get?id=${id}`, ); -}; +} // 查询数据源配置列表 -export const getDataSourceConfigList = () => { +export function getDataSourceConfigList() { return requestClient.get( '/infra/data-source-config/list', ); -}; +} diff --git a/apps/web-antd/src/api/system/dict-data/index.ts b/apps/web-antd/src/api/system/dict-data/index.ts index 5b89e1ac..164f89c2 100644 --- a/apps/web-antd/src/api/system/dict-data/index.ts +++ b/apps/web-antd/src/api/system/dict-data/index.ts @@ -54,36 +54,36 @@ export namespace DictDataApi { } // 查询字典数据(精简)列表 -export const getSimpleDictDataList = () => { +export function getSimpleDictDataList() { return requestClient.get('/system/dict-data/simple-list'); -}; +} // 查询字典数据列表 -export const getDictDataPage = (params: PageParam) => { +export function getDictDataPage(params: PageParam) { return requestClient.get('/system/dict-data/page', { params }); -}; +} // 查询字典数据详情 -export const getDictData = (id: number) => { +export function getDictData(id: number) { return requestClient.get(`/system/dict-data/get?id=${id}`); -}; +} // 新增字典数据 -export const createDictData = (data: DictDataApi.DictDataSaveReqVO) => { +export function createDictData(data: DictDataApi.DictDataSaveReqVO) { return requestClient.post('/system/dict-data/create', data); -}; +} // 修改字典数据 -export const updateDictData = (data: DictDataApi.DictDataSaveReqVO) => { +export function updateDictData(data: DictDataApi.DictDataSaveReqVO) { return requestClient.put('/system/dict-data/update', data); -}; +} // 删除字典数据 -export const deleteDictData = (id: number) => { +export function deleteDictData(id: number) { return requestClient.delete(`/system/dict-data/delete?id=${id}`); -}; +} // 导出字典类型数据 -export const exportDictData = (params: DictDataApi.DictDataPageReqVO) => { +export function exportDictData(params: DictDataApi.DictDataPageReqVO) { return requestClient.download('/system/dict-data/export', { params }); -}; +}