审查视图

pkg/domain/evaluation_cycle.go 1.6 KB
郑周 authored
1 2 3 4 5 6
package domain

import (
	"time"
)
郑周 authored
7 8 9 10 11 12 13 14 15 16
const (
	KpiCycleDay        int = 1 // 考核周期-日
	KpiCycleWeek       int = 2 // 考核周期-周
	KpiCycleOneMonth   int = 3 // 考核周期-月
	KpiCycleTwoMonth   int = 4 // 考核周期-双月
	KpiCycleThreeMonth int = 5 // 考核周期-季度
	KpiCycleSixMonth   int = 6 // 考核周期-半年
	KpiCycleYear       int = 7 // 考核周期-年
)
17 18 19
type TemplateSimple struct {
	Id        int64     `json:"id,string" comment:"模板ID"`
	Name      string    `json:"name" comment:"模板名称"`
20
	CreatedAt time.Time `json:"createdAt" comment:"模板创建时间"`
21 22
}
郑周 authored
23
type EvaluationCycle struct {
24 25 26 27 28 29
	Id        int64      `json:"id,string" comment:"ID"`
	Name      string     `json:"name" comment:"名称"`
	TimeStart *time.Time `json:"timeStart" comment:"起始时间"`
	TimeEnd   *time.Time `json:"timeEnd" comment:"截至时间"`
	CompanyId int64      `json:"companyId,string" comment:"公司ID"`
	CreatorId int64      `json:"creatorId,string" comment:"创建人ID"`
郑周 authored
30
	KpiCycle  int        `json:"kpiCycle" comment:"考核周期(1日、2周、3月)"`
31 32 33
	CreatedAt time.Time  `json:"createdAt" comment:"创建时间"`
	UpdatedAt time.Time  `json:"updatedAt" comment:"更新时间"`
	DeletedAt *time.Time `json:"deletedAt" comment:"删除时间"`
郑周 authored
34
}
35 36 37 38 39

type EvaluationCycleRepository interface {
	Insert(cycle *EvaluationCycle) (*EvaluationCycle, error)
	Remove(cycle *EvaluationCycle) (*EvaluationCycle, error)
	FindOne(queryOptions map[string]interface{}) (*EvaluationCycle, error)
40
	Find(queryOptions map[string]interface{}) (int64, []*EvaluationCycle, error)
41 42
	Count(queryOptions map[string]interface{}) (int64, error)
}