Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
InterfaceAutoTest
Overview
Overview
Details
Activity
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TestAuto
InterfaceAutoTest
Commits
103a66c5
Commit
103a66c5
authored
May 16, 2021
by
taoke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
钉钉消息增加当前时间
parent
1e312412
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
common/utils/dingTalk.py
+4
-2
No files found.
common/utils/dingTalk.py
View file @
103a66c5
import
requests
,
time
,
hmac
,
hashlib
,
base64
,
urllib
.
parse
,
json
import
requests
,
time
,
hmac
,
hashlib
,
base64
,
urllib
.
parse
,
json
from
config
import
BaseConfig
from
config
import
BaseConfig
import
datetime
...
@@ -46,11 +47,12 @@ def dingTalk_markdown(secret,webhook,message):
...
@@ -46,11 +47,12 @@ def dingTalk_markdown(secret,webhook,message):
timestamp
=
str
(
round
(
time
.
time
()
*
1000
))
timestamp
=
str
(
round
(
time
.
time
()
*
1000
))
sign
=
get_sign
(
secret
)
sign
=
get_sign
(
secret
)
webhook
=
webhook
+
f
"×tamp={timestamp}&sign={sign}"
webhook
=
webhook
+
f
"×tamp={timestamp}&sign={sign}"
now_time
=
datetime
.
datetime
.
now
()
.
strftime
(
'
%
Y-
%
m-
%
d
%
H:
%
M'
)
data
=
{
'msgtype'
:
'markdown'
,
data
=
{
'msgtype'
:
'markdown'
,
"markdown"
:
{
"markdown"
:
{
"title"
:
"接口执行报告"
,
"title"
:
"接口执行报告"
,
"text"
:
"#### 接口自动化测试报告
\n
> 本消息由Jenkins构建后自动发送
\n
>
\
"text"
:
f
"#### 接口自动化测试报告
\n
> 本消息由Jenkins构建后自动发送
\n
>
\

\n
> ######
10点20分发布
[斑马信用](http://10.197.236.10:8080/job/bmc/)
\n
"

\n
> ######
{now_time}构建
[斑马信用](http://10.197.236.10:8080/job/bmc/)
\n
"
},
},
'at'
:
{
'isAtAll'
:
False
}}
'at'
:
{
'isAtAll'
:
False
}}
post_data
=
json
.
dumps
(
data
)
post_data
=
json
.
dumps
(
data
)
...
...
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