return error
This commit is contained in:
snoop
2017-06-08 20:53:04 +09:00
parent eab37e4281
commit 37a2128b45
11 changed files with 226 additions and 122 deletions

View File

@@ -3,7 +3,7 @@ package crawler
import (
"encoding/json"
"git.loafle.net/overflow/commons_go/model/timestamp"
"git.loafle.net/overflow/overflow_proxy_service/proxy"
//"git.loafle.net/overflow/overflow_proxy_service/proxy"
"git.loafle.net/overflow/overflow_proxy_service/proxy/utils"
)
@@ -28,25 +28,31 @@ type Crawler struct {
func (c *CrawlerService)List() string {
func (c *CrawlerService)List() (string, error) {
out := proxy.InvokeDB("crawler", "findAll", nil)
//out := proxy.InvokeDB("crawler", "findAll", nil)
return out
out, err := utils.InvokeDB("crawler", "findAll", nil)
if err != nil {
return "", err
}
return out, nil
}
func (c *CrawlerService)Create(ct * Crawler) string {
func (c *CrawlerService)Create(ct * Crawler) (string, error) {
out, err := utils.InvokeDB("crawler", "create", ct)
if err != nil {
return ""
return "", err
}
return out;
return out, nil
}