sqlite的api,便于内部使用
liuxiaolong
2020-03-09 d7e55315294961bceb30561a0da562b90fe036c0
taskApi.go
@@ -3,7 +3,6 @@
import (
   "basic.com/pubsub/protomsg.git"
   "encoding/json"
   "fmt"
   "strconv"
)
@@ -36,7 +35,27 @@
   }
   var res Result
   if err = json.Unmarshal(respBody, &res); err != nil {
      fmt.Println(err)
      logPrint(err)
      return taskInfos
   }
   bytes, _ := json.Marshal(res.Data)
   err = json.Unmarshal(bytes, &taskInfos)
   return taskInfos
}
func (api TaskApi) FindAllTaskDefaultArgs(scope string)(taskInfos []protomsg.TaskSdkInfo) {
   url := api.getBasicUrl() + DATA_URL_PREFIX + "/task/findAll"
   client := NewClient()
   queryParam := map[string]string {
      "scope": scope,
   }
   respBody, err := client.DoGetRequest(url, queryParam, nil)
   if err !=nil {
      return taskInfos
   }
   var res Result
   if err = json.Unmarshal(respBody, &res); err != nil {
      logPrint(err)
      return taskInfos
   }
   bytes, _ := json.Marshal(res.Data)
@@ -80,7 +99,7 @@
   }
   var res Result
   if err = json.Unmarshal(respBody, &res); err != nil {
      fmt.Println(err)
      logPrint(err)
      return false,nil
   }
   return res.Success,res.Data