from handlers.HandlerBase import BaseHandler from model.DataBaseUtils import MysqlUtils import json import requests from data_manage.operate import * from model.DataBaseUtils import MysqlUtils db = MysqlUtils() class ChannelAnalysisHandler(BaseHandler): APP_MAP = { "user_channel": user_channel, } def post(self): arg = self.get_args() print(arg) try: data = self.run(arg) self.write_json(data=data) except Exception as e: print(e) self.write_fail() def run(self, arg): app = self.request.full_url().split('/')[-1] return self.run_function(self.APP_MAP[app], arg) def run_function(self, func, arg): return func(arg)