diff --git a/client.dotask.go b/client.dotask.go index 8376f7d..1f61ea9 100644 --- a/client.dotask.go +++ b/client.dotask.go @@ -6,6 +6,7 @@ import ( "log" ) +// 完成单次任务 func DoTask(dbname, siteid, userId, task_type string, url ...string) (bool, error) { if dbname == "" || userId == "" || task_type == ""{ diff --git a/client.dotask_test.go b/client.dotask_test.go index 3eef464..aad2f61 100644 --- a/client.dotask_test.go +++ b/client.dotask_test.go @@ -5,9 +5,9 @@ import ( ) func Test_DoTask(t *testing.T) { - dbname := "shop_v2_org" - siteid := "" - userid := "2" + dbname := "shop" + siteid := "1198881" + userid := "19" task_type := "phone" list, err := DoTask(dbname,siteid,userid,task_type) diff --git a/task.proto b/task.proto index e037c8b..5c20183 100644 --- a/task.proto +++ b/task.proto @@ -18,4 +18,5 @@ message Response { // rpc方法 service TaskService { rpc DoTask (Request) returns (Response); // 完成了某项任务 + rpc DoCycleTask (Request) returns (Response); // 完成循环类任务 } \ No newline at end of file diff --git a/variable.go b/variable.go index a7063c0..400f340 100644 --- a/variable.go +++ b/variable.go @@ -3,8 +3,15 @@ package taskrpc var DES_KEY = "task2296" type DoTaskParam struct { - SiteId string `json:"site_id"` - Dbname string `json:"database"` - Type string `json:"type"` - UserId string `json:"user_id"` + SiteId string `json:"site_id"` + Dbname string `json:"database"` + Type string `json:"type"` + UserId string `json:"user_id"` +} + +type DoCycleTaskParam struct { + SiteId string `json:"site_id"` + Dbname string `json:"database"` + TaskId string `json:"task_id"` + UserId string `json:"user_id"` }