切换导航条
此项目
正在载入...
登录
allied-creation
/
performance
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
差异文件
浏览文件
作者
Administrator
about a year ago
提交
19099335eabc667716f9f41018d773b5ce686f73
2 个父辈
30fd0858
6ae2dec3
合并分支 'test' 到 'master'
模板导入权重精度 查看合并请求
!15
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
2 行增加
和
0 行删除
pkg/application/evaluation_template/command/template_update.go
pkg/application/evaluation_template/command/template_update.go
查看文件 @
1909933
...
...
@@ -5,6 +5,7 @@ import (
"github.com/beego/beego/v2/core/validation"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/utils"
"math"
)
type
UpdateTemplateCommand
struct
{
...
...
@@ -34,6 +35,7 @@ func (in *UpdateTemplateCommand) Valid(validation *validation.Validation) {
for
i2
:=
range
linkNode
.
NodeContents
{
weightTotal
+=
linkNode
.
NodeContents
[
i2
]
.
Weight
}
weightTotal
=
math
.
Round
(
weightTotal
*
100
)
/
100
if
weightTotal
!=
100
{
formatWeightTotal
:=
utils
.
FormatFloatDecimal
(
weightTotal
,
2
)
validation
.
SetError
(
"linkNodes"
,
fmt
.
Sprintf
(
"总权重值错误,当前%s的总权重值为:%s%%(必须等于100%%)"
,
linkNode
.
Name
,
formatWeightTotal
))
...
...
请
注册
或
登录
后发表评论