32 lines
563 B
Go
32 lines
563 B
Go
|
package task
|
||
|
|
||
|
import (
|
||
|
pb "loafle.com/overflow/central_api_gateway/task"
|
||
|
"loafle.com/overflow/central_api_gateway/commons"
|
||
|
"context"
|
||
|
)
|
||
|
|
||
|
|
||
|
type TaskServerImpl struct {
|
||
|
}
|
||
|
|
||
|
func (s *TaskServerImpl) requestTask(c context.Context, in *pb.Empty) (*pb.TaskList, error) {
|
||
|
|
||
|
output := &pb.TaskList{}
|
||
|
|
||
|
tasks := make([]*pb.TaskInfo, 0)
|
||
|
|
||
|
//FIXME
|
||
|
for i := 0; i < 5 ; i++ {
|
||
|
task := &pb.TaskInfo{}
|
||
|
task.TaskId = string(i)
|
||
|
task.Command = commons.TaskEventType_TASK_POL_INTERVAL_UPDATE
|
||
|
tasks = append(tasks, task)
|
||
|
|
||
|
}
|
||
|
output.TaskList = tasks
|
||
|
|
||
|
return output, nil
|
||
|
}
|
||
|
|