You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

36 lines
937 B

  1. import re
  2. from common import util
  3. from common import curl_interface
  4. from django.conf import settings
  5. def get_prod_info(prod_id):
  6. # 参数校验
  7. if re.match('^[1-9][0-9]{0,10}', prod_id) is None:
  8. return util.re_err('参数错误')
  9. send_data = {
  10. 'pro_cate_id': prod_id
  11. }
  12. curl = curl_interface.CurlInterface(send_data, 4)
  13. get_info = curl.exec(settings.WX_HOST + '/zzcx/home/men-p/initialize', 'POST')
  14. return get_info
  15. def get_stock(prod_id, date):
  16. """
  17. 获取门票票种信息
  18. :param prod_id:
  19. :param date:
  20. :return:
  21. """
  22. # 参数校验
  23. if re.match('^[1-9][0-9]{0,10}', prod_id) is None:
  24. return util.re_err('参数错误')
  25. send_data = {
  26. 'prod_cate_id': prod_id,
  27. 'date': date
  28. }
  29. curl = curl_interface.CurlInterface(send_data, 4)
  30. result = curl.exec(settings.WX_HOST + '/zzcx/home/men-p/get-prod-arr', 'POST')
  31. return result