sc-common-interface 2.7.1__tar.gz → 2.7.2__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.
- {sc_common_interface-2.7.1 → sc_common_interface-2.7.2}/PKG-INFO +1 -1
- {sc_common_interface-2.7.1 → sc_common_interface-2.7.2}/sc_common_interface/LiveCommonInterface.py +137 -4
- {sc_common_interface-2.7.1 → sc_common_interface-2.7.2}/sc_common_interface.egg-info/PKG-INFO +1 -1
- {sc_common_interface-2.7.1 → sc_common_interface-2.7.2}/setup.py +1 -1
- {sc_common_interface-2.7.1 → sc_common_interface-2.7.2}/sc_common_interface/McCommonInterface.py +0 -0
- {sc_common_interface-2.7.1 → sc_common_interface-2.7.2}/sc_common_interface/Platform.py +0 -0
- {sc_common_interface-2.7.1 → sc_common_interface-2.7.2}/sc_common_interface/PostCommonInterface.py +0 -0
- {sc_common_interface-2.7.1 → sc_common_interface-2.7.2}/sc_common_interface/__init__.py +0 -0
- {sc_common_interface-2.7.1 → sc_common_interface-2.7.2}/sc_common_interface.egg-info/SOURCES.txt +0 -0
- {sc_common_interface-2.7.1 → sc_common_interface-2.7.2}/sc_common_interface.egg-info/dependency_links.txt +0 -0
- {sc_common_interface-2.7.1 → sc_common_interface-2.7.2}/sc_common_interface.egg-info/requires.txt +0 -0
- {sc_common_interface-2.7.1 → sc_common_interface-2.7.2}/sc_common_interface.egg-info/top_level.txt +0 -0
- {sc_common_interface-2.7.1 → sc_common_interface-2.7.2}/setup.cfg +0 -0
{sc_common_interface-2.7.1 → sc_common_interface-2.7.2}/sc_common_interface/LiveCommonInterface.py
RENAMED
|
@@ -1840,10 +1840,6 @@ def add_specific_product_set_to_live(data):
|
|
|
1840
1840
|
except Exception:
|
|
1841
1841
|
print("出现异常")
|
|
1842
1842
|
|
|
1843
|
-
def add_mutil_product_set_to_live(data):
|
|
1844
|
-
"""添加多规格商品的全部"""
|
|
1845
|
-
pass
|
|
1846
|
-
|
|
1847
1843
|
|
|
1848
1844
|
def add_all_product_set_to_live(data):
|
|
1849
1845
|
env = data["env"]
|
|
@@ -1980,6 +1976,142 @@ def add_all_product_set_to_keyword(data):
|
|
|
1980
1976
|
break
|
|
1981
1977
|
|
|
1982
1978
|
|
|
1979
|
+
def add_auto_reply(data):
|
|
1980
|
+
global response
|
|
1981
|
+
env = data["env"]
|
|
1982
|
+
headers = data["headers"]
|
|
1983
|
+
sales_id = data["sales_id"]
|
|
1984
|
+
url = "%s/api/posts/post/sales/%s/auto_reply"%(env,sales_id)
|
|
1985
|
+
stamp = int(time.time())
|
|
1986
|
+
name = "自动回复工具名称%d"%stamp
|
|
1987
|
+
keyword_type = "ANY"
|
|
1988
|
+
mode = "BASIC"
|
|
1989
|
+
keywords = ["自动回复关键字%d"%stamp]
|
|
1990
|
+
commentStatus = True
|
|
1991
|
+
messageStatus = True
|
|
1992
|
+
commentContent = "留言回复内容%d"%stamp
|
|
1993
|
+
messageContent = "私讯回复内容%d" % stamp
|
|
1994
|
+
name = data.get("name",name)
|
|
1995
|
+
keyword_type = data.get("keyword_type", keyword_type)
|
|
1996
|
+
mode = data.get("mode", mode)
|
|
1997
|
+
keywords = data.get("keywords", keywords)
|
|
1998
|
+
commentStatus = data.get("commentStatus", commentStatus)
|
|
1999
|
+
messageStatus = data.get("messageStatus", messageStatus)
|
|
2000
|
+
commentContent = data.get("commentContent", commentContent)
|
|
2001
|
+
messageContent = data.get("messageContent", messageContent)
|
|
2002
|
+
body = {
|
|
2003
|
+
"id": "",
|
|
2004
|
+
"name": name,
|
|
2005
|
+
"keywordMatchType": keyword_type,
|
|
2006
|
+
"mode": mode,
|
|
2007
|
+
"status": False,
|
|
2008
|
+
"keywords": [keywords],
|
|
2009
|
+
"answer": {
|
|
2010
|
+
"commentStatus": commentStatus,
|
|
2011
|
+
"messageStatus": messageStatus,
|
|
2012
|
+
"commentContent": commentContent,
|
|
2013
|
+
"messageContent": messageContent
|
|
2014
|
+
}
|
|
2015
|
+
}
|
|
2016
|
+
try:
|
|
2017
|
+
response = requests.post(url,headers=headers,json=body).json()
|
|
2018
|
+
auto_reply_id = response["data"]["id"]
|
|
2019
|
+
return auto_reply_id
|
|
2020
|
+
except Exception:
|
|
2021
|
+
print("创建自动回复失败:",response)
|
|
2022
|
+
|
|
2023
|
+
def enable_auto_reply(data):
|
|
2024
|
+
global response
|
|
2025
|
+
env = data["env"]
|
|
2026
|
+
headers = data["headers"]
|
|
2027
|
+
sales_id = data["sales_id"]
|
|
2028
|
+
auto_reply_id = data["auto_reply_id"]
|
|
2029
|
+
status = True
|
|
2030
|
+
status = data.get("status",status)
|
|
2031
|
+
url = "%s/api/posts/post/sales/%s/auto_reply/%s/switch"%(env,sales_id,auto_reply_id)
|
|
2032
|
+
body = {
|
|
2033
|
+
"status": status
|
|
2034
|
+
}
|
|
2035
|
+
try:
|
|
2036
|
+
response = requests.put(url,headers=headers,json=body).json()
|
|
2037
|
+
except Exception:
|
|
2038
|
+
print("更改自动回复状态失败:",response)
|
|
2039
|
+
|
|
2040
|
+
|
|
2041
|
+
def edit_auto_reply(data):
|
|
2042
|
+
global response
|
|
2043
|
+
env = data["env"]
|
|
2044
|
+
headers = data["headers"]
|
|
2045
|
+
sales_id = data["sales_id"]
|
|
2046
|
+
auto_reply_id = data["auto_reply_id"]
|
|
2047
|
+
url = "%s/api/posts/post/sales/%s/auto_reply"%(env,sales_id)
|
|
2048
|
+
stamp = int(time.time())
|
|
2049
|
+
name = "自动回复工具名称%d"%stamp
|
|
2050
|
+
keyword_type = "ANY"
|
|
2051
|
+
mode = "BASIC"
|
|
2052
|
+
keywords = ["自动回复关键字%d"%stamp]
|
|
2053
|
+
commentStatus = True
|
|
2054
|
+
messageStatus = True
|
|
2055
|
+
commentContent = "留言回复内容%d"%stamp
|
|
2056
|
+
messageContent = "私讯回复内容%d" % stamp
|
|
2057
|
+
name = data.get("name",name)
|
|
2058
|
+
keyword_type = data.get("keyword_type", keyword_type)
|
|
2059
|
+
mode = data.get("mode", mode)
|
|
2060
|
+
keywords = data.get("keywords", keywords)
|
|
2061
|
+
commentStatus = data.get("commentStatus", commentStatus)
|
|
2062
|
+
messageStatus = data.get("messageStatus", messageStatus)
|
|
2063
|
+
commentContent = data.get("commentContent", commentContent)
|
|
2064
|
+
messageContent = data.get("messageContent", messageContent)
|
|
2065
|
+
body = {
|
|
2066
|
+
"id": auto_reply_id,
|
|
2067
|
+
"name": name,
|
|
2068
|
+
"keywordMatchType": keyword_type,
|
|
2069
|
+
"mode": mode,
|
|
2070
|
+
"status": False,
|
|
2071
|
+
"keywords": [keywords],
|
|
2072
|
+
"answer": {
|
|
2073
|
+
"commentStatus": commentStatus,
|
|
2074
|
+
"messageStatus": messageStatus,
|
|
2075
|
+
"commentContent": commentContent,
|
|
2076
|
+
"messageContent": messageContent
|
|
2077
|
+
}
|
|
2078
|
+
}
|
|
2079
|
+
try:
|
|
2080
|
+
response = requests.put(url,headers=headers,json=body).json()
|
|
2081
|
+
except Exception:
|
|
2082
|
+
print("编辑自动回复失败:",response)
|
|
2083
|
+
|
|
2084
|
+
|
|
2085
|
+
def delete_auto_reply(data):
|
|
2086
|
+
global response
|
|
2087
|
+
env = data["env"]
|
|
2088
|
+
headers = data["headers"]
|
|
2089
|
+
sales_id = data["sales_id"]
|
|
2090
|
+
auto_reply_id = data["auto_reply_id"]
|
|
2091
|
+
url = "%s/api/posts/post/sales/%s/auto_reply"%(env,sales_id)
|
|
2092
|
+
body = {
|
|
2093
|
+
"id": auto_reply_id
|
|
2094
|
+
}
|
|
2095
|
+
try:
|
|
2096
|
+
response = requests.delete(url,headers=headers,json=body).json()
|
|
2097
|
+
except Exception:
|
|
2098
|
+
print("删除自动回复状态失败:",response)
|
|
2099
|
+
|
|
2100
|
+
def handler_auto_reply(data):
|
|
2101
|
+
"""处理自动回复,避免超过10个,超过10个无法新增"""
|
|
2102
|
+
live_info = get_live_info(data)
|
|
2103
|
+
autoReplyCommentConfig = live_info["data"]["autoReplyCommentConfig"]["rules"]
|
|
2104
|
+
num = data.get("num",8)
|
|
2105
|
+
if len(autoReplyCommentConfig)>num:
|
|
2106
|
+
for info in autoReplyCommentConfig:
|
|
2107
|
+
auto_reply_id = info["id"]
|
|
2108
|
+
data["auto_reply_id"] = auto_reply_id
|
|
2109
|
+
delete_auto_reply(data)
|
|
2110
|
+
|
|
2111
|
+
|
|
2112
|
+
|
|
2113
|
+
|
|
2114
|
+
|
|
1983
2115
|
|
|
1984
2116
|
|
|
1985
2117
|
if __name__=="__main__":
|
|
@@ -1995,3 +2127,4 @@ if __name__=="__main__":
|
|
|
1995
2127
|
|
|
1996
2128
|
|
|
1997
2129
|
|
|
2130
|
+
|
{sc_common_interface-2.7.1 → sc_common_interface-2.7.2}/sc_common_interface/McCommonInterface.py
RENAMED
|
File without changes
|
|
File without changes
|
{sc_common_interface-2.7.1 → sc_common_interface-2.7.2}/sc_common_interface/PostCommonInterface.py
RENAMED
|
File without changes
|
|
File without changes
|
{sc_common_interface-2.7.1 → sc_common_interface-2.7.2}/sc_common_interface.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{sc_common_interface-2.7.1 → sc_common_interface-2.7.2}/sc_common_interface.egg-info/requires.txt
RENAMED
|
File without changes
|
{sc_common_interface-2.7.1 → sc_common_interface-2.7.2}/sc_common_interface.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|