Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
飞一样的人
gin-vue-admin
提交
90f3eddc
G
gin-vue-admin
项目概览
飞一样的人
/
gin-vue-admin
与 Fork 源项目一致
Fork自
FLIPPED-AURORA / gin-vue-admin
通知
1
Star
1
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,发现更多精彩内容 >>
提交
90f3eddc
编写于
7月 13, 2021
作者:
S
songzhibin97
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat:完善前后端回滚交互信息交换
上级
b676ea58
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
14 addition
and
6 deletion
+14
-6
server/model/sys_autocode_history.go
server/model/sys_autocode_history.go
+6
-4
server/service/sys_auto_code.go
server/service/sys_auto_code.go
+4
-0
server/service/sys_autocode_history.go
server/service/sys_autocode_history.go
+4
-2
未找到文件。
server/model/sys_autocode_history.go
浏览文件 @
90f3eddc
...
...
@@ -7,10 +7,12 @@ import "gin-vue-admin/global"
type
SysAutoCodeHistory
struct
{
global
.
GVA_MODEL
TableName
string
`json:"tableName"`
RequestMeta
string
`gorm:"type:text" json:"requestMeta,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表注册内容
RequestMeta
string
`gorm:"type:text" json:"requestMeta,omitempty"`
// 前端传入的结构化信息
AutoCodePath
string
`gorm:"type:text" json:"autoCodePath,omitempty"`
// 其他meta信息 path;path
InjectionMeta
string
`gorm:"type:text" json:"injectionMeta,omitempty"`
// 注入的内容 RouterPath@functionName@RouterString;
StructName
string
`json:"structName"`
StructCNName
string
`json:"structCNName"`
ApiIDs
string
`json:"apiIDs,omitempty"`
// api表注册内容
Flag
int
// 表示对应状态 0 代表创建, 1 代表回滚 ...
}
server/service/sys_auto_code.go
浏览文件 @
90f3eddc
...
...
@@ -185,6 +185,8 @@ func CreateTemp(autoCode model.AutoCodeStruct, ids ...uint) (err error) {
if
autoCode
.
TableName
!=
""
{
err
=
CreateAutoCodeHistory
(
string
(
meta
),
autoCode
.
StructName
,
autoCode
.
Description
,
bf
.
String
(),
injectionCodeMeta
.
String
(),
autoCode
.
TableName
,
...
...
@@ -193,6 +195,8 @@ func CreateTemp(autoCode model.AutoCodeStruct, ids ...uint) (err error) {
}
else
{
err
=
CreateAutoCodeHistory
(
string
(
meta
),
autoCode
.
StructName
,
autoCode
.
Description
,
bf
.
String
(),
injectionCodeMeta
.
String
(),
autoCode
.
StructName
,
...
...
server/service/sys_autocode_history.go
浏览文件 @
90f3eddc
...
...
@@ -11,11 +11,13 @@ import (
)
// CreateAutoCodeHistory RouterPath : RouterPath@RouterString;RouterPath2@RouterString2
func
CreateAutoCodeHistory
(
meta
,
autoCodePath
string
,
injectionMeta
string
,
tableName
string
,
apiIds
string
)
error
{
func
CreateAutoCodeHistory
(
meta
,
structName
,
structCNName
,
autoCodePath
string
,
injectionMeta
string
,
tableName
string
,
apiIds
string
)
error
{
return
global
.
GVA_DB
.
Create
(
&
model
.
SysAutoCodeHistory
{
RequestMeta
:
meta
,
AutoCodePath
:
autoCodePath
,
InjectionMeta
:
injectionMeta
,
StructName
:
structName
,
StructCNName
:
structCNName
,
TableName
:
tableName
,
ApiIDs
:
apiIds
,
})
.
Error
...
...
@@ -74,6 +76,6 @@ func GetSysHistoryPage(info request.PageInfo) (err error, list interface{}, tota
db
:=
global
.
GVA_DB
var
fileLists
[]
model
.
SysAutoCodeHistory
err
=
db
.
Find
(
&
fileLists
)
.
Count
(
&
total
)
.
Error
err
=
db
.
Limit
(
limit
)
.
Offset
(
offset
)
.
Order
(
"updated_at desc"
)
.
Select
(
"id,created_at,updated_at,
table_name,auto_code_path,injection_meta,api_ids
,flag"
)
.
Find
(
&
fileLists
)
.
Error
err
=
db
.
Limit
(
limit
)
.
Offset
(
offset
)
.
Order
(
"updated_at desc"
)
.
Select
(
"id,created_at,updated_at,
struct_name,struct_cn_name
,flag"
)
.
Find
(
&
fileLists
)
.
Error
return
err
,
fileLists
,
total
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录