作者 郑周

项目状态优化

@@ -12,7 +12,7 @@ type CreateProjectCommand struct { @@ -12,7 +12,7 @@ type CreateProjectCommand struct {
12 Describe string `cname:"项目描述" json:"describe" valid:"Required"` 12 Describe string `cname:"项目描述" json:"describe" valid:"Required"`
13 HrBp int `cname:"HR角色权限" json:"hrBp"` 13 HrBp int `cname:"HR角色权限" json:"hrBp"`
14 Pmp int `cname:"PM角色权限" json:"pmp"` 14 Pmp int `cname:"PM角色权限" json:"pmp"`
15 - PmpIds []string `cname:"项目管理员ID" json:"pms"` 15 + PmpIds []string `cname:"项目管理员ID" json:"pmpIds"`
16 } 16 }
17 17
18 func (in *CreateProjectCommand) Valid(validation *validation.Validation) { 18 func (in *CreateProjectCommand) Valid(validation *validation.Validation) {
@@ -25,7 +25,7 @@ func (in *CreateProjectCommand) Valid(validation *validation.Validation) { @@ -25,7 +25,7 @@ func (in *CreateProjectCommand) Valid(validation *validation.Validation) {
25 return 25 return
26 } 26 }
27 if len(in.Name) > 40 { 27 if len(in.Name) > 40 {
28 - validation.SetError("name", "角色名称最大长度40个字符") 28 + validation.SetError("name", "项目名称最大长度40个字符")
29 return 29 return
30 } 30 }
31 } 31 }
@@ -6,8 +6,8 @@ import ( @@ -6,8 +6,8 @@ import (
6 ) 6 )
7 7
8 type StateProjectCommand struct { 8 type StateProjectCommand struct {
9 - Id int64 `cname:"模板ID" json:"id,string" valid:"Required"`  
10 - State int `cname:"模板状态" json:"state"` 9 + Id int64 `cname:"项目ID" json:"id,string" valid:"Required"`
  10 + State int `cname:"项目状态" json:"state"`
11 } 11 }
12 12
13 type CopyProjectCommand struct { 13 type CopyProjectCommand struct {
@@ -10,17 +10,17 @@ type UpdateProjectCommand struct { @@ -10,17 +10,17 @@ type UpdateProjectCommand struct {
10 CycleId int64 `cname:"周期ID" json:"cycleId,string" valid:"Required"` 10 CycleId int64 `cname:"周期ID" json:"cycleId,string" valid:"Required"`
11 Id int64 `cname:"项目ID" json:"id,string" valid:"Required"` 11 Id int64 `cname:"项目ID" json:"id,string" valid:"Required"`
12 Name string `cname:"项目名称" json:"name" valid:"Required"` 12 Name string `cname:"项目名称" json:"name" valid:"Required"`
13 - Describe string `cname:"项目描述" json:"describe" valid:"Required"` 13 + Describe string `cname:"项目描述" json:"describe"`
14 HrBp int `cname:"HR角色权限" json:"hrBp"` 14 HrBp int `cname:"HR角色权限" json:"hrBp"`
15 Pmp int `cname:"PM角色权限" json:"pmp"` 15 Pmp int `cname:"PM角色权限" json:"pmp"`
16 - PmpIds []string `cname:"项目管理员ID" json:"pms"` 16 + PmpIds []string `cname:"项目管理员ID" json:"pmpIds"`
17 } 17 }
18 18
19 type UpdateProjectTemplateCommand struct { 19 type UpdateProjectTemplateCommand struct {
20 CompanyId int64 `cname:"公司ID" json:"companyId"` 20 CompanyId int64 `cname:"公司ID" json:"companyId"`
21 CycleId int64 `cname:"周期ID" json:"cycleId,string" valid:"Required"` 21 CycleId int64 `cname:"周期ID" json:"cycleId,string" valid:"Required"`
22 Id int64 `cname:"项目ID" json:"id,string" valid:"Required"` 22 Id int64 `cname:"项目ID" json:"id,string" valid:"Required"`
23 - TemplateId int64 `cname:"评估模板ID" json:"templateId,string"` 23 + TemplateId int64 `cname:"模板ID" json:"templateId,string"`
24 Recipients []string `cname:"被评估人ID" json:"recipients"` 24 Recipients []string `cname:"被评估人ID" json:"recipients"`
25 } 25 }
26 26
@@ -28,14 +28,14 @@ type UpdateProjectTemplateNodeCommand struct { @@ -28,14 +28,14 @@ type UpdateProjectTemplateNodeCommand struct {
28 CompanyId int64 `cname:"公司ID" json:"companyId"` 28 CompanyId int64 `cname:"公司ID" json:"companyId"`
29 CycleId int64 `cname:"周期ID" json:"cycleId,string" valid:"Required"` 29 CycleId int64 `cname:"周期ID" json:"cycleId,string" valid:"Required"`
30 Id int64 `cname:"项目ID" json:"id,string" valid:"Required"` 30 Id int64 `cname:"项目ID" json:"id,string" valid:"Required"`
31 - TemplateId int64 `cname:"评估模板ID" json:"templateId,string"` 31 + TemplateId int64 `cname:"模板ID" json:"templateId,string" valid:"Required"`
32 LinkNodes []*domain.LinkNode `cname:"评估流程" json:"linkNodes"` 32 LinkNodes []*domain.LinkNode `cname:"评估流程" json:"linkNodes"`
33 Activate int `cname:"启动项目" json:"activate"` 33 Activate int `cname:"启动项目" json:"activate"`
34 } 34 }
35 35
36 func (in *UpdateProjectCommand) Valid(validation *validation.Validation) { 36 func (in *UpdateProjectCommand) Valid(validation *validation.Validation) {
37 if len(in.Name) > 40 { 37 if len(in.Name) > 40 {
38 - validation.SetError("name", "角色名称最大长度40个字符") 38 + validation.SetError("name", "项目名称最大长度40个字符")
39 return 39 return
40 } 40 }
41 } 41 }
@@ -46,3 +46,10 @@ func (in *UpdateProjectTemplateCommand) Valid(validation *validation.Validation) @@ -46,3 +46,10 @@ func (in *UpdateProjectTemplateCommand) Valid(validation *validation.Validation)
46 return 46 return
47 } 47 }
48 } 48 }
  49 +
  50 +func (in *UpdateProjectTemplateNodeCommand) Valid(validation *validation.Validation) {
  51 + if len(in.LinkNodes) == 0 {
  52 + validation.SetError("linkNodes", "请添加评估流程")
  53 + return
  54 + }
  55 +}