fixed
return error
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user