mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-14 19:15:06 +08:00
完成代码生成器~
This commit is contained in:
@ -27,13 +27,25 @@ export function updateCodegen(data) {
|
||||
}
|
||||
|
||||
// 基于数据库的表结构,同步数据库的表和字段定义
|
||||
export function syncCodegen(tableId) {
|
||||
export function syncCodegenFromDB(tableId) {
|
||||
return request({
|
||||
url: '/tool/codegen/sync?tableId=' + tableId,
|
||||
url: '/tool/codegen/sync-from-db?tableId=' + tableId,
|
||||
method: 'put'
|
||||
})
|
||||
}
|
||||
|
||||
// 基于 SQL 建表语句,同步数据库的表和字段定义
|
||||
export function syncCodegenFromSQL(tableId, sql) {
|
||||
return request({
|
||||
url: '/tool/codegen/sync-from-sql?tableId=' + tableId,
|
||||
method: 'put',
|
||||
headers:{
|
||||
'Content-type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
data: 'tableId=' + tableId + "&sql=" + sql,
|
||||
})
|
||||
}
|
||||
|
||||
// 预览生成代码
|
||||
export function previewCodegen(tableId) {
|
||||
return request({
|
||||
@ -61,9 +73,9 @@ export function getSchemaTableList(query) {
|
||||
}
|
||||
|
||||
// 基于数据库的表结构,创建代码生成器的表定义
|
||||
export function createCodegenList(tableNames) {
|
||||
export function createCodegenListFromDB(tableNames) {
|
||||
return request({
|
||||
url: '/tool/codegen/create-list',
|
||||
url: '/tool/codegen/create-list-from-db',
|
||||
method: 'post',
|
||||
headers:{
|
||||
'Content-type': 'application/x-www-form-urlencoded'
|
||||
@ -72,6 +84,18 @@ export function createCodegenList(tableNames) {
|
||||
})
|
||||
}
|
||||
|
||||
// 基于 SQL 建表语句,创建代码生成器的表定义
|
||||
export function createCodegenListFromSQL(data) {
|
||||
return request({
|
||||
url: '/tool/codegen/create-list-from-sql',
|
||||
method: 'post',
|
||||
headers:{
|
||||
'Content-type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
data: 'sql=' + data.sql,
|
||||
})
|
||||
}
|
||||
|
||||
// 删除数据库的表和字段定义
|
||||
export function deleteCodegen(tableId) {
|
||||
return request({
|
||||
|
Reference in New Issue
Block a user