作者 tangxvhui

model 中字段零值 处理

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