Files
airflow/dags/business/business/rate.py
T
2022-08-22 14:57:58 +08:00

25 lines
846 B
Python

"""
消费或价格评级定时运行
"""
import requests
import logging
import sys
log = logging.getLogger(__name__)
type = sys.argv[1] if len(sys.argv) > 1 else ''
print("输出评级类型" + type)
if type == 'price':
log.info("定时楼盘评级开始。。。。。")
headers = {'Content-Type': 'application/json'}
url = "http://192.168.0.19:31080/FangJiaNlpService/price_rate"
if requests.get(url=url, headers=headers).text == 'success':
log.info("定时楼盘评级调用完毕。。。。。")
else:
log.info("定时消费评级开始。。。。。")
headers = {'Content-Type': 'application/json'}
url = "http://192.168.0.19:31080/FangJiaNlpService/consumption_rate"
if requests.get(url=url, headers=headers).text == 'success':
log.info("定时消费评级调用完毕。。。。。")