Initial commit of secondary development sample code
This commit is contained in:
23
接收大模型复审告警/app/__init__.py
Normal file
23
接收大模型复审告警/app/__init__.py
Normal file
@ -0,0 +1,23 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
from flask import Flask
|
||||
|
||||
CURRENT_PATH = os.path.dirname(os.path.realpath(__file__))
|
||||
sys.path.append(CURRENT_PATH)
|
||||
|
||||
url_prefix = '/'
|
||||
|
||||
from app import vlreview
|
||||
|
||||
|
||||
def create_app():
|
||||
# 初始化Flask对象
|
||||
app_ = Flask(__name__)
|
||||
|
||||
# 注册蓝图
|
||||
app_.register_blueprint(vlreview.bp)
|
||||
return app_
|
||||
|
||||
|
||||
app = create_app()
|
||||
15
接收大模型复审告警/app/vlreview.py
Normal file
15
接收大模型复审告警/app/vlreview.py
Normal file
@ -0,0 +1,15 @@
|
||||
import base64
|
||||
import json
|
||||
|
||||
from flask import Blueprint, request
|
||||
|
||||
from app import url_prefix
|
||||
|
||||
bp = Blueprint('vlreview', __name__, url_prefix=url_prefix)
|
||||
|
||||
|
||||
@bp.route('vlreview', methods=['POST'])
|
||||
def post_alert():
|
||||
data = json.loads(request.get_data().decode('utf-8'))
|
||||
print(data)
|
||||
return data
|
||||
Reference in New Issue
Block a user