Flask项目中使用蓝湖实现启动项配置——多个controller项

项目结构

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!'})

未完待续。。。。。

相关推荐
Kylin5243 分钟前
Java实验二
java·开发语言·python
深度学习lover13 分钟前
<数据集>苹果识别数据集<目标检测>
人工智能·python·yolo·目标检测·计算机视觉·苹果识别
DreamNotOver2 小时前
自动提取pdf公式 ➕ 输出 LaTeX
python·pdf·gui·提取公式
Jacky-0083 小时前
python reportlab模块----操作PDF文件
python
chenchihwen3 小时前
Python合并多个pdf
开发语言·python·pdf
小怪瘦794 小时前
IDEA :物联网ThingsBoard-gateway配置,运行Python版本,连接thingsboard,接入 MQTT 设备
python·物联网·gateway·idea
墨绿色的摆渡人5 小时前
pytorch小记(十六):PyTorch中的`nn.Identity()`详解:灵活模型设计的秘密武器
人工智能·pytorch·python
TimeDoor5 小时前
整理我的macos的复杂混乱的python环境
开发语言·python·macos
懒羊羊不进村5 小时前
Python深度学习基础——深度神经网络(DNN)(PyTorch)
python·深度学习·dnn
jz_ddk5 小时前
[实战]多天线空域抗干扰技术:原理、数学推导与工程仿真(完整仿真代码)
python·算法·毕业设计·信号处理