作者 tangxvhui

model 中字段零值 处理

1 package models 1 package models
2 2
3 import ( 3 import (
4 - "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"  
5 "time" 4 "time"
  5 +
  6 + "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
6 ) 7 )
7 8
8 type EvaluationProject struct { 9 type EvaluationProject struct {
@@ -14,8 +15,8 @@ type EvaluationProject struct { @@ -14,8 +15,8 @@ type EvaluationProject struct {
14 CycleId int64 `comment:"周期ID"` 15 CycleId int64 `comment:"周期ID"`
15 CreatorId int64 `comment:"创建人ID"` 16 CreatorId int64 `comment:"创建人ID"`
16 State int `comment:"状态(0待完成配置、1待启用、2启用、3停用)" pg:",use_zero"` 17 State int `comment:"状态(0待完成配置、1待启用、2启用、3停用)" pg:",use_zero"`
17 - HrBp int `comment:"HR角色权限"`  
18 - Pmp int `comment:"PM角色权限"` 18 + HrBp int `pg:",use_zero" comment:"HR角色权限"`
  19 + Pmp int `pg:",use_zero" comment:"PM角色权限"`
19 PmpIds []string `comment:"项目管理员ID"` 20 PmpIds []string `comment:"项目管理员ID"`
20 Recipients []string `comment:"被评估人ID"` 21 Recipients []string `comment:"被评估人ID"`
21 Template *domain.EvaluationTemplate `comment:"评估模板"` 22 Template *domain.EvaluationTemplate `comment:"评估模板"`
@@ -20,7 +20,7 @@ type StaffAssessContent struct { @@ -20,7 +20,7 @@ type StaffAssessContent struct {
20 ReteResult string //评估的结果 20 ReteResult string //评估的结果
21 Rule domain.EvaluationRule 21 Rule domain.EvaluationRule
22 Remark []domain.AssessContemtRemark 22 Remark []domain.AssessContemtRemark
23 - Weight int //权重 23 + Weight int `pg:",use_zero"` //权重
24 CreatedAt time.Time //数据创建时间 24 CreatedAt time.Time //数据创建时间
25 UpdatedAt time.Time //数据更新时间 25 UpdatedAt time.Time //数据更新时间
26 DeletedAt *time.Time 26 DeletedAt *time.Time