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