crawler 's'
This commit is contained in:
snoop 2017-06-08 17:04:41 +09:00
parent e596bc09c8
commit 2c00d2bc1e
6 changed files with 107 additions and 0 deletions

View File

@ -0,0 +1,55 @@
package crawler
import (
"encoding/json"
"git.loafle.net/overflow/commons_go/model/timestamp"
"git.loafle.net/overflow/overflow_proxy_service/proxy"
)
type CrawlerService struct {
}
func NewCrawlerService() *CrawlerService {
return &CrawlerService{}
}
type Crawler struct {
Id json.Number `json:"id,Number,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
CrawlerType string `json:"types,omitempty"`
CreateDate timestamp.Timestamp `json:"createDate,omitempty"`
}
func (c *CrawlerService)List() string {
out := proxy.InvokeDB("crawler", "list", nil)
return out
}
func (c *CrawlerService)Create(ct * Crawler) string {
bytes, err := json.Marshal(ct)
if err != nil {
return ""
}
m := make(map[string]string)
m[""] = string(bytes)
out := proxy.InvokeDB("crawler", "create", m)
return out;
}

View File

@ -0,0 +1,3 @@
package crawler

View File

@ -0,0 +1,21 @@
package crawlerInputItem
import (
"git.loafle.net/overflow/commons_go/model/timestamp"
"encoding/json"
)
type CrawlerInputItem struct {
Id json.Number `json:"id,Number,omitempty"`
Name string `json:"name,omitempty"`
DataType string `json:"dataType,omitempty"`
CreateDate timestamp.Timestamp `json:"createDate,omitempty"`
}
type CrawlerInputItemSerivce struct {
}
func NewCrawlerInputItemService() *CrawlerInputItemSerivce {
return &CrawlerInputItemSerivce{}
}

View File

@ -0,0 +1 @@
package crawlerInputItem

View File

@ -0,0 +1,26 @@
package crawlerinputitemmapping
import (
"git.loafle.net/overflow/commons_go/model/timestamp"
"encoding/json"
"git.loafle.net/overflow/overflow_proxy_service/proxy/crawler"
"git.loafle.net/overflow/overflow_proxy_service/proxy/crawlerInputItem"
)
type CrawlerInputItemMapping struct {
Id json.Number `json:"id,Number,omitempty"`
Crawler crawler.Crawler `json:"crawler,omitempty"`
CrawlerInputItem crawlerInputItem.CrawlerInputItem `json:"crawlerInputItem,omitempty"`
Order string `json:"order,omitempty"`
RequireType string `json:"requireType,omitempty"`
CreateDate timestamp.Timestamp `json:"createDate,omitempty"`
}
type CrawlerInputItemMappingService struct {
}
func NewCrawlerInputItemMappingService() *CrawlerInputItemMappingService {
return &CrawlerInputItemMappingService{}
}

View File

@ -0,0 +1 @@
package crawlerinputitemmapping