off_task_record.go 1023 字节
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
}