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; }