项目结构
python
# controller1-__init__.py
from flask import Blueprint
cont2_sale_blueprint = Blueprint('cont2_sale_blueprint', __name__)
cont2_user_blueprint = Blueprint('cont2_user_blueprint', __name__)
from . import user_controller
from . import sale_controller
python
# controller1-sale_controller
from flask import jsonify,current_app
from . import cont1_sale_blueprint
@cont1_sale_blueprint.route('/api/sample111', methods=['GET'])
def sample_route1():
return jsonify({'message': 'Hello, this is a sample route1!'})
@cont1_sale_blueprint.route('/api/sample1111', methods=['GET'])
def sample_route2():
return jsonify({'message': 'Hello, this is a sample route11!'})
python
# controller1-user_controller
from flask import jsonify,current_app
from . import cont1_user_blueprint
@cont1_user_blueprint.route('/api/sample1', methods=['GET'])
def sample_route1():
return jsonify({'message': 'Hello, this is a sample route1!'})
@cont1_user_blueprint.route('/api/sample11', methods=['GET'])
def sample_route2():
return jsonify({'message': 'Hello, this is a sample route11!'})
未完待续。。。。。