mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-25 13:51:04 +00:00
style: 移除多余空行并统一代码格式
修复代码中的多余空行问题,统一字符串引号使用双引号,调整对象和数组的格式,优化代码缩进和换行,提升代码可读性和一致性
This commit is contained in:
@@ -117,7 +117,6 @@ const JobAPI = {
|
||||
responseType: "blob",
|
||||
});
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
export default JobAPI;
|
||||
|
||||
@@ -12,7 +12,7 @@ const ExampleAPI = {
|
||||
},
|
||||
|
||||
getExampleDetail(query: number) {
|
||||
return request<ApiResponse<ExampleTable>>({
|
||||
return request<ApiResponse<ExampleTable>>({
|
||||
url: `${API_PATH}/detail/${query}`,
|
||||
method: "get",
|
||||
});
|
||||
|
||||
@@ -7,97 +7,97 @@ const GencodeAPI = {
|
||||
listTable(query: GenTablePageQuery) {
|
||||
return request<ApiResponse<PageResult<GenTableSchema[]>>>({
|
||||
url: `${API_PATH}/list`,
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
},
|
||||
|
||||
// 查询db数据库列表
|
||||
listDbTable(query: DBTablePageQuery) {
|
||||
return request<ApiResponse<PageResult<DBTableSchema[]>>>({
|
||||
url: `${API_PATH}/db/list`,
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
},
|
||||
|
||||
// 导入表
|
||||
importTable(table_names: string[]) {
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/import`,
|
||||
method: 'post',
|
||||
data: table_names
|
||||
})
|
||||
method: "post",
|
||||
data: table_names,
|
||||
});
|
||||
},
|
||||
|
||||
// 查询表详细信息
|
||||
getGenTableDetail(table_id: number) {
|
||||
return request<ApiResponse<GenTableSchema>>({
|
||||
url: `${API_PATH}/detail/${table_id}`,
|
||||
method: 'get'
|
||||
})
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
// 创建表
|
||||
createTable(sql: string) {
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/create`,
|
||||
method: 'post',
|
||||
data: sql
|
||||
})
|
||||
method: "post",
|
||||
data: sql,
|
||||
});
|
||||
},
|
||||
|
||||
// 更新表信息
|
||||
updateTable(data: GenTableSchema, table_id: number) {
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/update/${table_id}`,
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
method: "put",
|
||||
data,
|
||||
});
|
||||
},
|
||||
|
||||
// 删除表数据
|
||||
deleteTable(table_ids: number[]) {
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/delete`,
|
||||
method: 'delete',
|
||||
data: table_ids
|
||||
})
|
||||
method: "delete",
|
||||
data: table_ids,
|
||||
});
|
||||
},
|
||||
|
||||
// 批量生成代码
|
||||
batchGenCode(table_names: string[]) {
|
||||
return request<Blob>({
|
||||
url: `${API_PATH}/batch/output`,
|
||||
method: 'patch',
|
||||
method: "patch",
|
||||
data: table_names,
|
||||
responseType: 'blob'
|
||||
})
|
||||
responseType: "blob",
|
||||
});
|
||||
},
|
||||
|
||||
// 生成代码到指定路径
|
||||
genCodeToPath(table_name: string) {
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/output/${table_name}`,
|
||||
method: 'post'
|
||||
})
|
||||
method: "post",
|
||||
});
|
||||
},
|
||||
|
||||
// 预览生成代码
|
||||
previewTable(id: number) {
|
||||
return request<ApiResponse<Record<string, string>>>({
|
||||
url: `${API_PATH}/preview/${id}`,
|
||||
method: 'get'
|
||||
})
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
// 同步数据库
|
||||
syncDb(table_name: string) {
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/sync_db/${table_name}`,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
method: "post",
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export default GencodeAPI;
|
||||
@@ -219,4 +219,3 @@ export interface GenTableColumnSchema {
|
||||
/** 功能描述 */
|
||||
description?: string;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ export const ResourceAPI = {
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
* @param formData 文件数据
|
||||
@@ -118,8 +117,6 @@ export const ResourceAPI = {
|
||||
|
||||
export default ResourceAPI;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 资源列表查询参数
|
||||
*/
|
||||
|
||||
@@ -80,7 +80,7 @@ export interface MenuTable {
|
||||
hidden?: boolean;
|
||||
always_show?: boolean;
|
||||
title?: string;
|
||||
params?: { key: string; value: string; }[];
|
||||
params?: { key: string; value: string }[];
|
||||
affix?: boolean;
|
||||
status?: boolean;
|
||||
description?: string;
|
||||
|
||||
@@ -12,7 +12,7 @@ const TenantAPI = {
|
||||
},
|
||||
|
||||
detail(query: number) {
|
||||
return request<ApiResponse<ObjTable>>({
|
||||
return request<ApiResponse<ObjTable>>({
|
||||
url: `${API_PATH}/detail/${query}`,
|
||||
method: "get",
|
||||
});
|
||||
|
||||
@@ -250,7 +250,7 @@ export interface UserForm {
|
||||
id?: number;
|
||||
username?: string;
|
||||
name?: string;
|
||||
dept_id?: number;
|
||||
dept_id?: number;
|
||||
dept_name?: string;
|
||||
role_ids?: number[];
|
||||
role_names?: string[];
|
||||
|
||||
Reference in New Issue
Block a user