diff --git a/proxy/crawler/crawler_service.go b/proxy/crawler/crawler_service.go new file mode 100644 index 0000000..8370497 --- /dev/null +++ b/proxy/crawler/crawler_service.go @@ -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; +} diff --git a/proxy/crawler/crawler_service_test.go b/proxy/crawler/crawler_service_test.go new file mode 100644 index 0000000..ef223a3 --- /dev/null +++ b/proxy/crawler/crawler_service_test.go @@ -0,0 +1,3 @@ +package crawler + + diff --git a/proxy/crawlerInputItem/crawlerinputitem_service.go b/proxy/crawlerInputItem/crawlerinputitem_service.go new file mode 100644 index 0000000..2334224 --- /dev/null +++ b/proxy/crawlerInputItem/crawlerinputitem_service.go @@ -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{} +} \ No newline at end of file diff --git a/proxy/crawlerInputItem/crawlerinputitem_service_test.go b/proxy/crawlerInputItem/crawlerinputitem_service_test.go new file mode 100644 index 0000000..bfe54a7 --- /dev/null +++ b/proxy/crawlerInputItem/crawlerinputitem_service_test.go @@ -0,0 +1 @@ +package crawlerInputItem diff --git a/proxy/crawlerinputitemmapping/crawlerinputitemmapping_service.go b/proxy/crawlerinputitemmapping/crawlerinputitemmapping_service.go new file mode 100644 index 0000000..1856cf0 --- /dev/null +++ b/proxy/crawlerinputitemmapping/crawlerinputitemmapping_service.go @@ -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{} +} \ No newline at end of file diff --git a/proxy/crawlerinputitemmapping/crawlerinputitemmapping_service_test.go b/proxy/crawlerinputitemmapping/crawlerinputitemmapping_service_test.go new file mode 100644 index 0000000..ffcc3ca --- /dev/null +++ b/proxy/crawlerinputitemmapping/crawlerinputitemmapping_service_test.go @@ -0,0 +1 @@ +package crawlerinputitemmapping