mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-24 21:44:05 +00:00
refactor(module): 重构模块路径和数据库配置
- 将前端API路径从`system`和`monitor`重命名为`module_system`和`module_monitor` - 移除MongoDB相关配置和依赖 - 统一数据库类型命名为`mysql`和`postgres` - 修复代码生成模板中的字段命名问题 - 更新依赖项并移除不必要的包 - 优化数据库连接配置 - 添加新的文档和Redoc视图组件 - 修复SQL脚本中的字段注释
This commit is contained in:
+35
-142
@@ -4,8 +4,8 @@ const API_PATH = "/generator/gencode";
|
||||
|
||||
const GencodeAPI = {
|
||||
// 查询生成表数据
|
||||
listTable(query: GenTableQueryParam) {
|
||||
return request<ApiResponse<PageResult<GenTableOutVO[]>>>({
|
||||
listTable(query: GenTablePageQuery) {
|
||||
return request<ApiResponse<PageResult<GenTableSchema[]>>>({
|
||||
url: `${API_PATH}/list`,
|
||||
method: 'get',
|
||||
params: query
|
||||
@@ -13,8 +13,8 @@ const GencodeAPI = {
|
||||
},
|
||||
|
||||
// 查询db数据库列表
|
||||
listDbTable(query: GenTableQueryParam) {
|
||||
return request<ApiResponse<PageResult<DatabaseTable[]>>>({
|
||||
listDbTable(query: DBTablePageQuery) {
|
||||
return request<ApiResponse<PageResult<DBTableSchema[]>>>({
|
||||
url: `${API_PATH}/db/list`,
|
||||
method: 'get',
|
||||
params: query
|
||||
@@ -32,7 +32,7 @@ const GencodeAPI = {
|
||||
|
||||
// 查询表详细信息
|
||||
getGenTableDetail(table_id: number) {
|
||||
return request<ApiResponse<GenTableDetailResult>>({
|
||||
return request<ApiResponse<GenTableSchema>>({
|
||||
url: `${API_PATH}/detail/${table_id}`,
|
||||
method: 'get'
|
||||
})
|
||||
@@ -112,41 +112,32 @@ export interface GeneratorPreviewVO {
|
||||
content: string;
|
||||
}
|
||||
|
||||
/** 数据表分页查询参数 */
|
||||
export interface GenTableQueryParam {
|
||||
page_no: number;
|
||||
page_size: number;
|
||||
table_name?: string;
|
||||
table_comment?: string;
|
||||
start_time?: string;
|
||||
end_time?: string;
|
||||
}
|
||||
|
||||
export interface TablePageQuery extends PageQuery {
|
||||
/** 代码生成表分页查询参数 */
|
||||
export interface DBTablePageQuery extends PageQuery {
|
||||
/** 表名称 */
|
||||
table_name?: string;
|
||||
/** 表描述 */
|
||||
table_comment?: string;
|
||||
}
|
||||
|
||||
/** 数据表分页对象 */
|
||||
export interface TablePageVO {
|
||||
/** 表名称 */
|
||||
table_name: string;
|
||||
|
||||
/** 表描述 */
|
||||
table_comment: string;
|
||||
|
||||
/** 数据库名称 */
|
||||
database_name: string;
|
||||
|
||||
/** 表单类型 */
|
||||
table_type: string;
|
||||
|
||||
/**数据库表基本信息接口 */
|
||||
export interface DBTableSchema {
|
||||
database_name?: string;
|
||||
table_name?: string;
|
||||
table_comment?: string;
|
||||
table_type?: string;
|
||||
}
|
||||
|
||||
/** 代码生成表输出对象 */
|
||||
export interface GenTableOutVO {
|
||||
/** 代码生成表分页查询参数 */
|
||||
export interface GenTablePageQuery extends PageQuery {
|
||||
/** 表名称 */
|
||||
table_name?: string;
|
||||
/** 表描述 */
|
||||
table_comment?: string;
|
||||
}
|
||||
|
||||
/** 代码生成业务表模型 */
|
||||
export interface GenTableSchema {
|
||||
/** 主键 */
|
||||
id?: number;
|
||||
/** 表名称 */
|
||||
@@ -167,32 +158,16 @@ export interface GenTableOutVO {
|
||||
business_name?: string;
|
||||
/** 生成功能名 */
|
||||
function_name?: string;
|
||||
/** 生成代码方式(0zip压缩包 1自定义路径) */
|
||||
gen_type?: string;
|
||||
/** 其它生成选项 */
|
||||
options?: GenTableOptionModel;
|
||||
}
|
||||
|
||||
/** 表选项模型 */
|
||||
export interface GenTableOptionModel {
|
||||
/** 所属父级分类 */
|
||||
parent_menu_id?: number;
|
||||
}
|
||||
|
||||
/** 代码生成业务表模型 */
|
||||
export interface GenTableSchema extends GenTableOutVO {
|
||||
/** 表描述 */
|
||||
description?: string;
|
||||
/** 上级菜单ID字段 */
|
||||
parent_menu_id?: number;
|
||||
/** 上级菜单名称字段 */
|
||||
parent_menu_name?: string;
|
||||
/** 表列信息 */
|
||||
columns: GenTableColumnSchema[];
|
||||
/** 主键信息 */
|
||||
pk_column?: GenTableColumnOutSchema;
|
||||
pk_column?: GenTableColumnSchema;
|
||||
/** 子表信息 */
|
||||
sub_table?: GenTableSchema;
|
||||
/** 表列信息 */
|
||||
columns: GenTableColumnOutSchema[];
|
||||
/** 是否为子表 */
|
||||
sub?: boolean;
|
||||
}
|
||||
@@ -218,21 +193,21 @@ export interface GenTableColumnSchema {
|
||||
/** PYTHON字段名 */
|
||||
python_field?: string;
|
||||
/** 是否主键(1是) */
|
||||
is_pk?: string;
|
||||
is_pk?: boolean;
|
||||
/** 是否自增(1是) */
|
||||
is_increment?: string;
|
||||
is_increment?: boolean;
|
||||
/** 是否必填(1是) */
|
||||
is_required?: string;
|
||||
is_nullable?: boolean;
|
||||
/** 是否唯一(1是) */
|
||||
is_unique?: string;
|
||||
/** 是否为插入字段(1是) */
|
||||
is_insert?: string;
|
||||
is_unique?: boolean;
|
||||
/** 是否为新增字段(1是) */
|
||||
is_insert?: boolean;
|
||||
/** 是否编辑字段(1是) */
|
||||
is_edit?: string;
|
||||
is_edit?: boolean;
|
||||
/** 是否列表字段(1是) */
|
||||
is_list?: string;
|
||||
is_list?: boolean;
|
||||
/** 是否查询字段(1是) */
|
||||
is_query?: string;
|
||||
is_query?: boolean;
|
||||
/** 查询方式(等于、不等于、大于、小于、范围) */
|
||||
query_type?: string;
|
||||
/** 显示类型(文本框、文本域、下拉框、复选框、单选框、日期控件) */
|
||||
@@ -245,85 +220,3 @@ export interface GenTableColumnSchema {
|
||||
description?: string;
|
||||
}
|
||||
|
||||
/** 代码生成业务表列输出模型 */
|
||||
export interface GenTableColumnOutSchema extends GenTableColumnSchema {
|
||||
/** 字段大写形式 */
|
||||
cap_python_field?: string;
|
||||
/** 是否主键 */
|
||||
pk?: boolean;
|
||||
/** 是否自增 */
|
||||
increment?: boolean;
|
||||
/** 是否必填 */
|
||||
required?: boolean;
|
||||
/** 是否唯一 */
|
||||
unique?: boolean;
|
||||
/** 是否为插入字段 */
|
||||
insert?: boolean;
|
||||
/** 是否编辑字段 */
|
||||
edit?: boolean;
|
||||
/** 是否列表字段 */
|
||||
list?: boolean;
|
||||
/** 是否查询字段 */
|
||||
query?: boolean;
|
||||
/** 是否为基类字段 */
|
||||
super_column?: boolean;
|
||||
/** 是否为基类字段白名单 */
|
||||
usable_column?: boolean;
|
||||
}
|
||||
|
||||
/** 表详情查询结果 */
|
||||
export interface GenTableDetailResult {
|
||||
/** 表信息 */
|
||||
info: GenTableOutVO;
|
||||
/** 表列信息 */
|
||||
rows: GenTableColumnOutSchema[];
|
||||
/** 所有表信息 */
|
||||
tables: GenTableOutVO[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据库表基本信息接口
|
||||
*/
|
||||
export interface DatabaseTable {
|
||||
database_name?: string;
|
||||
table_name?: string;
|
||||
table_comment?: string;
|
||||
table_type?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 表列基本信息接口
|
||||
*/
|
||||
export interface TableColumn {
|
||||
column_name: string;
|
||||
column_comment: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 表基本信息接口
|
||||
*/
|
||||
export interface TableInfo {
|
||||
table_name?: string;
|
||||
table_comment?: string;
|
||||
columns?: TableColumn[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入表查询表单数据接口
|
||||
*/
|
||||
export interface ImportTableQueryForm {
|
||||
page_no: number;
|
||||
page_size: number;
|
||||
table_name?: string;
|
||||
table_comment?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 基本信息表单数据接口
|
||||
*/
|
||||
export interface BasicInfoFormData {
|
||||
table_name?: string;
|
||||
table_comment?: string;
|
||||
class_name?: string;
|
||||
description?: string;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import request from "@/utils/request";
|
||||
import { MenuTable, MenuForm } from "@/api/system/menu";
|
||||
import { MenuTable, MenuForm } from "@/api/module_system/menu";
|
||||
|
||||
const API_PATH = "/system/user";
|
||||
|
||||
Reference in New Issue
Block a user