Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
willdesk_apiauto
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
29
Issues
29
List
Boards
Labels
Service Desk
Milestones
Merge Requests
29
Merge Requests
29
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
桦生 詹
willdesk_apiauto
Commits
e4adb356
Commit
e4adb356
authored
Jul 05, 2024
by
zhanhuasheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1 - bugfix
2 - 新增集成数量接口
parent
e0f0f46c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
7 deletions
+23
-7
Utils/webhook_handler.py
Utils/webhook_handler.py
+4
-4
YamlCase/setting/shopifyIntegration.yaml
YamlCase/setting/shopifyIntegration.yaml
+16
-0
YamlCase/setting/tag.yaml
YamlCase/setting/tag.yaml
+3
-3
No files found.
Utils/webhook_handler.py
View file @
e4adb356
...
...
@@ -8,16 +8,16 @@ import urllib.parse
timestamp
=
str
(
round
(
time
.
time
()
*
1000
))
secret
=
'SEC7c41f8b0298b348ed538883c49068185b75c510d64dcb988fc570cb7614f07ff'
#正式的webhook
#
secret = 'SEC9d91939234e83369cba32c0ca4bcd9af60b5b1f69424d6fabd36f48d572a151c' #测试用的webhook
#
secret = 'SEC7c41f8b0298b348ed538883c49068185b75c510d64dcb988fc570cb7614f07ff' #正式的webhook
secret
=
'SEC9d91939234e83369cba32c0ca4bcd9af60b5b1f69424d6fabd36f48d572a151c'
#测试用的webhook
secret_enc
=
secret
.
encode
(
'utf-8'
)
string_to_sign
=
'{}
\n
{}'
.
format
(
timestamp
,
secret
)
string_to_sign_enc
=
string_to_sign
.
encode
(
'utf-8'
)
hmac_code
=
hmac
.
new
(
secret_enc
,
string_to_sign_enc
,
digestmod
=
hashlib
.
sha256
).
digest
()
sign
=
urllib
.
parse
.
quote_plus
(
base64
.
b64encode
(
hmac_code
))
#
webhook_url = 'https://oapi.dingtalk.com/robot/send?access_token=22fda27990b00841c3201c20649c0a8abb6da82d8472b6f6154ef4cd9dadb33f' #测试用的webhook
webhook_url
=
'https://oapi.dingtalk.com/robot/send?access_token=c7d3c3a67db4cf7b3472e62005a25ce202daac8095f32530687afdb91f1616b6'
#正式的webhook
webhook_url
=
'https://oapi.dingtalk.com/robot/send?access_token=22fda27990b00841c3201c20649c0a8abb6da82d8472b6f6154ef4cd9dadb33f'
#测试用的webhook
#
webhook_url = 'https://oapi.dingtalk.com/robot/send?access_token=c7d3c3a67db4cf7b3472e62005a25ce202daac8095f32530687afdb91f1616b6' #正式的webhook
class
webhookHandler
:
def
__init__
(
self
,
webhookUrl
=
f
"
{
webhook_url
}
×tamp=
{
timestamp
}
&sign=
{
sign
}
"
):
...
...
YamlCase/setting/shopifyIntegration.yaml
View file @
e4adb356
...
...
@@ -134,3 +134,19 @@ api14:
-
eq
:
{
"
$.code"
:
0
}
-
eq
:
{
"
$.data.brandName"
:
"
${brandName}"
}
api15
:
title
:
检查集成数量
url
:
/api/v1/resource/getResourceCount
method
:
post
data
:
{
"
v"
:
"
${v}"
}
before_sql
:
setting/shopifyIntegration/shopifyIntegration_integration_num_select.py
expected
:
-
eq
:
{
"
$.code"
:
0
}
-
eq
:
{
"
$.data.list[?(@.resourceName
==
'ShopifyShop')].success"
:
"
${shopify_shop_num}"
}
-
eq
:
{
"
$.data.list[?(@.resourceName
==
'JsShop')].success"
:
"
${js_shop_num}"
}
-
eq
:
{
"
$.data.list[?(@.resourceName
==
'Messenger')].success"
:
"
${facebook_shop_num}"
}
-
eq
:
{
"
$.data.list[?(@.resourceName
==
'Email')].success"
:
"
${email_shop_num}"
}
-
eq
:
{
"
$.data.list[?(@.resourceName
==
'Instagram')].success"
:
"
${ins_shop_num}"
}
-
eq
:
{
"
$.data.list[?(@.resourceName
==
'Whatsapp')].success"
:
"
${whatsapp_shop_num}"
}
-
eq
:
{
"
$.data.list[?(@.resourceName
==
'Macro')].success"
:
"
${macro_num}"
}
YamlCase/setting/tag.yaml
View file @
e4adb356
...
...
@@ -89,7 +89,7 @@ api10:
title
:
搜索会话标签
url
:
/api/v1/chat/local/roomList
method
:
post
data
:
{
"
uid"
:
"
${userId}"
,
"
uType"
:
2
,
"
platform"
:
1
,
"
siteIds"
:[
"
${shopId}"
],
"
status"
:
1
,
"
page"
:
1
,
"
pageSize"
:
2
0
,
"
sortName"
:
"
all"
,
"
keyword"
:
"
${new_tag_name}"
,
"
roomSearchExpArgs"
:{
"
searchDime"
:
1
,
"
searchId"
:
"
"
},
"
v"
:
"
${v}"
}
data
:
{
"
uid"
:
"
${userId}"
,
"
uType"
:
2
,
"
platform"
:
1
,
"
siteIds"
:[
"
${shopId}"
],
"
status"
:
1
,
"
page"
:
1
,
"
pageSize"
:
5
0
,
"
sortName"
:
"
all"
,
"
keyword"
:
"
${new_tag_name}"
,
"
roomSearchExpArgs"
:{
"
searchDime"
:
1
,
"
searchId"
:
"
"
},
"
v"
:
"
${v}"
}
expected
:
-
eq
:
{
"
$.code"
:
0
}
-
in_list
:
{
"
data.list[*].roomId"
:
"
${room_id}"
}
...
...
@@ -99,7 +99,7 @@ api11:
title
:
搜索用户标签
url
:
/api/v1/chat/local/roomList
method
:
post
data
:
{
"
uid"
:
"
${userId}"
,
"
uType"
:
2
,
"
platform"
:
1
,
"
siteIds"
:[
"
${shopId}"
],
"
status"
:
1
,
"
page"
:
1
,
"
pageSize"
:
2
0
,
"
sortName"
:
"
all"
,
"
keyword"
:
"
${new_tag_name}"
,
"
roomSearchExpArgs"
:{
"
searchDime"
:
2
,
"
searchId"
:
"
"
},
"
v"
:
"
${v}"
}
data
:
{
"
uid"
:
"
${userId}"
,
"
uType"
:
2
,
"
platform"
:
1
,
"
siteIds"
:[
"
${shopId}"
],
"
status"
:
1
,
"
page"
:
1
,
"
pageSize"
:
5
0
,
"
sortName"
:
"
all"
,
"
keyword"
:
"
${new_tag_name}"
,
"
roomSearchExpArgs"
:{
"
searchDime"
:
2
,
"
searchId"
:
"
"
},
"
v"
:
"
${v}"
}
expected
:
-
eq
:
{
"
$.code"
:
0
}
-
in_list
:
{
"
data.list[*].roomId"
:
"
${room_id}"
}
...
...
@@ -109,7 +109,7 @@ api12:
title
:
搜索标签 - all
url
:
/api/v1/chat/local/roomList
method
:
post
data
:
{
"
uid"
:
"
${userId}"
,
"
uType"
:
2
,
"
platform"
:
1
,
"
siteIds"
:[
"
${shopId}"
],
"
status"
:
1
,
"
page"
:
1
,
"
pageSize"
:
2
0
,
"
sortName"
:
"
all"
,
"
keyword"
:
"
${new_tag_name}"
,
"
roomSearchExpArgs"
:{
"
searchDime"
:
0
,
"
searchId"
:
"
"
},
"
v"
:
"
${v}"
}
data
:
{
"
uid"
:
"
${userId}"
,
"
uType"
:
2
,
"
platform"
:
1
,
"
siteIds"
:[
"
${shopId}"
],
"
status"
:
1
,
"
page"
:
1
,
"
pageSize"
:
5
0
,
"
sortName"
:
"
all"
,
"
keyword"
:
"
${new_tag_name}"
,
"
roomSearchExpArgs"
:{
"
searchDime"
:
0
,
"
searchId"
:
"
"
},
"
v"
:
"
${v}"
}
expected
:
-
eq
:
{
"
$.code"
:
0
}
-
in_list
:
{
"
$.data.list[*].roomId"
:
"
${room_id}"
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment