sc-common-interface 2.4.7__tar.gz → 2.4.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sc-common-interface
3
- Version: 2.4.7
3
+ Version: 2.4.8
4
4
  Summary: SC贴文销售公用的接口
5
5
  Home-page: UNKNOWN
6
6
  Author: river
@@ -282,7 +282,7 @@ def live_search_oa_product(data):
282
282
  """
283
283
  env = data["env"]
284
284
  headers = data["headers"]
285
- url = "%s/openApi/proxy/v1/products?page=1&per_page=20" %env
285
+ url = "%s/openApi/proxy/v1/products?page=1&per_page=50" %env
286
286
  type = "spu"
287
287
  quantity = 100
288
288
  if "type" in data:
@@ -469,10 +469,8 @@ def create_live(data):
469
469
  salesOwner = data["salesOwner"]
470
470
  if "platform" in data:
471
471
  platform = data["platform"]
472
-
473
472
  if "patternModel" in data:
474
473
  patternModel = data["patternModel"]
475
-
476
474
  if "keywordValidInLive" in data:
477
475
  keywordValidInLive = data["keywordValidInLive"]
478
476
  if "keywordValidAfterLive" in data:
@@ -583,20 +581,6 @@ def create_live(data):
583
581
  platformSubType = platform.split("&")[0].upper()
584
582
  data["platform"] = "FACEBOOK"
585
583
  res = get_channel(data)
586
- # expireTime = res["data"][0]["expireTime"]
587
- # expireTimeTimestamp = res["data"][0]["expireTimeTimestamp"]
588
- # validToken = res["data"][0]["validToken"]
589
- # validScope = res["data"][0]["validScope"]
590
- # oneTimeNotifyStatus = res["data"][0]["oneTimeNotifyStatus"]
591
- # mainChannel = res["data"][0]["mainChannel"]
592
- # platformChannelAvatar = res["data"][0]["platformChannelAvatar"]
593
- # platformChannelId = res["data"][0]["platformChannelId"]
594
- # parentChannelId = res["data"][0]["parentChannelId"]
595
- # groupId = res["data"][0]["groupId"]
596
- # platformChannelName = res["data"][0]["platformChannelName"]
597
- # privacy = res["data"][0]["privacy"]
598
- # customerAuthLink = res["data"][0]["customerAuthLink"]
599
- # subscribedStatus = res["data"][0]["subscribedStatus"]
600
584
  body = {
601
585
  "sales": {
602
586
  "title": title,
@@ -684,8 +668,47 @@ def create_live(data):
684
668
  }
685
669
  }
686
670
  }
671
+ elif platform in ("pl","obc"):
672
+ platformSubType = platform.upper()
673
+ platform = "SHOPLINE"
674
+ body = {
675
+ "sales": {
676
+ "title": title,
677
+ "salesOwner": salesOwner,
678
+ "salesDescription": salesDescription,
679
+ "platforms": [
680
+ platform
681
+ ],
682
+ "platformChannels": [],
683
+ "startTime": startTime,
684
+ "endTime": endTime,
685
+ "platformSubType":platformSubType
686
+ },
687
+ "salesConfig": {
688
+ "patternModel": {
689
+ "patternModel": patternModel,
690
+ "keywordValidInLive": keywordValidInLive,
691
+ "keywordValidAfterLive": keywordValidAfterLive
692
+ },
693
+ "autoNotifyPay": {
694
+ "enable": autoNotifyPayEnable,
695
+ "message": autoNotifyPayMessage,
696
+ "button": autoNotifyPayButton
697
+ },
698
+ "stock": {
699
+ "lockStock": stockEnable,
700
+ "salesStockLockExpireTime": stockIime
701
+ },
702
+ "lowOfQuantity": {
703
+ "enable": lowOfQuantityEnable,
704
+ "sound": lowOfQuantitySound,
705
+ "quantity": lowOfQuantityQuantity
706
+ }
707
+ },
708
+ "postConfigMap":{}
709
+ }
687
710
  response = requests.post(url,headers=headers,json=body).json()
688
- print(json.dumps(body))
711
+ # print(json.dumps(body))
689
712
  print(response)
690
713
  sales_id = response["data"]["sales"]["id"]
691
714
  return sales_id
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sc-common-interface
3
- Version: 2.4.7
3
+ Version: 2.4.8
4
4
  Summary: SC贴文销售公用的接口
5
5
  Home-page: UNKNOWN
6
6
  Author: river
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='sc-common-interface',
5
- version='2.4.7',
5
+ version='2.4.8',
6
6
  description='SC贴文销售公用的接口',
7
7
  author='river',
8
8
  packages=find_packages(),