提交 | 用户 | 时间
|
820397
|
1 |
import request from '@/config/axios' |
H |
2 |
|
|
3 |
export type CodegenTableVO = { |
|
4 |
id: number |
|
5 |
tableId: number |
|
6 |
isParentMenuIdValid: boolean |
|
7 |
dataSourceConfigId: number |
|
8 |
scene: number |
|
9 |
tableName: string |
|
10 |
tableComment: string |
|
11 |
remark: string |
|
12 |
moduleName: string |
|
13 |
businessName: string |
|
14 |
className: string |
|
15 |
classComment: string |
|
16 |
author: string |
|
17 |
createTime: Date |
|
18 |
updateTime: Date |
|
19 |
templateType: number |
|
20 |
parentMenuId: number |
|
21 |
} |
|
22 |
|
|
23 |
export type CodegenColumnVO = { |
|
24 |
id: number |
|
25 |
tableId: number |
|
26 |
columnName: string |
|
27 |
dataType: string |
|
28 |
columnComment: string |
|
29 |
nullable: number |
|
30 |
primaryKey: number |
|
31 |
ordinalPosition: number |
|
32 |
javaType: string |
|
33 |
javaField: string |
|
34 |
dictType: string |
|
35 |
example: string |
|
36 |
createOperation: number |
|
37 |
updateOperation: number |
|
38 |
listOperation: number |
|
39 |
listOperationCondition: string |
|
40 |
listOperationResult: number |
|
41 |
htmlType: string |
|
42 |
} |
|
43 |
|
|
44 |
export type DatabaseTableVO = { |
|
45 |
name: string |
|
46 |
comment: string |
|
47 |
} |
|
48 |
|
|
49 |
export type CodegenDetailVO = { |
|
50 |
table: CodegenTableVO |
|
51 |
columns: CodegenColumnVO[] |
|
52 |
} |
|
53 |
|
|
54 |
export type CodegenPreviewVO = { |
|
55 |
filePath: string |
|
56 |
code: string |
|
57 |
} |
|
58 |
|
|
59 |
export type CodegenUpdateReqVO = { |
|
60 |
table: CodegenTableVO | any |
|
61 |
columns: CodegenColumnVO[] |
|
62 |
} |
|
63 |
|
|
64 |
export type CodegenCreateListReqVO = { |
|
65 |
dataSourceConfigId: number |
|
66 |
tableNames: string[] |
|
67 |
} |
|
68 |
|
|
69 |
// 查询列表代码生成表定义 |
|
70 |
export const getCodegenTableList = (dataSourceConfigId: number) => { |
|
71 |
return request.get({ url: '/infra/codegen/table/list?dataSourceConfigId=' + dataSourceConfigId }) |
|
72 |
} |
|
73 |
|
|
74 |
// 查询列表代码生成表定义 |
|
75 |
export const getCodegenTablePage = (params: PageParam) => { |
|
76 |
return request.get({ url: '/infra/codegen/table/page', params }) |
|
77 |
} |
|
78 |
|
|
79 |
// 查询详情代码生成表定义 |
|
80 |
export const getCodegenTable = (id: number) => { |
|
81 |
return request.get({ url: '/infra/codegen/detail?tableId=' + id }) |
|
82 |
} |
|
83 |
|
|
84 |
// 新增代码生成表定义 |
|
85 |
export const createCodegenTable = (data: CodegenCreateListReqVO) => { |
|
86 |
return request.post({ url: '/infra/codegen/create', data }) |
|
87 |
} |
|
88 |
|
|
89 |
// 修改代码生成表定义 |
|
90 |
export const updateCodegenTable = (data: CodegenUpdateReqVO) => { |
|
91 |
return request.put({ url: '/infra/codegen/update', data }) |
|
92 |
} |
|
93 |
|
|
94 |
// 基于数据库的表结构,同步数据库的表和字段定义 |
|
95 |
export const syncCodegenFromDB = (id: number) => { |
|
96 |
return request.put({ url: '/infra/codegen/sync-from-db?tableId=' + id }) |
|
97 |
} |
|
98 |
|
|
99 |
// 预览生成代码 |
|
100 |
export const previewCodegen = (id: number) => { |
|
101 |
return request.get({ url: '/infra/codegen/preview?tableId=' + id }) |
|
102 |
} |
|
103 |
|
|
104 |
// 下载生成代码 |
|
105 |
export const downloadCodegen = (id: number) => { |
|
106 |
return request.download({ url: '/infra/codegen/download?tableId=' + id }) |
|
107 |
} |
|
108 |
|
|
109 |
// 获得表定义 |
|
110 |
export const getSchemaTableList = (params) => { |
|
111 |
return request.get({ url: '/infra/codegen/db/table/list', params }) |
|
112 |
} |
|
113 |
|
|
114 |
// 基于数据库的表结构,创建代码生成器的表定义 |
|
115 |
export const createCodegenList = (data) => { |
|
116 |
return request.post({ url: '/infra/codegen/create-list', data }) |
|
117 |
} |
|
118 |
|
|
119 |
// 删除代码生成表定义 |
|
120 |
export const deleteCodegenTable = (id: number) => { |
|
121 |
return request.delete({ url: '/infra/codegen/delete?tableId=' + id }) |
|
122 |
} |