切换导航条
此项目
正在载入...
登录
allied-creation
/
performance
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
tangxvhui
2 years ago
提交
24b2079107d3fe8327e6b37698c28f4f3da403c7
1 个父辈
662e31d3
添加路由
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
102 行增加
和
2 行删除
pkg/application/summary_evaluation/service/service.go
pkg/port/beego/controllers/summary_evaluation_controller.go
pkg/port/beego/routers/summary_evaluation_router.go
pkg/application/summary_evaluation/service/service.go
查看文件 @
24b2079
...
...
@@ -16,7 +16,7 @@ import (
type
SummaryEvaluationServeice
struct
{
}
func
NewS
taffAssess
Serveice
()
*
SummaryEvaluationServeice
{
func
NewS
ummaryEvaluation
Serveice
()
*
SummaryEvaluationServeice
{
newService
:=
&
SummaryEvaluationServeice
{}
return
newService
}
...
...
@@ -411,7 +411,6 @@ func (srv *SummaryEvaluationServeice) EditEvaluationSelf(param *command.EditEval
mValue
.
Id
=
v
.
Id
}
}
nowTime
:=
time
.
Now
()
for
_
,
v
:=
range
param
.
EvaluationItems
{
updatedData
,
ok
:=
evaluationValueMap
[
v
.
EvaluationItemId
]
...
...
@@ -437,3 +436,5 @@ func (srv *SummaryEvaluationServeice) EditEvaluationSelf(param *command.EditEval
"EvaluationItems"
:
itemValueAdapter
,
},
nil
}
//
...
...
pkg/port/beego/controllers/summary_evaluation_controller.go
0 → 100644
查看文件 @
24b2079
package
controllers
import
(
"github.com/linmadan/egglib-go/core/application"
"github.com/linmadan/egglib-go/web/beego"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/summary_evaluation/command"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/summary_evaluation/service"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/port/beego/middlewares"
)
type
SummaryEvaluationController
struct
{
beego
.
BaseController
}
func
(
c
*
SummaryEvaluationController
)
GetCycleList
()
{
srv
:=
service
.
NewSummaryEvaluationServeice
()
paramReq
:=
&
command
.
QueryCycleList
{}
err
:=
c
.
BindJSON
(
paramReq
)
if
err
!=
nil
{
e
:=
application
.
ThrowError
(
application
.
ARG_ERROR
,
"json 解析错误"
+
err
.
Error
())
c
.
Response
(
nil
,
e
)
return
}
userReq
:=
middlewares
.
GetUser
(
c
.
Ctx
)
paramReq
.
UserId
=
int
(
userReq
.
UserId
)
data
,
err
:=
srv
.
GetCycleList
(
paramReq
)
c
.
Response
(
data
,
err
)
}
func
(
c
*
SummaryEvaluationController
)
GetMenu
()
{
srv
:=
service
.
NewSummaryEvaluationServeice
()
paramReq
:=
&
command
.
QueryMenu
{}
err
:=
c
.
BindJSON
(
paramReq
)
if
err
!=
nil
{
e
:=
application
.
ThrowError
(
application
.
ARG_ERROR
,
"json 解析错误"
+
err
.
Error
())
c
.
Response
(
nil
,
e
)
return
}
userReq
:=
middlewares
.
GetUser
(
c
.
Ctx
)
paramReq
.
CompanyId
=
int
(
userReq
.
CompanyId
)
paramReq
.
UserId
=
int
(
userReq
.
UserId
)
data
,
err
:=
srv
.
GetMenu
(
paramReq
)
c
.
Response
(
data
,
err
)
}
func
(
c
*
SummaryEvaluationController
)
GetEvaluationSelf
()
{
srv
:=
service
.
NewSummaryEvaluationServeice
()
paramReq
:=
&
command
.
QueryEvaluationInfo
{}
err
:=
c
.
BindJSON
(
paramReq
)
if
err
!=
nil
{
e
:=
application
.
ThrowError
(
application
.
ARG_ERROR
,
"json 解析错误"
+
err
.
Error
())
c
.
Response
(
nil
,
e
)
return
}
userReq
:=
middlewares
.
GetUser
(
c
.
Ctx
)
paramReq
.
CompanyId
=
int
(
userReq
.
CompanyId
)
paramReq
.
ExecutorId
=
int
(
userReq
.
UserId
)
data
,
err
:=
srv
.
GetEvaluationSelf
(
paramReq
)
c
.
Response
(
data
,
err
)
}
func
(
c
*
SummaryEvaluationController
)
EditEvaluationSelf
()
{
srv
:=
service
.
NewSummaryEvaluationServeice
()
paramReq
:=
&
command
.
EditEvaluationValue
{}
err
:=
c
.
BindJSON
(
paramReq
)
if
err
!=
nil
{
e
:=
application
.
ThrowError
(
application
.
ARG_ERROR
,
"json 解析错误"
+
err
.
Error
())
c
.
Response
(
nil
,
e
)
return
}
userReq
:=
middlewares
.
GetUser
(
c
.
Ctx
)
paramReq
.
CompanyId
=
int
(
userReq
.
CompanyId
)
paramReq
.
ExecutorId
=
int
(
userReq
.
UserId
)
data
,
err
:=
srv
.
EditEvaluationSelf
(
paramReq
)
c
.
Response
(
data
,
err
)
}
...
...
pkg/port/beego/routers/summary_evaluation_router.go
0 → 100644
查看文件 @
24b2079
package
routers
import
(
"github.com/beego/beego/v2/server/web"
"github.com/linmadan/egglib-go/web/beego/filters"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/port/beego/controllers"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/port/beego/middlewares"
)
func
init
()
{
summaryNS
:=
web
.
NewNamespace
(
"/v1/summary-evaluation"
,
web
.
NSBefore
(
filters
.
AllowCors
(),
middlewares
.
CheckFontToken
()),
web
.
NSCtrlPost
(
"/cycle/list"
,
(
*
controllers
.
SummaryEvaluationController
)
.
GetCycleList
),
web
.
NSCtrlPost
(
"/cycle/menu"
,
(
*
controllers
.
SummaryEvaluationController
)
.
GetMenu
),
web
.
NSCtrlPost
(
"/self"
,
(
*
controllers
.
SummaryEvaluationController
)
.
GetEvaluationSelf
),
web
.
NSCtrlPost
(
"/self/edit"
,
(
*
controllers
.
SummaryEvaluationController
)
.
EditEvaluationSelf
),
)
web
.
AddNamespace
(
summaryNS
)
}
...
...
请
注册
或
登录
后发表评论