func (p *TaskComponent) FinishTask(payload spirit.Payload) (result interface{}, err error) { task := models.Task{} if err = payload.DataToObject(&task); err != nil { return } if err = p.TaskManager.FinishTask(task.Id); err != nil { return } return }
func (p *TaskComponent) NewTask(payload spirit.Payload) (result interface{}, err error) { newTask := models.Task{} if err = payload.DataToObject(&newTask); err != nil { return } if result, err = p.TaskManager.NewTask(newTask); err != nil { return } return }