123456789101112131415161718192021222324252627282930313233 |
- import datetime
- import logging
- import traceback
- import requests
- from flask import json # To read json data
- from flask import request # To receive headers
- from flask import Flask # To be able to start the application
- from rocketmq.client import Producer, Message
- from ConfConstant import ConfConstant
- from report.AccountReport import AccountReport
- app = Flask(__name__)
- @app.route('/')
- def api_root():
- return 'Welcome guys'
- @app.route('/webhook/account', methods=['POST'])
- def api_webhook_messages():
- my_info = json.loads(request.param)
- account_id = my_info["account_id"]
- start_date = my_info["start_time"]
- end_date = my_info["end_time"]
- date_type = my_info["date_type"]
- AccountReport().handler(date_type, account_id, start_date, end_date)
- if __name__ == '__main__':
- app.run(port=8765, host=ConfConstant.URL, debug=True)
|