当前位置: 首页>>代码示例>>Python>>正文


Python web.route方法代码示例

本文整理汇总了Python中aiohttp.web.route方法的典型用法代码示例。如果您正苦于以下问题:Python web.route方法的具体用法?Python web.route怎么用?Python web.route使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在aiohttp.web的用法示例。


在下文中一共展示了web.route方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from aiohttp import web [as 别名]
# 或者: from aiohttp.web import route [as 别名]
def __init__(self):

        self.name = "v1_private_user"
        self.plugin_type = "sub_api"                
        self.sub_api = "api_v1"

        authhandler = bumper.ConfServer.ConfServer_AuthHandler()
        self.routes = [
            web.route("*", "/private/{country}/{language}/{devid}/{apptype}/{appversion}/{devtype}/{aid}/user/login", authhandler.login, name="v1_user_login"),
            web.route("*", "/private/{country}/{language}/{devid}/{apptype}/{appversion}/{devtype}/{aid}/user/checkLogin", authhandler.login, name="v1_user_checkLogin"),
            web.route("*", "/private/{country}/{language}/{devid}/{apptype}/{appversion}/{devtype}/{aid}/user/getAuthCode", authhandler.get_AuthCode, name="v1_user_getAuthCode"),
            web.route("*", "/private/{country}/{language}/{devid}/{apptype}/{appversion}/{devtype}/{aid}/user/logout", authhandler.logout, name="v1_user_logout"),
            web.route("*", "/private/{country}/{language}/{devid}/{apptype}/{appversion}/{devtype}/{aid}/user/checkAgreement", self.handle_checkAgreement,name="v1_user_checkAgreement"),
            web.route("*", "/private/{country}/{language}/{devid}/{apptype}/{appversion}/{devtype}/{aid}/user/checkAgreementBatch", self.handle_checkAgreement,name="v1_user_checkAgreementBatch"),
            web.route("*", "/private/{country}/{language}/{devid}/{apptype}/{appversion}/{devtype}/{aid}/user/getUserAccountInfo", authhandler.getUserAccountInfo,name="v1_user_getUserAccountInfo"),
            web.route("*", "/private/{country}/{language}/{devid}/{apptype}/{appversion}/{devtype}/{aid}/user/getUserMenuInfo", self.handle_getUserMenuInfo,name="v1_user_getUserMenuInfo"),
       # Direct register from app:
        # /{apiversion}/private/{country}/{language}/{devid}/{apptype}/{appversion}/{devtype}/{aid}/user/directRegister
        #Register by email
        # /registerByEmail
    
        ]

        self.get_milli_time = bumper.ConfServer.ConfServer_GeneralFunctions().get_milli_time 
开发者ID:bmartin5692,项目名称:bumper,代码行数:26,代码来源:bumper_confserver_v1_private_user.py

示例2: __init__

# 需要导入模块: from aiohttp import web [as 别名]
# 或者: from aiohttp.web import route [as 别名]
def __init__(self):
        self.name = "portal_api_pim"
        self.plugin_type = "sub_api"        
        self.sub_api = "portal_api"
        
        self.routes = [
                          
            web.route("*", "/pim/product/getProductIotMap", self.handle_getProductIotMap, name="portal_api_pim_getProductIotMap"),
            web.route("*", "/pim/file/get/{id}", self.handle_pimFile, name="portal_api_pim_file"),
            web.route("*", "/pim/product/getConfignetAll", self.handle_getConfignetAll, name="portal_api_pim_getConfignetAll"),
            web.route("*", "/pim/product/getConfigGroups", self.handle_getConfigGroups, name="portal_api_pim_getConfigGroups"),
            web.route("*", "/pim/dictionary/getErrDetail", self.handle_getErrDetail, name="portal_api_pim_getErrDetail"),

        ]

        self.get_milli_time = bumper.ConfServer.ConfServer_GeneralFunctions().get_milli_time 
开发者ID:bmartin5692,项目名称:bumper,代码行数:18,代码来源:bumper_confserver_portal_pim.py

示例3: start

# 需要导入模块: from aiohttp import web [as 别名]
# 或者: from aiohttp.web import route [as 别名]
def start(self):
        app = web.Application()
        app.add_routes([web.route('*', '/{tail:.*}', self.handle_request)])
        aiohttp_jinja2.setup(
            app, loader=jinja2.FileSystemLoader(self.dir)
        )
        middleware = SnareMiddleware(
            error_404=self.meta['/status_404'].get('hash'),
            headers=self.meta['/status_404'].get('headers', []),
            server_header=self.run_args.server_header
        )
        middleware.setup_middlewares(app)

        self.runner = web.AppRunner(app)
        await self.runner.setup()
        site = web.TCPSite(
            self.runner,
            self.run_args.host_ip,
            self.run_args.port)

        await site.start()
        names = sorted(str(s.name) for s in self.runner.sites)
        print("======== Running on {} ========\n"
              "(Press CTRL+C to quit)".format(', '.join(names))) 
开发者ID:mushorg,项目名称:snare,代码行数:26,代码来源:server.py

示例4: __init__

# 需要导入模块: from aiohttp import web [as 别名]
# 或者: from aiohttp.web import route [as 别名]
def __init__(self):
        self.notif = NotificationDB.instance()
        self.app = web.Application()
        self.app.add_routes([
            web.route('*', '/', self.home),
            web.get("/v1/notifications/block/{block}", self.get_by_block),
            web.get("/v1/notifications/addr/{address}", self.get_by_addr),
            web.get("/v1/notifications/tx/{tx_hash}", self.get_by_tx),
            web.get("/v1/notifications/contract/{contract_hash}", self.get_by_contract),
            web.get("/v1/token/{contract_hash}", self.get_token),
            web.get("/v1/tokens", self.get_tokens),
            web.get("/v1/status", self.get_status)
        ])

    #
    # REST API Routes
    # 
开发者ID:CityOfZion,项目名称:neo-python,代码行数:19,代码来源:RestApi.py

示例5: __init__

# 需要导入模块: from aiohttp import web [as 别名]
# 或者: from aiohttp.web import route [as 别名]
def __init__(self):

        self.name = "v2_private_user"
        self.plugin_type = "sub_api"                
        self.sub_api = "api_v2"

        authhandler = bumper.ConfServer.ConfServer_AuthHandler()
        self.routes = [
            web.route("*", "/private/{country}/{language}/{devid}/{apptype}/{appversion}/{devtype}/{aid}/user/checkLogin", authhandler.login, name="v2_user_checkLogin"),      
        ]

        self.get_milli_time = bumper.ConfServer.ConfServer_GeneralFunctions().get_milli_time 
开发者ID:bmartin5692,项目名称:bumper,代码行数:14,代码来源:bumper_confserver_v2_private_user.py

示例6: __init__

# 需要导入模块: from aiohttp import web [as 别名]
# 或者: from aiohttp.web import route [as 别名]
def __init__(self):
        self.name = "portal_api_users"
        self.plugin_type = "sub_api"        
        self.sub_api = "portal_api"
        
        self.routes = [

            web.route("*", "/users/user.do", self.handle_usersapi, name="portal_api_users_user"),

        ]

        self.get_milli_time = bumper.ConfServer.ConfServer_GeneralFunctions().get_milli_time 
开发者ID:bmartin5692,项目名称:bumper,代码行数:14,代码来源:bumper_confserver_portal_users.py

示例7: __init__

# 需要导入模块: from aiohttp import web [as 别名]
# 或者: from aiohttp.web import route [as 别名]
def __init__(self):
        self.name = "v1_global_auth"
        self.plugin_type = "sub_api"
        self.sub_api = "api_v1"
        
        authhandler = bumper.ConfServer.ConfServer_AuthHandler()
        self.routes = [
            web.route("*", "/global/auth/getAuthCode", authhandler.get_AuthCode, name="v1_global_auth_getAuthCode"),            
        ]

        self.get_milli_time = bumper.ConfServer.ConfServer_GeneralFunctions().get_milli_time 
开发者ID:bmartin5692,项目名称:bumper,代码行数:13,代码来源:bumper_confserver_v1_global_auth.py

示例8: __init__

# 需要导入模块: from aiohttp import web [as 别名]
# 或者: from aiohttp.web import route [as 别名]
def __init__(self):
        self.name = "v1_private_shop"
        self.plugin_type = "sub_api"        
        self.sub_api = "api_v1"
        
        self.routes = [
              
            web.route("*", "/private/{country}/{language}/{devid}/{apptype}/{appversion}/{devtype}/{aid}/shop/getCnWapShopConfig", self.handle_getCnWapShopConfig, name="v1_shop_getCnWapShopConfig"),

        ]

        self.get_milli_time = bumper.ConfServer.ConfServer_GeneralFunctions().get_milli_time 
开发者ID:bmartin5692,项目名称:bumper,代码行数:14,代码来源:bumper_confserver_v1_private_shop.py

示例9: __init__

# 需要导入模块: from aiohttp import web [as 别名]
# 或者: from aiohttp.web import route [as 别名]
def __init__(self):
        self.name = "v1_private_message"
        self.plugin_type = "sub_api"        
        self.sub_api = "api_v1"
        
        self.routes = [

            web.route("*", "/private/{country}/{language}/{devid}/{apptype}/{appversion}/{devtype}/{aid}/message/hasUnreadMsg", self.handle_hasUnreadMessage, name="v1_message_hasUnreadMsg"),
            web.route("*", "/private/{country}/{language}/{devid}/{apptype}/{appversion}/{devtype}/{aid}/message/getMsgList", self.handle_getMsgList, name="v1_message_getMsgList"),

        ]

        self.get_milli_time = bumper.ConfServer.ConfServer_GeneralFunctions().get_milli_time 
开发者ID:bmartin5692,项目名称:bumper,代码行数:15,代码来源:bumper_confserver_v1_private_message.py

示例10: __init__

# 需要导入模块: from aiohttp import web [as 别名]
# 或者: from aiohttp.web import route [as 别名]
def __init__(self):
        self.name = "v1_private_ad"
        self.plugin_type = "sub_api"        
        self.sub_api = "api_v1"
        
        self.routes = [
            web.route("*", "/private/{country}/{language}/{devid}/{apptype}/{appversion}/{devtype}/{aid}/ad/getAdByPositionType", self.handle_getAdByPositionType, name="v1_ad_getAdByPositionType"),
            web.route("*", "/private/{country}/{language}/{devid}/{apptype}/{appversion}/{devtype}/{aid}/ad/getBootScreen", self.handle_getBootScreen, name="v1_ad_getBootScreen"),

        ]

        self.get_milli_time = bumper.ConfServer.ConfServer_GeneralFunctions().get_milli_time 
开发者ID:bmartin5692,项目名称:bumper,代码行数:14,代码来源:bumper_confserver_v1_private_ad.py

示例11: __init__

# 需要导入模块: from aiohttp import web [as 别名]
# 或者: from aiohttp.web import route [as 别名]
def __init__(self):
        self.name = "portal_api_appsvr"
        self.plugin_type = "sub_api"        
        self.sub_api = "portal_api"
        
        self.routes = [
      
            web.route("*", "/appsvr/app.do", self.handle_appsvr_api, name="portal_api_appsvr_app"),

        ]

        self.get_milli_time = bumper.ConfServer.ConfServer_GeneralFunctions().get_milli_time 
开发者ID:bmartin5692,项目名称:bumper,代码行数:14,代码来源:bumper_confserver_portal_appsvr.py

示例12: __init__

# 需要导入模块: from aiohttp import web [as 别名]
# 或者: from aiohttp.web import route [as 别名]
def __init__(self):
        self.name = "v1_private_campaign"
        self.plugin_type = "sub_api"        
        self.sub_api = "api_v1"
        
        self.routes = [

            web.route("*", "/private/{country}/{language}/{devid}/{apptype}/{appversion}/{devtype}/{aid}/campaign/homePageAlert", self.handle_homePageAlert, name="v1_campaign_homePageAlert"),

        ]

        self.get_milli_time = bumper.ConfServer.ConfServer_GeneralFunctions().get_milli_time 
开发者ID:bmartin5692,项目名称:bumper,代码行数:14,代码来源:bumper_confserver_v1_private_campaign.py

示例13: __init__

# 需要导入模块: from aiohttp import web [as 别名]
# 或者: from aiohttp.web import route [as 别名]
def __init__(self):
        self.name = "portal_api_neng"
        self.plugin_type = "sub_api"        
        self.sub_api = "portal_api"
        
        self.routes = [
                
            web.route("*", "/neng/message/hasUnreadMsg", self.handle_neng_hasUnreadMessage, name="portal_api_neng_hasUnreadMessage"),
            web.route("*", "/neng/message/getShareMsgs", self.handle_neng_getShareMsgs, name="portal_api_neng_getShareMsgs"),
            web.route("*", "/neng/message/getlist", self.handle_neng_getlist, name="portal_api_neng_getlist"),

        ]

        self.get_milli_time = bumper.ConfServer.ConfServer_GeneralFunctions().get_milli_time 
开发者ID:bmartin5692,项目名称:bumper,代码行数:16,代码来源:bumper_confserver_portal_neng.py

示例14: __init__

# 需要导入模块: from aiohttp import web [as 别名]
# 或者: from aiohttp.web import route [as 别名]
def __init__(self):
        self.name = "portal_api_lg"
        self.plugin_type = "sub_api"        
        self.sub_api = "portal_api"
        
        self.routes = [

            web.route("*", "/lg/log.do", self.handle_lg_log, name="portal_api_lg_log"),

        ]

        self.get_milli_time = bumper.ConfServer.ConfServer_GeneralFunctions().get_milli_time 
开发者ID:bmartin5692,项目名称:bumper,代码行数:14,代码来源:bumper_confserver_portal_lg.py

示例15: __init__

# 需要导入模块: from aiohttp import web [as 别名]
# 或者: from aiohttp.web import route [as 别名]
def __init__(self):
        self.name = "upload_global"
        self.plugin_type = "sub_api"        
        self.sub_api = "upload_api"
        
        self.routes = [
                          
            web.route("*", "/global/{year}/{month}/{day}/{fileid}", self.handle_upload_global_file, name="upload_global_getFile"),          

        ]

        self.get_milli_time = bumper.ConfServer.ConfServer_GeneralFunctions().get_milli_time 
开发者ID:bmartin5692,项目名称:bumper,代码行数:14,代码来源:bumper_confserver_upload_global.py


注:本文中的aiohttp.web.route方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。