4
0
This repository has been archived on 2020-07-25. You can view files and clone it, but cannot push or open issues or pull requests.
classification-service/classification_service/views/classify_view.py

16 lines
378 B
Python
Raw Normal View History

2020-04-15 00:33:06 +02:00
#!/usr/bin/env python3
from flask import request, jsonify
from flask_classful import FlaskView
from utils import json_required
2020-04-20 22:53:12 +02:00
import json
import uwsgi
2020-04-15 00:33:06 +02:00
class ClassifyView(FlaskView):
@json_required
def post(self):
2020-04-20 01:09:47 +02:00
task = request.json # tag, features, model
2020-04-20 22:53:12 +02:00
uwsgi.mule_msg(json.dumps(task))
2020-04-20 01:09:47 +02:00
return jsonify({"status": "OK", "msg": "enqueued"})