off_task_record.go
1023 字节
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package domain
import "time"
// 关闭任务记录
type OffTaskRecord struct {
// 关闭任务记录ID
OffTaskRecordId int64 `json:"offTaskRecordId"`
// 任务
Task *Task `json:"task"`
// 操作人
Operator *EmployeeInfo `json:"operator"`
// 关闭理由
OffReason string `json:"offReason"`
// 创建时间
CreateTime time.Time `json:"createTime"`
}
type OffTaskRecordRepository interface {
Save(offTaskRecord *OffTaskRecord) (*OffTaskRecord, error)
Remove(offTaskRecord *OffTaskRecord) (*OffTaskRecord, error)
FindOne(queryOptions map[string]interface{}) (*OffTaskRecord, error)
Find(queryOptions map[string]interface{}) (int64, []*OffTaskRecord, error)
}
func (offTaskRecord *OffTaskRecord) Identify() interface{} {
if offTaskRecord.OffTaskRecordId == 0 {
return nil
}
return offTaskRecord.OffTaskRecordId
}
func (offTaskRecord *OffTaskRecord) Update(data map[string]interface{}) error {
if offReason, ok := data["offReason"]; ok {
offTaskRecord.OffReason = offReason.(string)
}
return nil
}