Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zendata
提交
6a558d5f
Z
zendata
项目概览
易企天创
/
zendata
11 个月 前同步成功
通知
17
Star
2
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Z
zendata
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
6a558d5f
编写于
11月 19, 2020
作者:
aaronchen2k2k
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
task #8433
上级
929f3de7
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
49 addition
and
46 deletion
+49
-46
src/server/repo/def.go
src/server/repo/def.go
+2
-1
src/server/repo/instances.go
src/server/repo/instances.go
+5
-3
src/server/repo/ranges.go
src/server/repo/ranges.go
+5
-3
src/server/service/config.go
src/server/service/config.go
+7
-6
src/server/service/def.go
src/server/service/def.go
+3
-6
src/server/service/excel.go
src/server/service/excel.go
+7
-7
src/server/service/instances.go
src/server/service/instances.go
+7
-7
src/server/service/ranges.go
src/server/service/ranges.go
+7
-7
src/server/service/text.go
src/server/service/text.go
+6
-6
未找到文件。
src/server/repo/def.go
浏览文件 @
6a558d5f
...
...
@@ -34,9 +34,10 @@ func (r *DefRepo) Update(def *model.ZdDef) (err error) {
func
(
r
*
DefRepo
)
Remove
(
id
uint
)
(
err
error
)
{
var
def
model
.
ZdDef
def
.
ID
=
uint
(
id
)
def
.
ID
=
id
err
=
r
.
db
.
Delete
(
&
def
)
.
Error
err
=
r
.
db
.
Where
(
"defID = ?"
,
id
)
.
Delete
(
&
model
.
ZdField
{})
.
Error
return
}
...
...
src/server/repo/instances.go
浏览文件 @
6a558d5f
...
...
@@ -25,9 +25,11 @@ func (r *InstancesRepo) Save(model *model.ZdInstances) (err error) {
}
func
(
r
*
InstancesRepo
)
Remove
(
id
uint
)
(
err
error
)
{
model
:=
model
.
ZdInstances
{}
model
.
ID
=
id
err
=
r
.
db
.
Delete
(
model
)
.
Error
inst
:=
model
.
ZdInstances
{}
inst
.
ID
=
id
err
=
r
.
db
.
Delete
(
inst
)
.
Error
err
=
r
.
db
.
Where
(
"instancesID = ?"
,
id
)
.
Delete
(
&
model
.
ZdInstancesItem
{})
.
Error
return
}
...
...
src/server/repo/ranges.go
浏览文件 @
6a558d5f
...
...
@@ -25,9 +25,11 @@ func (r *RangesRepo) Save(ranges *model.ZdRanges) (err error) {
}
func
(
r
*
RangesRepo
)
Remove
(
id
uint
)
(
err
error
)
{
model
:=
model
.
ZdRanges
{}
model
.
ID
=
id
err
=
r
.
db
.
Delete
(
model
)
.
Error
ranges
:=
model
.
ZdRanges
{}
ranges
.
ID
=
id
err
=
r
.
db
.
Delete
(
ranges
)
.
Error
err
=
r
.
db
.
Where
(
"rangesID = ?"
,
id
)
.
Delete
(
&
model
.
ZdRangesItem
{})
.
Error
return
}
...
...
src/server/service/config.go
浏览文件 @
6a558d5f
...
...
@@ -3,8 +3,9 @@ package serverService
import
(
"github.com/easysoft/zendata/src/model"
"github.com/easysoft/zendata/src/server/repo"
logUtils
"github.com/easysoft/zendata/src/utils/log
"
fileUtils
"github.com/easysoft/zendata/src/utils/file
"
stringUtils
"github.com/easysoft/zendata/src/utils/string"
"github.com/jinzhu/gorm"
"gopkg.in/yaml.v3"
"io/ioutil"
)
...
...
@@ -37,14 +38,14 @@ func (s *ConfigService) Save(config *model.ZdConfig) (err error) {
}
func
(
s
*
ConfigService
)
Remove
(
id
int
)
(
err
error
)
{
err
=
s
.
configRepo
.
Remove
(
uint
(
id
))
if
err
!=
nil
{
var
old
model
.
ZdConfig
old
,
err
=
s
.
configRepo
.
Get
(
uint
(
id
))
if
err
==
gorm
.
ErrRecordNotFound
{
return
}
fileUtils
.
RemoveExist
(
old
.
Path
)
config
,
_
:=
s
.
configRepo
.
Get
(
uint
(
id
))
logUtils
.
PrintTo
(
config
.
Path
)
//fileUtils.RemoveExist(config.Path)
err
=
s
.
configRepo
.
Remove
(
uint
(
id
))
return
}
...
...
src/server/service/def.go
浏览文件 @
6a558d5f
...
...
@@ -74,16 +74,13 @@ func (s *DefService) Update(def *model.ZdDef) (err error) {
}
func
(
s
*
DefService
)
Remove
(
id
int
)
(
err
error
)
{
var
old
Def
model
.
ZdDef
old
Def
,
err
=
s
.
defRepo
.
Get
(
uint
(
id
))
var
old
model
.
ZdDef
old
,
err
=
s
.
defRepo
.
Get
(
uint
(
id
))
if
err
==
gorm
.
ErrRecordNotFound
{
return
}
fileUtils
.
RemoveExist
(
old
.
Path
)
fileUtils
.
RemoveExist
(
oldDef
.
Path
)
var
def
model
.
ZdDef
def
.
ID
=
uint
(
id
)
err
=
s
.
defRepo
.
Remove
(
uint
(
id
))
return
}
...
...
src/server/service/excel.go
浏览文件 @
6a558d5f
...
...
@@ -3,8 +3,9 @@ package serverService
import
(
"github.com/easysoft/zendata/src/model"
"github.com/easysoft/zendata/src/server/repo"
logUtils
"github.com/easysoft/zendata/src/utils/log
"
fileUtils
"github.com/easysoft/zendata/src/utils/file
"
stringUtils
"github.com/easysoft/zendata/src/utils/string"
"github.com/jinzhu/gorm"
)
type
ExcelService
struct
{
...
...
@@ -35,15 +36,14 @@ func (s *ExcelService) Save(excel *model.ZdExcel) (err error) {
}
func
(
s
*
ExcelService
)
Remove
(
id
int
)
(
err
error
)
{
err
=
s
.
excelRepo
.
Remove
(
uint
(
id
))
if
err
!=
nil
{
var
old
model
.
ZdExcel
old
,
err
=
s
.
excelRepo
.
Get
(
uint
(
id
))
if
err
==
gorm
.
ErrRecordNotFound
{
return
}
fileUtils
.
RemoveExist
(
old
.
Path
)
excel
,
_
:=
s
.
excelRepo
.
Get
(
uint
(
id
))
logUtils
.
PrintTo
(
excel
.
Path
)
//fileUtils.RemoveExist(excel.Path)
err
=
s
.
excelRepo
.
Remove
(
uint
(
id
))
return
}
...
...
src/server/service/instances.go
浏览文件 @
6a558d5f
...
...
@@ -4,8 +4,9 @@ import (
"github.com/easysoft/zendata/src/model"
"github.com/easysoft/zendata/src/server/repo"
constant
"github.com/easysoft/zendata/src/utils/const"
logUtils
"github.com/easysoft/zendata/src/utils/log
"
fileUtils
"github.com/easysoft/zendata/src/utils/file
"
stringUtils
"github.com/easysoft/zendata/src/utils/string"
"github.com/jinzhu/gorm"
"gopkg.in/yaml.v3"
"io/ioutil"
)
...
...
@@ -39,15 +40,14 @@ func (s *InstancesService) Save(instances *model.ZdInstances) (err error) {
}
func
(
s
*
InstancesService
)
Remove
(
id
int
)
(
err
error
)
{
err
=
s
.
instancesRepo
.
Remove
(
uint
(
id
))
if
err
!=
nil
{
var
old
model
.
ZdInstances
old
,
err
=
s
.
instancesRepo
.
Get
(
uint
(
id
))
if
err
==
gorm
.
ErrRecordNotFound
{
return
}
fileUtils
.
RemoveExist
(
old
.
Path
)
instances
,
_
:=
s
.
instancesRepo
.
Get
(
uint
(
id
))
logUtils
.
PrintTo
(
instances
.
Path
)
//fileUtils.RemoveExist(instances.Path)
err
=
s
.
instancesRepo
.
Remove
(
uint
(
id
))
return
}
...
...
src/server/service/ranges.go
浏览文件 @
6a558d5f
...
...
@@ -3,8 +3,9 @@ package serverService
import
(
"github.com/easysoft/zendata/src/model"
"github.com/easysoft/zendata/src/server/repo"
logUtils
"github.com/easysoft/zendata/src/utils/log
"
fileUtils
"github.com/easysoft/zendata/src/utils/file
"
stringUtils
"github.com/easysoft/zendata/src/utils/string"
"github.com/jinzhu/gorm"
"gopkg.in/yaml.v3"
"io/ioutil"
)
...
...
@@ -37,15 +38,14 @@ func (s *RangesService) Save(ranges *model.ZdRanges) (err error) {
}
func
(
s
*
RangesService
)
Remove
(
id
int
)
(
err
error
)
{
err
=
s
.
rangesRepo
.
Remove
(
uint
(
id
))
if
err
!=
nil
{
var
old
model
.
ZdRanges
old
,
err
=
s
.
rangesRepo
.
Get
(
uint
(
id
))
if
err
==
gorm
.
ErrRecordNotFound
{
return
}
fileUtils
.
RemoveExist
(
old
.
Path
)
ranges
,
_
:=
s
.
rangesRepo
.
Get
(
uint
(
id
))
logUtils
.
PrintTo
(
ranges
.
Path
)
//fileUtils.RemoveExist(ranges.Path)
err
=
s
.
rangesRepo
.
Remove
(
uint
(
id
))
return
}
...
...
src/server/service/text.go
浏览文件 @
6a558d5f
...
...
@@ -4,8 +4,8 @@ import (
"github.com/easysoft/zendata/src/model"
"github.com/easysoft/zendata/src/server/repo"
fileUtils
"github.com/easysoft/zendata/src/utils/file"
logUtils
"github.com/easysoft/zendata/src/utils/log"
stringUtils
"github.com/easysoft/zendata/src/utils/string"
"github.com/jinzhu/gorm"
)
type
TextService
struct
{
...
...
@@ -36,14 +36,14 @@ func (s *TextService) Save(text *model.ZdText) (err error) {
}
func
(
s
*
TextService
)
Remove
(
id
int
)
(
err
error
)
{
err
=
s
.
textRepo
.
Remove
(
uint
(
id
))
if
err
!=
nil
{
var
old
model
.
ZdText
old
,
err
=
s
.
textRepo
.
Get
(
uint
(
id
))
if
err
==
gorm
.
ErrRecordNotFound
{
return
}
fileUtils
.
RemoveExist
(
old
.
Path
)
text
,
_
:=
s
.
textRepo
.
Get
(
uint
(
id
))
logUtils
.
PrintTo
(
text
.
Path
)
//fileUtils.RemoveExist(text.Path)
err
=
s
.
textRepo
.
Remove
(
uint
(
id
))
return
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录