瀏覽代碼

后台接口调整

mxs 10 月之前
父節點
當前提交
c60085697b
共有 2 個文件被更改,包括 2 次插入29 次删除
  1. 1 25
      backend/webservice/webservice.go
  2. 1 4
      server.go

+ 1 - 25
backend/webservice/webservice.go

@@ -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})

+ 1 - 4
server.go

@@ -30,10 +30,7 @@ func (a *App) ServerActionCodeList(param map[string]interface{}) *Result {
 	qu.Debug("param---", param)
 	data := &Result{}
 	if User != nil {
-		//formatUser(param)
-		param["user"] = User
-		qu.Debug("param---", param)
-		getResult(param, data, "getcodes")
+		getResult(map[string]interface{}{"param": param, "user": User}, data, "getcodes")
 	} else {
 		data.Msg = "用户登录异常,请重新登录!"
 		qu.Debug(data.Msg)