permission.go 1.7 KB
package domain

import "time"

const (
	PermissionOff int = 1 // 权限开关-关闭
	PermissionOn  int = 2 // 权限开关-开启
)

type Permission struct {
	Id             int64          `json:"id,string"`
	CompanyId      int64          `json:"companyId" comment:"公司ID" `
	OptHrScore     int            `json:"optHrScore" comment:"上级是否可以修改人资综评分数"`
	OptEvalScore   int            `json:"optEvalScore" comment:"上级是否可以修改360°综评分数"`
	OptConfirmPerf int            `json:"optConfirmPerf" comment:"是否需要员工确认绩效"`
	CycleDeadline  *CycleDeadline `json:"cycleDeadline" comment:"周期评估各业务截止时间"`
	CreatedAt      time.Time      `json:"createdAt" comment:"创建时间"`
	UpdatedAt      time.Time      `json:"updatedAt" comment:"更新时间"`
	DeletedAt      *time.Time     `json:"deletedAt" comment:"删除时间"`
}

// CycleDeadline 周期评估截止时间
type CycleDeadline struct {
	AssessmentSelf     DeadlineTime `json:"assessmentSelf" comment:"综合自评"`
	AssessmentAll      DeadlineTime `json:"assessmentAll" comment:"360评估"`
	AssessmentHr       DeadlineTime `json:"assessmentHr" comment:"人资评估"`
	AssessmentSuperior DeadlineTime `json:"assessmentSuperior" comment:"上级评估"`
	ViewMyPerf         DeadlineTime `json:"viewMyPerf" comment:"查看我的绩效"`
}

type DeadlineTime struct {
	Hour   int `json:"hour" comment:"时"`
	Minute int `json:"minute" comment:"分"`
}

type PermissionRepository interface {
	Insert(permission *Permission) (*Permission, error)
	FindOne(queryOptions map[string]interface{}) (*Permission, error)
	Find(queryOptions map[string]interface{}) (int64, []*Permission, error)
	//FindByCompanyId(companyId int64) (*Permission, error)
}