task_nature.go
864 字节
package domain
// 任务性质
type TaskNature struct {
// 任务性质ID
TaskNatureId int `json:"taskNatureId"`
// 任务性质名称
TaskNatureName string `json:"taskNatureName"`
// 公司ID
CompanyId int64 `json:"companyId"`
}
type TaskNatureRepository interface {
Save(taskNature *TaskNature) (*TaskNature, error)
Remove(taskNature *TaskNature) (*TaskNature, error)
FindOne(queryOptions map[string]interface{}) (*TaskNature, error)
Find(queryOptions map[string]interface{}) (int64, []*TaskNature, error)
}
func (taskNature *TaskNature) Identify() interface{} {
if taskNature.TaskNatureId == 0 {
return nil
}
return taskNature.TaskNatureId
}
func (taskNature *TaskNature) Update(data map[string]interface{}) error {
if taskNatureName, ok := data["taskNatureName"]; ok {
taskNature.TaskNatureName = taskNatureName.(string)
}
return nil
}