蓝图

作者: xueyueshuai | 来源:发表于2023-12-25 11:26 被阅读0次

    /app.py

    #!/usr/bin/python3
    from flask import Flask
    from controller.user import user_blueprint
    
    app = Flask(__name__)
    
    app.register_blueprint(user_blueprint)
    
    if __name__ == '__main__':
        app.run()
    
    

    /controller/user.py

    from flask import Blueprint
    
    user_blueprint = Blueprint('user', __name__)
    
    
    @user_blueprint.route('/user/add')
    def user_add():
        return '用户-add'
    
    
    @user_blueprint.route('/user/del')
    def user_del():
        return '用户-del'
    
    
    @user_blueprint.route('/user/update')
    def user_update():
        return '用户-update'
    
    
    @user_blueprint.route('/user/list')
    def user_list():
        return '用户-list'
    
    
    @user_blueprint.route('/user/info')
    def user_info():
        return '用户-info'
    
    

    相关文章

      网友评论

          本文标题:蓝图

          本文链接:https://www.haomeiwen.com/subject/uxyjgdtx.html