Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
pleasure
gin-vue-admin
提交
b676ea58
G
gin-vue-admin
项目概览
pleasure
/
gin-vue-admin
与 Fork 源项目一致
Fork自
FLIPPED-AURORA / gin-vue-admin
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gin-vue-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b676ea58
编写于
7月 13, 2021
作者:
Mr.奇淼(
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加自动化代码管理页面
上级
177b55e3
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
119 addition
and
5 deletion
+119
-5
server/model/sys_autocode_history.go
server/model/sys_autocode_history.go
+5
-5
server/source/api.go
server/source/api.go
+3
-0
server/source/authorities_menus.go
server/source/authorities_menus.go
+1
-0
server/source/casbin.go
server/source/casbin.go
+3
-0
server/source/menu.go
server/source/menu.go
+1
-0
web/src/api/autoCode.js
web/src/api/autoCode.js
+8
-0
web/src/view/systemTools/autoCodeAdmin/index.vue
web/src/view/systemTools/autoCodeAdmin/index.vue
+98
-0
未找到文件。
server/model/sys_autocode_history.go
浏览文件 @
b676ea58
...
...
@@ -6,11 +6,11 @@ import "gin-vue-admin/global"
type
SysAutoCodeHistory
struct
{
global
.
GVA_MODEL
TableName
string
RequestMeta
string
`gorm:"type:text" json:"request
_m
eta,omitempty"`
// 前端传入的结构化信息
AutoCodePath
string
`gorm:"type:text"
`
// 其他meta信息 path;path
InjectionMeta
string
`gorm:"type:text"
`
// 注入的内容 RouterPath@functionName@RouterString;
ApiIDs
string
// api表注册内容
TableName
string
`json:"tableName"`
RequestMeta
string
`gorm:"type:text" json:"request
M
eta,omitempty"`
// 前端传入的结构化信息
AutoCodePath
string
`gorm:"type:text"
json:"autoCodePath"`
// 其他meta信息 path;path
InjectionMeta
string
`gorm:"type:text"
json:"injectionMeta"`
// 注入的内容 RouterPath@functionName@RouterString;
ApiIDs
string
`json:"apiIDs"`
// api表注册内容
Flag
int
// 表示对应状态 0 代表创建, 1 代表回滚 ...
}
server/source/api.go
浏览文件 @
b676ea58
...
...
@@ -86,6 +86,9 @@ var apis = []model.SysApi{
{
global
.
GVA_MODEL
{
ID
:
83
,
CreatedAt
:
time
.
Now
(),
UpdatedAt
:
time
.
Now
()},
"/excel/exportExcel"
,
"导出excel"
,
"excel"
,
"POST"
},
{
global
.
GVA_MODEL
{
ID
:
84
,
CreatedAt
:
time
.
Now
(),
UpdatedAt
:
time
.
Now
()},
"/excel/downloadTemplate"
,
"下载excel模板"
,
"excel"
,
"GET"
},
{
global
.
GVA_MODEL
{
ID
:
85
,
CreatedAt
:
time
.
Now
(),
UpdatedAt
:
time
.
Now
()},
"/api/deleteApisByIds"
,
"批量删除api"
,
"api"
,
"DELETE"
},
{
global
.
GVA_MODEL
{
ID
:
86
,
CreatedAt
:
time
.
Now
(),
UpdatedAt
:
time
.
Now
()},
"/autoCode/getSysHistory"
,
"查询回滚记录"
,
"autoCode"
,
"POST"
},
{
global
.
GVA_MODEL
{
ID
:
87
,
CreatedAt
:
time
.
Now
(),
UpdatedAt
:
time
.
Now
()},
"/autoCode/rollback"
,
"回滚自动生成代码"
,
"autoCode"
,
"POST"
},
{
global
.
GVA_MODEL
{
ID
:
88
,
CreatedAt
:
time
.
Now
(),
UpdatedAt
:
time
.
Now
()},
"/autoCode/getMeta"
,
"获取meta信息"
,
"autoCode"
,
"POST"
},
}
//@author: [SliverHorn](https://github.com/SliverHorn)
...
...
server/source/authorities_menus.go
浏览文件 @
b676ea58
...
...
@@ -39,6 +39,7 @@ var authorityMenus = []AuthorityMenus{
{
"888"
,
21
},
{
"888"
,
22
},
{
"888"
,
23
},
{
"888"
,
24
},
{
"8881"
,
1
},
{
"8881"
,
2
},
{
"8881"
,
8
},
...
...
server/source/casbin.go
浏览文件 @
b676ea58
...
...
@@ -86,6 +86,9 @@ var carbines = []gormadapter.CasbinRule{
{
PType
:
"p"
,
V0
:
"888"
,
V1
:
"/excel/exportExcel"
,
V2
:
"POST"
},
{
PType
:
"p"
,
V0
:
"888"
,
V1
:
"/excel/downloadTemplate"
,
V2
:
"GET"
},
{
PType
:
"p"
,
V0
:
"888"
,
V1
:
"/api/deleteApisByIds"
,
V2
:
"DELETE"
},
{
PType
:
"p"
,
V0
:
"888"
,
V1
:
"/autoCode/getSysHistory"
,
V2
:
"POST"
},
{
PType
:
"p"
,
V0
:
"888"
,
V1
:
"/autoCode/rollback"
,
V2
:
"POST"
},
{
PType
:
"p"
,
V0
:
"888"
,
V1
:
"/autoCode/getMeta"
,
V2
:
"POST"
},
{
PType
:
"p"
,
V0
:
"8881"
,
V1
:
"/base/login"
,
V2
:
"POST"
},
{
PType
:
"p"
,
V0
:
"8881"
,
V1
:
"/user/register"
,
V2
:
"POST"
},
{
PType
:
"p"
,
V0
:
"8881"
,
V1
:
"/api/createApi"
,
V2
:
"POST"
},
...
...
server/source/menu.go
浏览文件 @
b676ea58
...
...
@@ -37,6 +37,7 @@ var menus = []model.SysBaseMenu{
{
GVA_MODEL
:
global
.
GVA_MODEL
{
ID
:
21
,
CreatedAt
:
time
.
Now
(),
UpdatedAt
:
time
.
Now
()},
MenuLevel
:
0
,
Hidden
:
false
,
ParentId
:
"9"
,
Path
:
"simpleUploader"
,
Name
:
"simpleUploader"
,
Component
:
"view/example/simpleUploader/simpleUploader"
,
Sort
:
6
,
Meta
:
model
.
Meta
{
Title
:
"断点续传(插件版)"
,
Icon
:
"upload"
}},
{
GVA_MODEL
:
global
.
GVA_MODEL
{
ID
:
22
,
CreatedAt
:
time
.
Now
(),
UpdatedAt
:
time
.
Now
()},
MenuLevel
:
0
,
ParentId
:
"0"
,
Path
:
"https://www.gin-vue-admin.com"
,
Name
:
"https://www.gin-vue-admin.com"
,
Hidden
:
false
,
Component
:
"/"
,
Sort
:
0
,
Meta
:
model
.
Meta
{
Title
:
"官方网站"
,
Icon
:
"s-home"
}},
{
GVA_MODEL
:
global
.
GVA_MODEL
{
ID
:
23
,
CreatedAt
:
time
.
Now
(),
UpdatedAt
:
time
.
Now
()},
MenuLevel
:
0
,
ParentId
:
"0"
,
Path
:
"state"
,
Name
:
"state"
,
Hidden
:
false
,
Component
:
"view/system/state.vue"
,
Sort
:
6
,
Meta
:
model
.
Meta
{
Title
:
"服务器状态"
,
Icon
:
"cloudy"
}},
{
GVA_MODEL
:
global
.
GVA_MODEL
{
ID
:
24
,
CreatedAt
:
time
.
Now
(),
UpdatedAt
:
time
.
Now
()},
MenuLevel
:
0
,
ParentId
:
"14"
,
Path
:
"autoCodeAdmin"
,
Name
:
"autoCodeAdmin"
,
Hidden
:
false
,
Component
:
"view/systemTools/autoCodeAdmin/index.vue"
,
Sort
:
1
,
Meta
:
model
.
Meta
{
Title
:
"自动化代码管理"
,
Icon
:
"s-finance"
}},
}
//@author: [SliverHorn](https://github.com/SliverHorn)
...
...
web/src/api/autoCode.js
浏览文件 @
b676ea58
...
...
@@ -60,3 +60,11 @@ export const getColumn = (params) => {
params
})
}
export
const
getSysHistory
=
(
data
)
=>
{
return
service
({
url
:
'
/autoCode/getSysHistory
'
,
method
:
'
post
'
,
data
})
}
web/src/view/systemTools/autoCodeAdmin/index.vue
0 → 100644
浏览文件 @
b676ea58
<
template
>
<div>
<div
class=
"search-term"
>
<el-form
:inline=
"true"
:model=
"searchInfo"
class=
"demo-form-inline"
>
<el-form-item
label=
"表名"
>
<el-input
v-model=
"searchInfo.tableName"
placeholder=
"表名"
/>
</el-form-item>
<el-form-item
label=
"结构体名称"
>
<el-input
v-model=
"searchInfo.tableName"
placeholder=
"结构体名称"
/>
</el-form-item>
<el-form-item>
<el-button
size=
"mini"
type=
"primary"
icon=
"el-icon-plus"
@
click=
"goAutoCode"
>
新增
</el-button>
</el-form-item>
</el-form>
</div>
<el-table
:data=
"tableData"
border
stripe
>
<el-table-column
type=
"selection"
width=
"55"
/>
<el-table-column
label=
"id"
width=
"60"
prop=
"ID"
/>
<el-table-column
label=
"日期"
width=
"180"
>
<template
slot-scope=
"scope"
>
{{
scope
.
row
.
CreatedAt
|
formatDate
}}
</
template
>
</el-table-column>
<el-table-column
label=
"结构体名"
min-width=
"150"
prop=
"tableName"
/>
<el-table-column
label=
"表名称"
min-width=
"150"
prop=
"tableName"
/>
</el-table>
<el-pagination
:current-page=
"page"
:page-size=
"pageSize"
:page-sizes=
"[10, 30, 50, 100]"
:style=
"{float:'right',padding:'20px'}"
:total=
"total"
layout=
"total, sizes, prev, pager, next, jumper"
@
current-change=
"handleCurrentChange"
@
size-change=
"handleSizeChange"
/>
</div>
</template>
<
script
>
// 获取列表内容封装在mixins内部 getTableData方法 初始化已封装完成 条件搜索时候 请把条件安好后台定制的结构体字段 放到 this.searchInfo 中即可实现条件搜索
import
{
getSysHistory
}
from
'
@/api/autoCode.js
'
import
{
formatTimeToStr
}
from
'
@/utils/date
'
import
infoList
from
'
@/mixins/infoList
'
export
default
{
name
:
'
Api
'
,
filters
:
{
formatDate
:
function
(
time
)
{
if
(
time
!==
null
&&
time
!==
''
)
{
var
date
=
new
Date
(
time
)
return
formatTimeToStr
(
date
,
'
yyyy-MM-dd hh:mm:ss
'
)
}
else
{
return
''
}
},
formatBoolean
:
function
(
bool
)
{
if
(
bool
!==
null
)
{
return
bool
?
'
是
'
:
'
否
'
}
else
{
return
''
}
}
},
mixins
:
[
infoList
],
data
()
{
return
{
listApi
:
getSysHistory
}
},
created
()
{
this
.
getTableData
()
},
methods
:
{
goAutoCode
()
{
this
.
$router
.
push
({
name
:
'
autoCode
'
})
}
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
.button-box
{
padding
:
10px
20px
;
.el-button
{
float
:
right
;
}
}
.el-tag--mini
{
margin-left
:
5px
;
}
.warning
{
color
:
#dc143c
;
}
</
style
>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录