()
| 60 | |
| 61 | @app.route('/click_ad', methods=['POST']) |
| 62 | def click_ad(): |
| 63 | result = 'OK' |
| 64 | if request.form['advertisement_id'] == 'A': |
| 65 | banditA.add_click() |
| 66 | elif request.form['advertisement_id'] == 'B': |
| 67 | banditB.add_click() |
| 68 | else: |
| 69 | result = 'Invalid Input.' |
| 70 | |
| 71 | # nothing to return really |
| 72 | return jsonify({'result': result}) |
| 73 | |
| 74 | |
| 75 | if __name__ == '__main__': |