added
crawler 's'
This commit is contained in:
parent
e596bc09c8
commit
2c00d2bc1e
55
proxy/crawler/crawler_service.go
Normal file
55
proxy/crawler/crawler_service.go
Normal 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;
|
||||||
|
}
|
3
proxy/crawler/crawler_service_test.go
Normal file
3
proxy/crawler/crawler_service_test.go
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
package crawler
|
||||||
|
|
||||||
|
|
21
proxy/crawlerInputItem/crawlerinputitem_service.go
Normal file
21
proxy/crawlerInputItem/crawlerinputitem_service.go
Normal 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{}
|
||||||
|
}
|
1
proxy/crawlerInputItem/crawlerinputitem_service_test.go
Normal file
1
proxy/crawlerInputItem/crawlerinputitem_service_test.go
Normal file
@ -0,0 +1 @@
|
|||||||
|
package crawlerInputItem
|
@ -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{}
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
package crawlerinputitemmapping
|
Loading…
x
Reference in New Issue
Block a user