Ejemplo n.º 1
0
 def get(self, *args, **kwargs):
     cid = self.get_argument('cid', 'Xb')
     gid = self.get_argument('gid', 'default')
     cur_uuid = self.getHornerUUID()
     if cur_uuid is None or '' == cur_uuid:
         self.setHornerUUID()
     ip_parser = IpParserBaidu('182.139.133.135' if MODE_DEBUG else self.request.remote_ip)
     asynchronous_http_client = tornado.httpclient.AsyncHTTPClient()
     ip_infor_response = yield asynchronous_http_client.fetch(ip_parser.getRequestUrl())
     self.on_query_ip_infor(cid, gid, ip_infor_response)
Ejemplo n.º 2
0
 def get(self, *args, **kwargs):
     companyid, appid, skillid, userid, account, name, grade, memo = self.get_request_params(
         "companyid", "appid", "skillid", "userid", "account", "name", "grade", "memo"
     )
     if skillid is None or '' == skillid:
         skillid = 'default'
     if self.check_request_params_valid(companyid, appid, userid):
         cur_uuid = self.getHornerUUID()
         if cur_uuid is None or '' == cur_uuid:
             self.setHornerUUID()
         ip_parser = IpParserBaidu('182.139.133.135' if MODE_DEBUG else self.request.remote_ip)
         asynchronous_http_client = tornado.httpclient.AsyncHTTPClient()
         ip_infor_response = yield asynchronous_http_client.fetch(ip_parser.getRequestUrl())
         self.on_geo_response(companyid, appid, skillid, userid, account, name, grade, memo, ip_infor_response)
     else:
         self.write("params invalid")
         self.finish()