api_test.py 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. import requests
  2. import json
  3. # url = "http://172.18.1.189:7860/brandanalysis/api/v1/keyword"
  4. # payload = {
  5. # "brand_name": "李宁",
  6. # "shop_detail_info_brand_name": "李宇",
  7. # "title": "休闲运动短袖T恤速干男子跑步健身圆领半袖上衣",
  8. # }
  9. # headers = {'Content-Type': 'application/json'}
  10. # response = requests.post(url, data=json.dumps(payload), headers=headers)
  11. # print(response.json())
  12. # url = "http://172.18.1.189:7860/brandanalysis/api/v1/license"
  13. # payload = {
  14. # "brand_name": "李宁",
  15. # "title": "李宁烈骏7 PRO V2男子䨻丝高回弹缓震稳定跑鞋",
  16. # }
  17. # headers = {'Content-Type': 'application/json'}
  18. # response = requests.post(url, data=json.dumps(payload), headers=headers)
  19. # print(response.json())
  20. # url = "https://670813644644357-http-7860.northwest1.gpugeek.com:8443/brandanalysis/api/v1/logo"
  21. # payload = {
  22. # "brand_name": "李宁",
  23. # "image_url": "http://h2.appsimg.com/a.appsimg.com/upload/merchandise/pdcvis/2024/12/13/131/82a925f9-14af-4be3-bf78-3262f7909482.jpg",
  24. # }
  25. # headers = {'Content-Type': 'application/json'}
  26. # response = requests.post(url, data=json.dumps(payload), headers=headers)
  27. # print(response.json())
  28. url = "https://670813644644357-http-7860.northwest1.gpugeek.com:8443/brandanalysis/api/v1/infringe_judgement"
  29. # url = "http://172.18.1.189:7860/brandanalysis/api/v1/infringe_judgement"
  30. url_data = {
  31. 'title': '李宁超轻21男跑鞋2024年新款反光䨻丝高回弹轻质透气缓震ARBU001',
  32. 'brand_name': '李宁',
  33. 'product_images': [
  34. "https://gw.alicdn.com/imgextra/O1CN01DoWU8A1JdrhxBBsmP_!!3378851052.jpg_q95.jpg_.webp",
  35. "https://img.alicdn.com/imgextra/i4/3378851052/O1CN01E1epnW1JdrgxCnPpR_!!3378851052.jpg_q75.jpg_.webp",
  36. "https://img.alicdn.com/imgextra/i2/3378851052/O1CN01Kx7yq11JdrgEO6kSN_!!3378851052.jpg_q75.jpg_.webp",
  37. "https://img.alicdn.com/imgextra/i1/3378851052/O1CN010sutlV1JdrgGP4GTI_!!3378851052.jpg_q75.jpg_.webp",
  38. "https://img.alicdn.com/imgextra/i3/3378851052/O1CN0190Cvpw1JdriE6otol_!!3378851052.jpg_q75.jpg_.webp",
  39. "https://img.alicdn.com/imgextra/i4/3378851052/O1CN01SsCo6a1JdriD00UuX_!!3378851052.jpg_q75.jpg_.webp"
  40. ],
  41. 'price': 19.9
  42. }
  43. basic_data = {
  44. 'product_name': '25李宁赤兔8PRO蛇年跑步鞋男回弹减震透气竞速训练专业比赛运动鞋',
  45. 'brand_name': '李宁',
  46. 'similarity_logos': ["李宇", "李I宁"],
  47. 'product_images': [
  48. "https://gw.alicdn.com/imgextra/O1CN01EFpxoy1JdrhyyD8Gp_!!3378851052.jpg_q95.jpg_.webp",
  49. "https://img.alicdn.com/imgextra/i2/3378851052/O1CN01N1VBKz1JdriDQ7v3s_!!3378851052.jpg_q75.jpg_.webp",
  50. "https://img.alicdn.com/imgextra/i4/3378851052/O1CN01d1T16h1JdriBxQW8j_!!3378851052.jpg_q75.jpg_.webp",
  51. "https://img.alicdn.com/imgextra/i4/3378851052/O1CN01O5Gb861JdriAyGLo0_!!3378851052.jpg_q75.jpg_.webp",
  52. "https://img.alicdn.com/imgextra/i1/3378851052/O1CN01WT8Kg81JdriDTZ4lq_!!3378851052.jpg_q75.jpg_.webp",
  53. "https://img.alicdn.com/imgextra/i2/3378851052/O1CN01v4KL0D1JdriCrG3SH_!!3378851052.jpg_q75.jpg_.webp"
  54. ],
  55. 'base_price': 0,
  56. 'price_percent': 0
  57. }
  58. payload = {
  59. 'url_data': url_data,
  60. 'basic_data': basic_data,
  61. 'judgement_type': [1]
  62. }
  63. headers = {'Content-Type': 'application/json'}
  64. response = requests.post(url, data=json.dumps(payload), headers=headers)
  65. print(response.json())