Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
钉
钉钉群通知
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
yaozheng
钉钉群通知
Commits
c83a0de6
Commit
c83a0de6
authored
Nov 02, 2020
by
yz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加流量线测试群提醒
parent
3c32590f
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
82 additions
and
0 deletions
+82
-0
vcs.xml
.idea/vcs.xml
+6
-0
__init__.py
sender/__init__.py
+0
-0
sendCeshiMessage.py
sender/sendCeshiMessage.py
+23
-0
sendLiuliangMessage.py
sender/sendLiuliangMessage.py
+19
-0
__init__.py
servers/__init__.py
+0
-0
ddMessageServer.py
servers/ddMessageServer.py
+34
-0
No files found.
.idea/vcs.xml
0 → 100644
View file @
c83a0de6
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"VcsDirectoryMappings"
>
<mapping
directory=
"$PROJECT_DIR$"
vcs=
"Git"
/>
</component>
</project>
\ No newline at end of file
sender/__init__.py
0 → 100644
View file @
c83a0de6
sender/sendCeshiMessage.py
0 → 100644
View file @
c83a0de6
from
servers.ddMessageServer
import
DDMessage
import
time
# 机器人提醒地址,测试群
dingTalkUrl
=
"https://oapi.dingtalk.com/robot/send?access_token=fb8da62f0af606820fe8bdfdf8ea261d468f09b57c22faaa454d45855ea82eef"
# 密钥,签名算法需要,测试群
secret
=
'SECf2cc843306d667575a491650c777d8aa21788c4c60f3f0949d5d0b61c86e5aef'
# 获取时间戳,签名算法需要,并且需要和签名一起拼到链接后面
timestamp
=
str
(
round
(
time
.
time
()
*
1000
))
# 获取签名
sign
=
DDMessage
.
get_sign
(
timestamp
,
secret
)
# 拼接完整的url,用于鉴权
fullUrl
=
dingTalkUrl
+
"×tamp="
+
timestamp
+
"&sign="
+
sign
# 构造要发送的信息
content1
=
"请及时上传测试用例:http://cf.dui88.com/pages/viewpage.action?pageId=67163149"
content2
=
"bug请及时上报jira并更新状态:http://jira.dui88.com"
content3
=
"业务文档请及时更新:http://cf.dui88.com/pages/viewpage.action?pageId=78912619"
# 发送信息
# DDMessage.send_message(fullUrl,content1)
# DDMessage.send_message(fullUrl,content2)
# DDMessage.send_message(fullUrl,content3)
DDMessage
.
send_message
(
fullUrl
,
content1
+
'
\n
'
+
content3
)
\ No newline at end of file
sender/sendLiuliangMessage.py
0 → 100644
View file @
c83a0de6
from
servers.ddMessageServer
import
DDMessage
import
time
# 机器人提醒地址,测试群
dingTalkUrl
=
"https://oapi.dingtalk.com/robot/send?access_token=903ab8b3ba3d46e7c8b934ef83038bd6037e56c04a985e43fab8f2e0bd359cad"
# 密钥,签名算法需要,测试群
secret
=
'SEC7e57fbdd5b20103208482f520420139072d84c754a3cd624641623bd2f225af3'
# 获取时间戳,签名算法需要,并且需要和签名一起拼到链接后面
timestamp
=
str
(
round
(
time
.
time
()
*
1000
))
# 获取签名
sign
=
DDMessage
.
get_sign
(
timestamp
,
secret
)
# 拼接完整的url,用于鉴权
fullUrl
=
dingTalkUrl
+
"×tamp="
+
timestamp
+
"&sign="
+
sign
# 构造要发送的信息
content1
=
"请及时维护流量线测试排期列表:http://cf.dui88.com/pages/viewpage.action?pageId=81484880"
content2
=
"测试用例及时上传:http://cf.dui88.com/pages/viewpage.action?pageId=67163062"
# 发送信息
DDMessage
.
send_message
(
fullUrl
,
content1
+
'
\n
'
+
content2
)
\ No newline at end of file
servers/__init__.py
0 → 100644
View file @
c83a0de6
se
ndMessage
.py
→
se
rvers/ddMessageServer
.py
View file @
c83a0de6
import
requests
import
time
import
hmac
import
hashlib
import
base64
...
...
@@ -7,10 +6,6 @@ import urllib.parse
import
json
# http://gitlab2.dui88.com/yaozheng/dingdingMessage.git
# https://oapi.dingtalk.com/robot/send?access_token=fb8da62f0af606820fe8bdfdf8ea261d468f09b57c22faaa454d45855ea82eef
# SECf2cc843306d667575a491650c777d8aa21788c4c60f3f0949d5d0b61c86e5aef
class
DDMessage
:
# 获得签名
@
classmethod
...
...
@@ -37,28 +32,3 @@ class DDMessage:
}
r
=
requests
.
post
(
url
=
url
,
data
=
json
.
dumps
(
message
),
headers
=
headers
)
.
json
()
print
(
r
)
\ No newline at end of file
# 机器人提醒地址
dingTalkUrl
=
"https://oapi.dingtalk.com/robot/send?access_token=fb8da62f0af606820fe8bdfdf8ea261d468f09b57c22faaa454d45855ea82eef"
# 密钥,签名算法需要
secret
=
'SECf2cc843306d667575a491650c777d8aa21788c4c60f3f0949d5d0b61c86e5aef'
# 获取时间戳,签名算法需要,并且需要和签名一起拼到链接后面
timestamp
=
str
(
round
(
time
.
time
()
*
1000
))
# 获取签名
sign
=
DDMessage
.
get_sign
(
timestamp
,
secret
)
# 拼接完整的url,用于鉴权
fullUrl
=
dingTalkUrl
+
"×tamp="
+
timestamp
+
"&sign="
+
sign
# 获取要发送的信息
content1
=
"请及时上传测试用例:http://cf.dui88.com/pages/viewpage.action?pageId=67163149"
content2
=
"bug请及时上报jira并更新状态:http://jira.dui88.com"
content3
=
"业务文档请及时更新:http://cf.dui88.com/pages/viewpage.action?pageId=78912619"
# 发送信息
DDMessage
.
send_message
(
fullUrl
,
content1
)
DDMessage
.
send_message
(
fullUrl
,
content2
)
DDMessage
.
send_message
(
fullUrl
,
content3
)
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