DmitrMakeev commited on
Commit
d9cb7f1
1 Parent(s): f267462

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -18,8 +18,12 @@ def predict():
18
  def avp():
19
  incoming = request.get_json()
20
  print(incoming)
21
- # Обработка POST запроса по пути "/avp"
22
- response = {"bazis": incoming["bazis"]}
23
- return jsonify(response)
 
 
 
 
24
  if __name__ == '__main__':
25
  app.run(host='0.0.0.0', port=int(os.environ.get('PORT', 7860)))
 
18
  def avp():
19
  incoming = request.get_json()
20
  print(incoming)
21
+ for key, value in incoming.items():
22
+ if int(value) > 0:
23
+ incoming[key] = str(int(value) - 1)
24
+ else:
25
+ incoming[key] = "0"
26
+ response = jsonify(incoming)
27
+ return response
28
  if __name__ == '__main__':
29
  app.run(host='0.0.0.0', port=int(os.environ.get('PORT', 7860)))