feat: auto clean.

This commit is contained in:
Zhang Muyu
2023-09-30 16:05:03 +08:00
parent 59aa4391c2
commit ff1fb2ebb2
5 changed files with 11 additions and 7 deletions

View File

@@ -6,6 +6,7 @@ from main.distance import *
from main.sa_pa import *
import json
import os
app = Flask(__name__)
@@ -15,35 +16,38 @@ CORS(app)
def common():
json_data = json.loads(request.args.get('data'))
theme = request.args.get('theme')
data = gen_common(json_data, theme)
data, path = gen_common(json_data, theme)
res = {
'code': 0,
'image': data,
}
response = make_response(res)
os.remove(path)
return response
@app.route('/api/pov-element/distance', methods=["GET"])
def distance():
json_data = json.loads(request.args.get('data'))
theme = request.args.get('theme')
data = gen_distance(json_data, theme)
data, path = gen_distance(json_data, theme)
res = {
'code': 0,
'image': data,
}
response = make_response(res)
os.remove(path)
return response
@app.route('/api/pov-element/service', methods=["GET"])
def service():
json_data = json.loads(request.args.get('data'))
data = gen_service(json_data)
data, path = gen_service(json_data)
res = {
'code': 0,
'image': data,
}
response = make_response(res)
os.remove(path)
return response
if __name__ == '__main__':