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
19775edc
Commit
19775edc
authored
Mar 18, 2021
by
yaozheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加流量线测试群提醒
parent
033d9996
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
11 deletions
+62
-11
demo.py
robot/demo.py
+19
-3
task.py
robot/task.py
+43
-5
sendCeshiMessage.py
sender/sendCeshiMessage.py
+0
-3
No files found.
robot/demo.py
View file @
19775edc
import
datetime
import
os
import
sys
# 把项目的根目录通过sys.path.append添加为执行时的环境变量
import
time
current_directory
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
root_path
=
os
.
path
.
abspath
(
os
.
path
.
dirname
(
current_directory
)
+
os
.
path
.
sep
+
"."
)
sys
.
path
.
append
(
root_path
)
from
robot.task
import
Task
# Task.liuliang_everyday1()
from
apscheduler.schedulers.blocking
import
BlockingScheduler
def
run
():
scheduler
=
BlockingScheduler
()
# 流量线值班人群里早上9:30提醒值班人值班
# scheduler.add_job(func=Task.zhiban, trigger='cron', hour=9, minute=30)
# 测试群关键事项提醒,周一到周五的17:30
scheduler
.
add_job
(
func
=
Task
.
ceshi
,
trigger
=
'cron'
,
day_of_week
=
(
0
,
1
,
2
,
3
,
4
),
hour
=
17
,
minute
=
30
)
# 流量线值班人群里晚上18:00提醒值班人值班
# scheduler.add_job(func=Task.zhiban1, trigger='cron', hour=18)
scheduler
.
start
()
Task
.
ceshi
()
if
__name__
==
"__main__"
:
run
()
robot/task.py
View file @
19775edc
...
...
@@ -27,7 +27,8 @@ class Task:
"actionURL"
:
"http://cf.dui88.com/pages/viewpage.action?pageId=78912619"
}
]
Remind
.
send_alone_actionCard
(
token
=
token
,
secret
=
secret
,
title
=
'下班前想一想'
,
text
=
text
,
btnOrientation
=
'1'
,
btns
=
btns
)
Remind
.
send_alone_actionCard
(
token
=
token
,
secret
=
secret
,
title
=
'下班前想一想'
,
text
=
text
,
btnOrientation
=
'1'
,
btns
=
btns
)
@
classmethod
def
liuliang_everyday1
(
cls
):
...
...
@@ -66,3 +67,40 @@ class Task:
text
=
text
+
'
\n
> ***测试周报都写了吗?*** [去写周报](http://cf.dui88.com/pages/viewpage.action?pageId=92507929) '
Remind
.
send_markdown
(
token
=
token
,
secret
=
secret
,
title
=
'下班前想一想'
,
text
=
text
,
at
=
at
)
@
classmethod
def
zhiban
(
cls
):
zhibanren
=
[[
'赵杨晶'
,
'18100175672'
],
[
'吉月琳'
,
'15372438813'
],
[
'达敏'
,
'18658862085'
],
[
'吴翠萍'
,
'15201297871'
],
[
'黄博涛'
,
'13641464105'
],
[
'刘尖学'
,
'18367117637'
],
[
'蒋佳杰'
,
'15957195421'
]]
token
=
'903ab8b3ba3d46e7c8b934ef83038bd6037e56c04a985e43fab8f2e0bd359cad'
secret
=
'SEC7e57fbdd5b20103208482f520420139072d84c754a3cd624641623bd2f225af3'
# 获取当天日期
currentdate
=
datetime
.
date
.
today
()
currentday
=
calendar
.
weekday
(
currentdate
.
year
,
currentdate
.
month
,
currentdate
.
day
)
text
=
'今日技术值班人:'
+
zhibanren
[
currentday
][
0
]
+
',请关注问题反馈群,及时跟进群任务'
at
=
{
'atMobiles'
:
[
zhibanren
[
currentday
][
1
]]}
Remind
.
send_messages
(
token
,
secret
,
text
,
at
)
@
classmethod
def
zhiban1
(
cls
):
zhibanren
=
[[
'赵杨晶'
,
'18100175672'
],
[
'吉月琳'
,
'15372438813'
],
[
'达敏'
,
'18658862085'
],
[
'吴翠萍'
,
'15201297871'
],
[
'黄博涛'
,
'15726940779'
],
[
'刘尖学'
,
'18367117637'
],
[
'蒋佳杰'
,
'15957195421'
]]
token
=
'903ab8b3ba3d46e7c8b934ef83038bd6037e56c04a985e43fab8f2e0bd359cad'
secret
=
'SEC7e57fbdd5b20103208482f520420139072d84c754a3cd624641623bd2f225af3'
# 获取当天日期
currentdate
=
datetime
.
date
.
today
()
currentday
=
calendar
.
weekday
(
currentdate
.
year
,
currentdate
.
month
,
currentdate
.
day
)
text
=
'@'
+
zhibanren
[
currentday
][
1
]
+
',值班同学辛苦啦~ '
\
'
\n
> 不要忘记发值班日报并记录值班问题哦~ [去记录](http://cf.dui88.com/pages/viewpage.action?pageId=99955951) '
at
=
{
'atMobiles'
:
[
zhibanren
[
currentday
][
1
]]}
Remind
.
send_markdown
(
token
,
secret
,
'值班提醒'
,
text
,
at
)
sender/sendCeshiMessage.py
View file @
19775edc
...
...
@@ -25,7 +25,4 @@ content1 = "请及时上传测试用例:http://cf.dui88.com/pages/viewpage.act
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
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