...
|
...
|
@@ -10,17 +10,17 @@ type UpdateProjectCommand struct { |
|
|
CycleId int64 `cname:"周期ID" json:"cycleId,string" valid:"Required"`
|
|
|
Id int64 `cname:"项目ID" json:"id,string" valid:"Required"`
|
|
|
Name string `cname:"项目名称" json:"name" valid:"Required"`
|
|
|
Describe string `cname:"项目描述" json:"describe" valid:"Required"`
|
|
|
Describe string `cname:"项目描述" json:"describe"`
|
|
|
HrBp int `cname:"HR角色权限" json:"hrBp"`
|
|
|
Pmp int `cname:"PM角色权限" json:"pmp"`
|
|
|
PmpIds []string `cname:"项目管理员ID" json:"pms"`
|
|
|
PmpIds []string `cname:"项目管理员ID" json:"pmpIds"`
|
|
|
}
|
|
|
|
|
|
type UpdateProjectTemplateCommand struct {
|
|
|
CompanyId int64 `cname:"公司ID" json:"companyId"`
|
|
|
CycleId int64 `cname:"周期ID" json:"cycleId,string" valid:"Required"`
|
|
|
Id int64 `cname:"项目ID" json:"id,string" valid:"Required"`
|
|
|
TemplateId int64 `cname:"评估模板ID" json:"templateId,string"`
|
|
|
TemplateId int64 `cname:"模板ID" json:"templateId,string"`
|
|
|
Recipients []string `cname:"被评估人ID" json:"recipients"`
|
|
|
}
|
|
|
|
...
|
...
|
@@ -28,14 +28,14 @@ type UpdateProjectTemplateNodeCommand struct { |
|
|
CompanyId int64 `cname:"公司ID" json:"companyId"`
|
|
|
CycleId int64 `cname:"周期ID" json:"cycleId,string" valid:"Required"`
|
|
|
Id int64 `cname:"项目ID" json:"id,string" valid:"Required"`
|
|
|
TemplateId int64 `cname:"评估模板ID" json:"templateId,string"`
|
|
|
TemplateId int64 `cname:"模板ID" json:"templateId,string" valid:"Required"`
|
|
|
LinkNodes []*domain.LinkNode `cname:"评估流程" json:"linkNodes"`
|
|
|
Activate int `cname:"启动项目" json:"activate"`
|
|
|
}
|
|
|
|
|
|
func (in *UpdateProjectCommand) Valid(validation *validation.Validation) {
|
|
|
if len(in.Name) > 40 {
|
|
|
validation.SetError("name", "角色名称最大长度40个字符")
|
|
|
validation.SetError("name", "项目名称最大长度40个字符")
|
|
|
return
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -46,3 +46,10 @@ func (in *UpdateProjectTemplateCommand) Valid(validation *validation.Validation) |
|
|
return
|
|
|
}
|
|
|
}
|
|
|
|
|
|
func (in *UpdateProjectTemplateNodeCommand) Valid(validation *validation.Validation) {
|
|
|
if len(in.LinkNodes) == 0 {
|
|
|
validation.SetError("linkNodes", "请添加评估流程")
|
|
|
return
|
|
|
}
|
|
|
} |
...
|
...
|
|