Commit 2ee87318 by Joneq

判断sql插入限制

parent fc647ae6
Showing with 4 additions and 3 deletions
...@@ -2,7 +2,6 @@ package logic ...@@ -2,7 +2,6 @@ package logic
import ( import (
"encoding/json" "encoding/json"
"fmt"
"io/ioutil" "io/ioutil"
"log" "log"
"net/http" "net/http"
...@@ -110,11 +109,13 @@ func HttpGet(companyName string)(returnDatas map[string]string) { ...@@ -110,11 +109,13 @@ func HttpGet(companyName string)(returnDatas map[string]string) {
json.Unmarshal(respBody,&totalNum) json.Unmarshal(respBody,&totalNum)
//防止sql执行字符串超长 //防止sql执行字符串超长
if len(string(respBody)) < 10000{ if len(string(respBody)) < 120000{
returnData["tianyancha_json"] += "||||"+string(respBody) returnData["tianyancha_json"] += "||||"+string(respBody)
} }
fmt.Println(len(returnData["tianyancha_json"])) if len(returnData["tianyancha_json"]) > 21000 {
returnData["tianyancha_json"] = "数据量太大"
}
var changeInfoNum int64 var changeInfoNum int64
changeInfoNum = 0 changeInfoNum = 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment