def search(self,list,response): if list[1] in self.catalog[list[0]]: data = self.getData(response) item=self.getItem(data) item["type"] = self.catalog[list[0]][list[1]] item["value"] = json.loads(request.form['data'])['keyword'] item["other"] = str({}) records={"table":"records","params":item} dbs.insertItem(records)
def expert(self,list,response): if list[1] in self.catalog[list[0]]: data = self.getData(response) item = self.getItem(data) item["type"] = self.catalog[list[0]][list[1]] item["value"] = list[2] item["other"] = str({}) records={"table":"records","params":item} dbs.insertItem(records)
def message(self, list, response): if list[1] in self.catalog[list[0]]: data = self.getData(response) item = self.getItem(data) item["type"] = self.catalog[list[0]][list[1]] true=True item["value"] =eval(response.data.decode())['obj']['user'] item["other"] = str({}) records = {"table": "records", "params": item} dbs.insertItem(records)
def login(self,list,response): if list[1] in self.catalog[list[0]]: data = self.getData(response) item = self.getItem(data) item["type"] = self.catalog[list[0]][list[1]] obj=json.loads(response.data.decode()) if "msg" in obj: if obj["msg"]=="登陆" or "注册"==obj["msg"]: item["type"]=obj["msg"] item["value"] = obj["obj"]['account'] item["other"] = str({}) records={"table":"records","params":item} dbs.insertItem(records)
def code(self, list, response): if list[1] in self.catalog[list[0]]: data = self.getData(response) item = self.getItem(data) item["type"] = self.catalog[list[0]][list[1]] true=True false=False obj=eval(response.data.decode())['obj'] if 'phone' in obj: item["value"]=obj["phone"] else: item["value"] ="" item["other"] = str({}) records = {"table": "records", "params": item} dbs.insertItem(records)
def insertMessage(self, params): item = {} item["table"] = "messages" item["params"] = params dbs.insertItem(item)
def insertItem(self,item): dbs.insertItem(item)