sc-common-interface 2.5.5__tar.gz → 2.5.7__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.5.5
3
+ Version: 2.5.7
4
4
  Summary: SC贴文销售公用的接口
5
5
  Home-page: UNKNOWN
6
6
  Author: river
@@ -765,7 +765,7 @@ def edit_live_info(data):
765
765
  no_interaction_message_first = ""
766
766
  second_message = ""
767
767
  first_message_button = ""
768
- second_message_button = " ️"
768
+ second_message_button = "️"
769
769
  need_send_message = True
770
770
  has_link = True
771
771
  commentIntent = True
@@ -1511,7 +1511,8 @@ def get_stock_product_set(res,type="stock"):
1511
1511
  break
1512
1512
  keyword = combination["keywords"][0]
1513
1513
  product_id = i["id"]
1514
- return keyword, product_id, list_data
1514
+ combination_id = combination["id"]
1515
+ return keyword, product_id, combination_id,i
1515
1516
  elif type=="out":
1516
1517
  for i in list_data:
1517
1518
  combinationList = i["combinationList"]
@@ -1523,310 +1524,31 @@ def get_stock_product_set(res,type="stock"):
1523
1524
  if quantity != -1 and quantity < count:
1524
1525
  keyword = combination["keywords"][0]
1525
1526
  product_id = i["id"]
1526
- return keyword, product_id, list_data
1527
+ combination_id = combination["id"]
1528
+ return keyword, product_id, combination_id,i
1527
1529
 
1530
+ def change_product_set_keyword_status(data):
1531
+ env = data["env"]
1532
+ headers = data["headers"]
1533
+ sales_id = data["sales_id"]
1534
+ product_id = data["product_id"]
1535
+ status = True
1536
+ if "status" in data:
1537
+ status = data["status"]
1538
+ url = "%s/admin/api/bff-web/live/sale/%s/sale_list/product_set/keyword/status" % (env, sales_id)
1539
+ body = {
1540
+ "ids": [
1541
+ product_id
1542
+ ],
1543
+ "status": status
1544
+ }
1545
+ response = requests.put(url, headers=headers, json=body).json()
1546
+ return response
1528
1547
 
1529
1548
 
1530
1549
 
1531
1550
 
1532
1551
  if __name__=="__main__":
1533
- data = {
1534
- "success": True,
1535
- "code": "SUCCESS",
1536
- "message": "success",
1537
- "data": {
1538
- "pageInfo": {
1539
- "pageNum": 1,
1540
- "pageSize": 10,
1541
- "total": 4,
1542
- "lastPage": True
1543
- },
1544
- "list": [
1545
- {
1546
- "id": "673c889f3dc982185de87d1c",
1547
- "image": "https://shoplineimg.com/61a87c9763b70c005106fbd0/673c889b52b9d600110bfc1c/50xf.webp?source_format=png&cheap_resize=1",
1548
- "title": "ffsssdsfsfsf",
1549
- "recommend": {
1550
- "isActivity": True,
1551
- "recommendTime": None
1552
- },
1553
- "effectiveKey": True,
1554
- "defaultKey": "",
1555
- "combinationList": [
1556
- {
1557
- "id": "46df6fa5b6af8bcbec7aa28db26f1eae",
1558
- "price": {
1559
- "originCents": 455,
1560
- "origin": "455 ₫",
1561
- "salesCents": 55,
1562
- "sales": "55 ₫"
1563
- },
1564
- "keywords": [
1565
- "组合商品关键字1732346557"
1566
- ],
1567
- "products": [
1568
- {
1569
- "spuId": "673c311f52b9d659d30bf878",
1570
- "skuId": "673c311f52b9d659d30bf878",
1571
- "count": 2,
1572
- "name": "inbox自定义商品",
1573
- "quantity": -1,
1574
- "unlimitedQuantity": True
1575
- },
1576
- {
1577
- "spuId": "673c2e5a3dc982185de87b57",
1578
- "skuId": "673c2e5a3dc982185de87b57",
1579
- "count": 2,
1580
- "name": "自定义商品哈哈哈",
1581
- "quantity": 9999,
1582
- "unlimitedQuantity": True
1583
- }
1584
- ],
1585
- "buyerProductCount": 0
1586
- }
1587
- ],
1588
- "availableStartTime": None,
1589
- "availableEndTime": None,
1590
- "tempPrice": {
1591
- "originCents": 455,
1592
- "origin": "455 ₫",
1593
- "salesCents": 55,
1594
- "sales": "55 ₫"
1595
- },
1596
- "childrenInfo": {
1597
- "673c2e5a3dc982185de87b57": {
1598
- "necessaryQuantity": 2,
1599
- "variations": []
1600
- },
1601
- "673c311f52b9d659d30bf878": {
1602
- "necessaryQuantity": 2,
1603
- "variations": []
1604
- }
1605
- },
1606
- "status": "active"
1607
- },
1608
- {
1609
- "id": "670f8a6c7fb2d15f7b8f6431",
1610
- "image": "https://shoplineimg.com/61a87c9763b70c005106fbd0/670f8a57b7b2cb000a26a9f6/50xf.webp?source_format=jpeg&cheap_resize=1",
1611
- "title": "dyy超长的组合商品yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy",
1612
- "recommend": {
1613
- "isActivity": True,
1614
- "recommendTime": None
1615
- },
1616
- "effectiveKey": True,
1617
- "defaultKey": "",
1618
- "combinationList": [
1619
- {
1620
- "id": "c536c6eaffa7364a1dac2743aeff518a",
1621
- "price": {
1622
- "originCents": 100,
1623
- "origin": "100 ₫",
1624
- "salesCents": 90,
1625
- "sales": "90 ₫"
1626
- },
1627
- "keywords": [
1628
- "LYQYH1730649250892"
1629
- ],
1630
- "products": [
1631
- {
1632
- "spuId": "670f8a48b7b2cb384126a9bc",
1633
- "skuId": "670f8a48db1762000bcedfc8",
1634
- "count": 2,
1635
- "name": "dyy超长的商品yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy(dyy超长的商品yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy)",
1636
- "quantity": -1,
1637
- "unlimitedQuantity": True
1638
- },
1639
- {
1640
- "spuId": "670f84314149e400117b3c6a",
1641
- "skuId": "670f84314bd7dd001035d0ea",
1642
- "count": 51,
1643
- "name": "多规格商品名称1729070129(红)",
1644
- "quantity": 50,
1645
- "unlimitedQuantity": True
1646
- }
1647
- ],
1648
- "buyerProductCount": 0
1649
- }
1650
- ],
1651
- "availableStartTime": None,
1652
- "availableEndTime": None,
1653
- "tempPrice": {
1654
- "originCents": 100,
1655
- "origin": "100 ₫",
1656
- "salesCents": 90,
1657
- "sales": "90 ₫"
1658
- },
1659
- "childrenInfo": {
1660
- "670f84314149e400117b3c6a": {
1661
- "necessaryQuantity": 1,
1662
- "variations": [
1663
- "670f84314bd7dd001035d0ea"
1664
- ]
1665
- },
1666
- "670f8a48b7b2cb384126a9bc": {
1667
- "necessaryQuantity": 2,
1668
- "variations": [
1669
- "670f8a48db1762000bcedfc8",
1670
- "670f8a48db1762000bcedfc9"
1671
- ]
1672
- }
1673
- },
1674
- "status": "active"
1675
- },
1676
- {
1677
- "id": "670fc1bbb7b2cb161826a9c6",
1678
- "image": "https://shoplineimg.com/61a87c9763b70c005106fbd0/670fc196b7b2cbbdac26a7e2/50xf.webp?source_format=jpeg&cheap_resize=1",
1679
- "title": "dyy组合商品变动- 子商品从多规格 变成 无规格",
1680
- "recommend": {
1681
- "isActivity": True,
1682
- "recommendTime": None
1683
- },
1684
- "effectiveKey": True,
1685
- "defaultKey": "",
1686
- "combinationList": [
1687
- {
1688
- "id": "e869f56d1d94901903a3c6b5e775d37b",
1689
- "price": {
1690
- "originCents": 100,
1691
- "origin": "100 ₫",
1692
- "salesCents": 90,
1693
- "sales": "90 ₫"
1694
- },
1695
- "keywords": [
1696
- "DDAASS"
1697
- ],
1698
- "products": [
1699
- {
1700
- "spuId": "670fc182b7b2cb001026ab78",
1701
- "skuId": "670fc182b7b2cb001026ab78",
1702
- "count": 2,
1703
- "name": "dyy商品从多规格 变成 无规格",
1704
- "quantity": -1,
1705
- "unlimitedQuantity": True
1706
- },
1707
- {
1708
- "spuId": "670fbb5227a445000f12b050",
1709
- "skuId": "670fbb517e0510001fd941c9",
1710
- "count": 3,
1711
- "name": "模式4接口自动化添加的多规格商品1729084241(红,M)",
1712
- "quantity": 55,
1713
- "unlimitedQuantity": False
1714
- }
1715
- ],
1716
- "buyerProductCount": 0
1717
- },
1718
- {
1719
- "id": "f266f67781aa371f8348d331ffc77565",
1720
- "price": {
1721
- "originCents": 100,
1722
- "origin": "100 ₫",
1723
- "salesCents": 90,
1724
- "sales": "90 ₫"
1725
- },
1726
- "keywords": [
1727
- "MMM"
1728
- ],
1729
- "products": [
1730
- {
1731
- "spuId": "670fc182b7b2cb001026ab78",
1732
- "skuId": "670fc182b7b2cb001026ab78",
1733
- "count": 2,
1734
- "name": "dyy商品从多规格 变成 无规格",
1735
- "quantity": -1,
1736
- "unlimitedQuantity": True
1737
- },
1738
- {
1739
- "spuId": "670fbb5227a445000f12b050",
1740
- "skuId": "670fbb517e0510001fd941ca",
1741
- "count": 3,
1742
- "name": "模式4接口自动化添加的多规格商品1729084241(红, L)",
1743
- "quantity": 1,
1744
- "unlimitedQuantity": False
1745
- }
1746
- ],
1747
- "buyerProductCount": 0
1748
- }
1749
- ],
1750
- "availableStartTime": None,
1751
- "availableEndTime": None,
1752
- "tempPrice": {
1753
- "originCents": 100,
1754
- "origin": "100 ₫",
1755
- "salesCents": 90,
1756
- "sales": "90 ₫"
1757
- },
1758
- "childrenInfo": {
1759
- "670fbb5227a445000f12b050": {
1760
- "necessaryQuantity": 3,
1761
- "variations": [
1762
- "670fbb517e0510001fd941c9",
1763
- "670fbb517e0510001fd941ca",
1764
- "670fbb517e0510001fd941cb",
1765
- "670fbb517e0510001fd941cc"
1766
- ]
1767
- },
1768
- "670fc182b7b2cb001026ab78": {
1769
- "necessaryQuantity": 2,
1770
- "variations": []
1771
- }
1772
- },
1773
- "status": "active"
1774
- },
1775
- {
1776
- "id": "670fc567b7b2cb000a26ab86",
1777
- "image": "https://shoplineimg.com/61a87c9763b70c005106fbd0/670fc54eb7b2cbbdac26a7e3/50xf.webp?source_format=jpeg&cheap_resize=1",
1778
- "title": "组合商品下的子商品被删除了",
1779
- "recommend": {
1780
- "isActivity": False,
1781
- "recommendTime": "2024-11-18T20:31:57+08:00"
1782
- },
1783
- "effectiveKey": True,
1784
- "defaultKey": "",
1785
- "combinationList": [
1786
- {
1787
- "id": "ea4838a97018ddd345099847945ac38b",
1788
- "price": {
1789
- "originCents": 100,
1790
- "origin": "100 ₫",
1791
- "salesCents": 90,
1792
- "sales": "90 ₫"
1793
- },
1794
- "keywords": [
1795
- "FFDDD",
1796
- "GGSS"
1797
- ],
1798
- "products": [
1799
- {
1800
- "spuId": "670fc53eb7b2cbfe9926a836",
1801
- "skuId": "670fc53eb7b2cbfe9926a836",
1802
- "count": 2,
1803
- "name": "dyy这个商品是要被删除的额",
1804
- "quantity": -1,
1805
- "unlimitedQuantity": True
1806
- }
1807
- ],
1808
- "buyerProductCount": 0
1809
- }
1810
- ],
1811
- "availableStartTime": None,
1812
- "availableEndTime": None,
1813
- "tempPrice": {
1814
- "originCents": 100,
1815
- "origin": "100 ₫",
1816
- "salesCents": 90,
1817
- "sales": "90 ₫"
1818
- },
1819
- "childrenInfo": {
1820
- "670fc53eb7b2cbfe9926a836": {
1821
- "necessaryQuantity": 2,
1822
- "variations": []
1823
- }
1824
- },
1825
- "status": "active"
1826
- }
1827
- ]
1828
- },
1829
- "traceId": "13f3a0b22dc91017817f0f74756031cf"
1830
- }
1831
- keyword,spuid,__ = get_stock_product_set(data,"out")
1832
- print(keyword)
1552
+ data = {'headers': {'authorization': 'Bearer eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiIzN2Y2MjY2M2IyMTI1MjIzMWZlMTc4MTE2ODhkNDliYSIsImRhdGEiOnsibWVyY2hhbnRfaWQiOiI2MjI5YTdiYWVhNzA2NDJhOGI2NWViZGEiLCJhcHBsaWNhdGlvbl9pZCI6IjYwZWVjNWViZjhkYzkyMDAwNjUyZTAwNiJ9LCJpc3MiOiJodHRwczovL2RldmVsb3BlcnMteXkuc2hvcGxpbmVzdGcuY29tIiwiYXVkIjpbXSwic3ViIjoiNjIyOWE3YmFlYTcwNjQyYThiNjVlYmRhIn0.FwtntG1dAYWNUcEZf6WSehXQveEw_rvTSGPEM3xV9FA', 'lang': 'en', 'Content-Type': 'application/json'}, 'product_id': '66f413a8f1e8240039b7bdf6', 'env': 'https://front-service.shoplinestg.com', 'sales_id': '67088', 'key': '4f6b54deff90cdc9966cbe7b82731b3b'}
1553
+ res = change_product_set_keyword_status(data)
1554
+ print(res)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sc-common-interface
3
- Version: 2.5.5
3
+ Version: 2.5.7
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.5.5',
5
+ version='2.5.7',
6
6
  description='SC贴文销售公用的接口',
7
7
  author='river',
8
8
  packages=find_packages(),