Files
gva/web/src/api/autoCode.js
奇淼(piexlmax 429353fa54 自动化代码可分包 (#982)
* [style] 修改右上角图标,选择统一风格的iconfont

* 增加路由排错处理

* 未输入tablename时前端自动生成下划线表名方式回滚误删表

* 支持自动化生成package功能

Co-authored-by: bypanghu <bypanghu@163.com>
Co-authored-by: songzhibin97 <718428482@qq.com>
2022-03-26 14:13:26 +08:00

118 lines
2.3 KiB
JavaScript

import service from '@/utils/request'
export const preview = (data) => {
return service({
url: '/autoCode/preview',
method: 'post',
data
})
}
export const createTemp = (data) => {
return service({
url: '/autoCode/createTemp',
method: 'post',
data,
responseType: 'blob'
})
}
// @Tags SysApi
// @Summary 获取当前所有数据库
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
// @Router /autoCode/getDatabase [get]
export const getDB = () => {
return service({
url: '/autoCode/getDB',
method: 'get'
})
}
// @Tags SysApi
// @Summary 获取当前数据库所有表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
// @Router /autoCode/getTables [get]
export const getTable = (params) => {
return service({
url: '/autoCode/getTables',
method: 'get',
params
})
}
// @Tags SysApi
// @Summary 获取当前数据库所有表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
// @Router /autoCode/getColumn [get]
export const getColumn = (params) => {
return service({
url: '/autoCode/getColumn',
method: 'get',
params
})
}
export const getSysHistory = (data) => {
return service({
url: '/autoCode/getSysHistory',
method: 'post',
data
})
}
export const rollback = (data) => {
return service({
url: '/autoCode/rollback',
method: 'post',
data
})
}
export const getMeta = (data) => {
return service({
url: '/autoCode/getMeta',
method: 'post',
data
})
}
export const delSysHistory = (data) => {
return service({
url: '/autoCode/delSysHistory',
method: 'post',
data
})
}
export const createPackageApi = (data) => {
return service({
url: '/autoCode/createPackage',
method: 'post',
data
})
}
export const getPackageApi = () => {
return service({
url: '/autoCode/getPackage',
method: 'post'
})
}
export const deletePackageApi = (data) => {
return service({
url: '/autoCode/delPackage',
method: 'post',
data
})
}