切换导航条
此项目
正在载入...
登录
allied-creation
/
performance
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
郑周
2 years ago
提交
34ccdfece00d84f77ac2c918bf9b33c6fff4bc50
1 个父辈
a1c34230
模板 增删改查 接口调试完成
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
13 行增加
和
8 行删除
pkg/application/evaluation_template/template_service.go
pkg/infrastructure/repository/pg_evaluation_template_repository.go
pkg/port/beego/controllers/evaluation_template_controller.go
pkg/application/evaluation_template/template_service.go
查看文件 @
34ccdfe
...
...
@@ -188,8 +188,14 @@ func (rs *EvaluationTemplateService) List(in *command.QueryTemplateCommand) (int
defer
func
()
{
transactionContext
.
RollbackTransaction
()
}()
queryOptions
:=
tool_funs
.
SimpleStructToMap
(
in
)
if
in
.
CreatedAt
==
nil
{
delete
(
queryOptions
,
"createdAt"
)
// 删除创建时间
}
templateRepository
:=
factory
.
CreateEvaluationTemplateRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
})
total
,
templates
,
err
:=
templateRepository
.
Find
(
tool_funs
.
SimpleStructToMap
(
in
),
"linkN
odes"
)
total
,
templates
,
err
:=
templateRepository
.
Find
(
queryOptions
,
"link_n
odes"
)
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
...
...
pkg/infrastructure/repository/pg_evaluation_template_repository.go
查看文件 @
34ccdfe
...
...
@@ -142,7 +142,12 @@ func (repo *EvaluationTemplateRepository) Find(queryOptions map[string]interface
}
if
v
,
ok
:=
queryOptions
[
"createdAt"
];
ok
{
query
.
Where
(
"created_at = ?"
,
v
)
t
:=
v
.
(
*
time
.
Time
)
year
,
month
,
day
:=
t
.
Date
()
begin
:=
time
.
Date
(
year
,
month
,
day
,
0
,
0
,
0
,
0
,
time
.
Local
)
end
:=
time
.
Date
(
year
,
month
,
day
,
23
,
59
,
59
,
0
,
time
.
Local
)
query
.
Where
(
"created_at >= ?"
,
begin
)
query
.
Where
(
"created_at <= ?"
,
end
)
}
if
v
,
ok
:=
queryOptions
[
"limit"
]
.
(
int
);
ok
{
...
...
pkg/port/beego/controllers/evaluation_template_controller.go
查看文件 @
34ccdfe
...
...
@@ -22,8 +22,6 @@ func (controller *TemplateController) CreateTemplate() {
ua
:=
middlewares
.
GetUser
(
controller
.
Ctx
)
in
.
CompanyId
=
ua
.
CompanyId
in
.
CreatorId
=
ua
.
UserId
//in.CompanyId = middlewares.GetCompanyId(controller.Ctx)
//in.CreatorId = middlewares.GetUserId(controller.Ctx)
controller
.
Response
(
ruService
.
Create
(
in
))
}
}
...
...
@@ -36,7 +34,6 @@ func (controller *TemplateController) UpdateTemplate() {
}
else
{
ua
:=
middlewares
.
GetUser
(
controller
.
Ctx
)
in
.
CompanyId
=
ua
.
CompanyId
//in.CompanyId = middlewares.GetCompanyId(controller.Ctx)
controller
.
Response
(
ruService
.
Update
(
in
))
}
}
...
...
@@ -74,7 +71,6 @@ func (controller *TemplateController) ListTemplate() {
}
ua
:=
middlewares
.
GetUser
(
controller
.
Ctx
)
in
.
CompanyId
=
ua
.
CompanyId
//in.CompanyId = middlewares.GetCompanyId(controller.Ctx)
controller
.
Response
(
ruService
.
List
(
in
))
}
}
...
...
@@ -90,7 +86,6 @@ func (controller *TemplateController) ListEnableTemplate() {
}
else
{
ua
:=
middlewares
.
GetUser
(
controller
.
Ctx
)
in
.
CompanyId
=
ua
.
CompanyId
//in.CompanyId = middlewares.GetCompanyId(controller.Ctx)
controller
.
Response
(
ruService
.
List
(
in
))
}
}
...
...
@@ -103,7 +98,6 @@ func (controller *TemplateController) StateTemplate() {
}
else
{
ua
:=
middlewares
.
GetUser
(
controller
.
Ctx
)
in
.
CompanyId
=
ua
.
CompanyId
//in.CompanyId = middlewares.GetCompanyId(controller.Ctx)
controller
.
Response
(
ruService
.
State
(
in
))
}
}
...
...
请
注册
或
登录
后发表评论