|
@@ -88,32 +88,8 @@ func (ws *WebService) SaveSpiderConfig(w http.ResponseWriter, r *http.Request) {
|
|
|
http.Error(w, err.Error(), http.StatusBadRequest)
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
qu.Debug("CSS", req.Key, req.Css, req.Url)
|
|
|
- /*//TODO 业务操作
|
|
|
- switch req.Key {
|
|
|
- case "listItemCss":
|
|
|
- ws.currentSpiderConfig.ListItemCss = req.Css
|
|
|
- case "listLinkCss":
|
|
|
- ws.currentSpiderConfig.ListLinkCss = req.Css
|
|
|
- case "listPublishTimeCss":
|
|
|
- ws.currentSpiderConfig.ListPubtimeCss = req.Css
|
|
|
- case "listNextPageCss":
|
|
|
- ws.currentSpiderConfig.ListNextPageCss = req.Css
|
|
|
- case "listBodyCss":
|
|
|
- ws.currentSpiderConfig.ListBodyCss = req.Css
|
|
|
- case "titleCss":
|
|
|
- ws.currentSpiderConfig.TitleCss = req.Css
|
|
|
- case "publishUnitCss":
|
|
|
- ws.currentSpiderConfig.PublishUnitCss = req.Css
|
|
|
- case "publishTimeCss":
|
|
|
- ws.currentSpiderConfig.PublishTimeCss = req.Css
|
|
|
- case "contentCss":
|
|
|
- ws.currentSpiderConfig.ContentCss = req.Css
|
|
|
- case "attachCss":
|
|
|
- ws.currentSpiderConfig.AttachCss = req.Css
|
|
|
- }
|
|
|
- fmt.Fprint(w, "{'code':200}")
|
|
|
- ws.db.SaveOrUpdate(ws.currentSpiderConfig)*/
|
|
|
fmt.Fprint(w, "{'code':200}")
|
|
|
//TODO 通知开发工具端,CSS选择器有变动
|
|
|
ws.enf.Dispatch("spiderConfigChange", map[string]interface{}{"key": req.Key, "css": req.Css, "url": req.Url})
|