예제 #1
0
 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)
예제 #2
0
 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)
예제 #3
0
 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)
예제 #4
0
 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)
예제 #5
0
 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)
예제 #6
0
 def insertMessage(self, params):
     item = {}
     item["table"] = "messages"
     item["params"] = params
     dbs.insertItem(item)
예제 #7
0
 def insertItem(self,item):
     dbs.insertItem(item)