|
@@ -0,0 +1,106 @@
|
|
|
+from wechat_action.sql_models import DB
|
|
|
+from settings import using_config
|
|
|
+import tornado.ioloop
|
|
|
+import tornado.web
|
|
|
+import json
|
|
|
+from wechat_action import sql_tools
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+db = DB(config=using_config)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+class login(tornado.web.RequestHandler):
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ def get(self):
|
|
|
+ self.write("Hello, world")
|
|
|
+
|
|
|
+ def post(self):
|
|
|
+
|
|
|
+
|
|
|
+ jsonbyte = self.request.body
|
|
|
+ print('二进制格式json字符串:', jsonbyte)
|
|
|
+ jsonstr = jsonbyte.decode('utf8')
|
|
|
+ print('json字符串:', jsonstr)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ jsonobj = json.loads(jsonstr)
|
|
|
+ day = jsonobj.get('day')
|
|
|
+ title = jsonobj.get('title')
|
|
|
+ print('day: ', day, ', title: ', title)
|
|
|
+
|
|
|
+ self.write('hello post')
|
|
|
+
|
|
|
+
|
|
|
+class create_ad_plan(tornado.web.RequestHandler):
|
|
|
+
|
|
|
+
|
|
|
+ def post(self):
|
|
|
+
|
|
|
+ pass
|
|
|
+
|
|
|
+
|
|
|
+class create_ad_show(tornado.web.RequestHandler):
|
|
|
+
|
|
|
+ pass
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+class ad_status(tornado.web.RequestHandler):
|
|
|
+
|
|
|
+ pass
|
|
|
+
|
|
|
+
|
|
|
+class ad_human_info(tornado.web.RequestHandler):
|
|
|
+
|
|
|
+ def get(self):
|
|
|
+
|
|
|
+
|
|
|
+ user_id = self.get_argument("user_id", None)
|
|
|
+ is_refresh = self.get_argument("is_refresh", None)
|
|
|
+ if is_refresh:
|
|
|
+
|
|
|
+
|
|
|
+ pass
|
|
|
+ else:
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ sql_session = db.DBSession()
|
|
|
+ sql_tools.get_human_info(sql_session=sql_session,user_id=user_id)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ pass
|
|
|
+
|
|
|
+
|
|
|
+class ad_wechat_info():
|
|
|
+
|
|
|
+ def get(self):
|
|
|
+ pass
|
|
|
+
|
|
|
+
|
|
|
+def make_app():
|
|
|
+ return tornado.web.Application([
|
|
|
+ (r"/create_ad_plan", create_ad_plan),
|
|
|
+ (r"/create_ad_show", create_ad_show),
|
|
|
+ ], debug=True)
|
|
|
+
|
|
|
+
|
|
|
+if __name__ == "__main__":
|
|
|
+ app = make_app()
|
|
|
+ app.listen(8888)
|
|
|
+ tornado.ioloop.IOLoop.current().start()
|