|
|
|
@ -2,56 +2,56 @@ import { defHttp } from '@/utils/http/axios'
|
|
|
|
|
import type { CodegenUpdateReqVO, CodegenCreateListReqVO } from './types' |
|
|
|
|
|
|
|
|
|
// 查询列表代码生成表定义
|
|
|
|
|
export function getCodegenTablePageApi(params) { |
|
|
|
|
export function getCodegenTablePage(params) { |
|
|
|
|
return defHttp.get({ url: '/infra/codegen/table/page', params }) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 查询详情代码生成表定义
|
|
|
|
|
export function getCodegenTableApi(id: number) { |
|
|
|
|
export function getCodegenTable(id: number) { |
|
|
|
|
return defHttp.get({ url: '/infra/codegen/detail?tableId=' + id }) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 新增代码生成表定义
|
|
|
|
|
export function createCodegenTableApi(data: CodegenCreateListReqVO) { |
|
|
|
|
export function createCodegenTable(data: CodegenCreateListReqVO) { |
|
|
|
|
return defHttp.post({ url: '/infra/codegen/create', data }) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 修改代码生成表定义
|
|
|
|
|
export function updateCodegenTableApi(data: CodegenUpdateReqVO) { |
|
|
|
|
export function updateCodegenTable(data: CodegenUpdateReqVO) { |
|
|
|
|
return defHttp.put({ url: '/infra/codegen/update', data }) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 基于数据库的表结构,同步数据库的表和字段定义
|
|
|
|
|
export function syncCodegenFromDBApi(id: number) { |
|
|
|
|
export function syncCodegenFromDB(id: number) { |
|
|
|
|
return defHttp.put({ url: '/infra/codegen/sync-from-db?tableId=' + id }) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 基于 SQL 建表语句,同步数据库的表和字段定义
|
|
|
|
|
export function syncCodegenFromSQLApi(id: number, sql: string) { |
|
|
|
|
export function syncCodegenFromSQL(id: number, sql: string) { |
|
|
|
|
return defHttp.put({ url: '/infra/codegen/sync-from-sql?tableId=' + id + '&sql=' + sql }) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 预览生成代码
|
|
|
|
|
export function previewCodegenApi(id: number) { |
|
|
|
|
export function previewCodegen(id: number) { |
|
|
|
|
return defHttp.get({ url: '/infra/codegen/preview?tableId=' + id }) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 下载生成代码
|
|
|
|
|
export function downloadCodegenApi(id: number) { |
|
|
|
|
export function downloadCodegen(id: number) { |
|
|
|
|
return defHttp.download({ url: '/infra/codegen/download?tableId=' + id }, '生成代码.zip') |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 获得表定义
|
|
|
|
|
export function getSchemaTableListApi(params) { |
|
|
|
|
export function getSchemaTableList(params) { |
|
|
|
|
return defHttp.get({ url: '/infra/codegen/db/table/list', params }) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 基于数据库的表结构,创建代码生成器的表定义
|
|
|
|
|
export function createCodegenListApi(data) { |
|
|
|
|
export function createCodegenList(data) { |
|
|
|
|
return defHttp.post({ url: '/infra/codegen/create-list', data }) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 删除代码生成表定义
|
|
|
|
|
export function deleteCodegenTableApi(id: number) { |
|
|
|
|
export function deleteCodegenTable(id: number) { |
|
|
|
|
return defHttp.delete({ url: '/infra/codegen/delete?tableId=' + id }) |
|
|
|
|
} |
|
|
|
|