mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-24 13:37:13 +00:00
refactor(module): 重构模块结构和代码生成模板
- 删除废弃的ticket和version模块相关代码 - 将resource模块从system迁移到monitor - 移除前端资源管理相关配置 - 重构代码生成模板路径和配置 - 修复CRUD基类初始化参数问题 - 优化模板工具类路径处理 - 更新基础模型字段和配置
This commit is contained in:
@@ -7,7 +7,7 @@ export const ResourceAPI = {
|
||||
*/
|
||||
getResourceList(query: ResourceListQuery) {
|
||||
return request<ApiResponse<ResourceListResponse>>({
|
||||
url: `/resource/resource/list`,
|
||||
url: `/monitor/resource/list`,
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
@@ -19,7 +19,7 @@ export const ResourceAPI = {
|
||||
*/
|
||||
searchResource(body: ResourceSearchQuery) {
|
||||
return request<ApiResponse<ResourceListResponse>>({
|
||||
url: `/resource/resource/search`,
|
||||
url: `/monitor/resource/search`,
|
||||
method: "post",
|
||||
data: body,
|
||||
});
|
||||
@@ -31,7 +31,7 @@ export const ResourceAPI = {
|
||||
*/
|
||||
uploadFile(formData: FormData) {
|
||||
return request<ApiResponse<UploadFilePath>>({
|
||||
url: `/resource/resource/upload`,
|
||||
url: `/monitor/resource/upload`,
|
||||
method: "post",
|
||||
data: formData,
|
||||
headers: { "Content-Type": "multipart/form-data" },
|
||||
@@ -44,7 +44,7 @@ export const ResourceAPI = {
|
||||
*/
|
||||
downloadFile(path: string) {
|
||||
return request<Blob>({
|
||||
url: `/resource/resource/download`,
|
||||
url: `/monitor/resource/download`,
|
||||
method: "get",
|
||||
params: { path },
|
||||
responseType: "blob",
|
||||
@@ -57,7 +57,7 @@ export const ResourceAPI = {
|
||||
*/
|
||||
deleteResource(body: string[]) {
|
||||
return request<ApiResponse>({
|
||||
url: `/resource/resource/delete`,
|
||||
url: `/monitor/resource/delete`,
|
||||
method: "delete",
|
||||
data: body,
|
||||
});
|
||||
@@ -69,7 +69,7 @@ export const ResourceAPI = {
|
||||
*/
|
||||
moveResource(body: ResourceMoveQuery) {
|
||||
return request<ApiResponse>({
|
||||
url: `/resource/resource/move`,
|
||||
url: `/monitor/resource/move`,
|
||||
method: "post",
|
||||
data: body,
|
||||
});
|
||||
@@ -81,7 +81,7 @@ export const ResourceAPI = {
|
||||
*/
|
||||
copyResource(body: ResourceCopyQuery) {
|
||||
return request<ApiResponse>({
|
||||
url: `/resource/resource/copy`,
|
||||
url: `/monitor/resource/copy`,
|
||||
method: "post",
|
||||
data: body,
|
||||
});
|
||||
@@ -93,7 +93,7 @@ export const ResourceAPI = {
|
||||
*/
|
||||
renameResource(body: ResourceRenameQuery) {
|
||||
return request<ApiResponse>({
|
||||
url: `/resource/resource/rename`,
|
||||
url: `/monitor/resource/rename`,
|
||||
method: "post",
|
||||
data: body,
|
||||
});
|
||||
@@ -105,7 +105,7 @@ export const ResourceAPI = {
|
||||
*/
|
||||
createDirectory(body: ResourceCreateDirQuery) {
|
||||
return request<ApiResponse>({
|
||||
url: `/resource/resource/create-dir`,
|
||||
url: `/monitor/resource/create-dir`,
|
||||
method: "post",
|
||||
data: body,
|
||||
});
|
||||
@@ -116,7 +116,7 @@ export const ResourceAPI = {
|
||||
*/
|
||||
getResourceStats() {
|
||||
return request<ApiResponse<ResourceStats>>({
|
||||
url: `/resource/resource/stats`,
|
||||
url: `/monitor/resource/stats`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
@@ -127,7 +127,7 @@ export const ResourceAPI = {
|
||||
*/
|
||||
exportResource(body: ResourceSearchQuery) {
|
||||
return request<Blob>({
|
||||
url: `/resource/resource/export`,
|
||||
url: `/monitor/resource/export`,
|
||||
method: "post",
|
||||
data: body,
|
||||
responseType: "blob",
|
||||
@@ -1,83 +0,0 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
const TicketAPI = {
|
||||
getTicketList(query: TicketPageQuery) {
|
||||
return request<ApiResponse<PageResult<TicketTable[]>>>({
|
||||
url: `/system/ticket/list`,
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
},
|
||||
|
||||
getTicketDetail(query: number) {
|
||||
return request<ApiResponse<TicketTable>>({
|
||||
url: `/system/ticket/detail/${query}`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
createTicket(body: TicketForm) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/ticket/create`,
|
||||
method: "post",
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
updateTicket(id: number, body: TicketForm) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/ticket/update/${id}`,
|
||||
method: "put",
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
deleteTicket(body: number[]) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/ticket/delete`,
|
||||
method: "delete",
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
export default TicketAPI;
|
||||
|
||||
export interface TicketPageQuery extends PageQuery {
|
||||
title?: string;
|
||||
status?: string;
|
||||
priority?: string;
|
||||
start_time?: string;
|
||||
end_time?: string;
|
||||
}
|
||||
|
||||
export interface TicketTable {
|
||||
index?: number;
|
||||
id?: number;
|
||||
title?: string;
|
||||
priority?: string;
|
||||
type?: string;
|
||||
status?: string;
|
||||
description?: string;
|
||||
assignee?: creatorType;
|
||||
reporter?: creatorType;
|
||||
project?: string;
|
||||
version?: string;
|
||||
created_at?: string;
|
||||
updated_at?: string;
|
||||
creator?: creatorType;
|
||||
}
|
||||
|
||||
export interface TicketForm {
|
||||
id?: number;
|
||||
title: string;
|
||||
priority?: string;
|
||||
type?: string;
|
||||
status?: string;
|
||||
description?: string;
|
||||
assignee_id?: number;
|
||||
reporter_id: number;
|
||||
project?: string;
|
||||
version?: string;
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
const VersionAPI = {
|
||||
getVersionList(query: VersionPageQuery) {
|
||||
return request<ApiResponse<PageResult<VersionTable[]>>>({
|
||||
url: `/system/version/list`,
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
},
|
||||
|
||||
getVersionDetail(query: number) {
|
||||
return request<ApiResponse<VersionTable>>({
|
||||
url: `/system/version/detail/${query}`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
createVersion(body: VersionForm) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/version/create`,
|
||||
method: "post",
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
updateVersion(id: number, body: VersionForm) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/version/update/${id}`,
|
||||
method: "put",
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
deleteVersion(body: number[]) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/version/delete`,
|
||||
method: "delete",
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
export default VersionAPI;
|
||||
|
||||
export interface VersionPageQuery extends PageQuery {
|
||||
title?: string;
|
||||
status?: string;
|
||||
start_time?: string;
|
||||
end_time?: string;
|
||||
}
|
||||
|
||||
export interface VersionTable {
|
||||
index?: number;
|
||||
id?: number;
|
||||
version_number?: string;
|
||||
title?: string;
|
||||
release_notes?: string;
|
||||
project?: string;
|
||||
status?: string;
|
||||
released_at?: string;
|
||||
description?: string;
|
||||
created_at?: string;
|
||||
updated_at?: string;
|
||||
creator?: creatorType;
|
||||
}
|
||||
|
||||
export interface VersionForm {
|
||||
id?: number;
|
||||
version_number: string;
|
||||
title: string;
|
||||
release_notes?: string;
|
||||
project?: string;
|
||||
status?: string;
|
||||
released_at?: string;
|
||||
description?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user