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
4bdd915c
Commit
4bdd915c
authored
Mar 22, 2021
by
yaozheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加流量线测试群提醒
parent
e9ba60aa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
demo.py
robot/demo.py
+4
-4
task.py
robot/task.py
+8
-8
No files found.
robot/demo.py
View file @
4bdd915c
...
...
@@ -17,14 +17,14 @@ from apscheduler.schedulers.blocking import BlockingScheduler
def
run
():
scheduler
=
BlockingScheduler
()
# 流量线值班人群里早上9:30提醒值班人值班
#
scheduler.add_job(func=Task.zhiban, trigger='cron', hour=9, minute=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-4'
,
hour
=
17
,
minute
=
3
0
)
scheduler
.
add_job
(
func
=
Task
.
ceshi
,
trigger
=
'cron'
,
day_of_week
=
'0-4'
,
hour
=
17
,
minute
=
3
5
)
# 流量线值班人群里晚上18:00提醒值班人值班
#
scheduler.add_job(func=Task.zhiban1, trigger='cron', hour=18)
scheduler
.
add_job
(
func
=
Task
.
zhiban1
,
trigger
=
'cron'
,
hour
=
18
)
scheduler
.
start
()
if
__name__
==
"__main__"
:
run
()
run
()
\ No newline at end of file
robot/task.py
View file @
4bdd915c
...
...
@@ -65,20 +65,20 @@ class Task:
text
=
text
+
'
\n
> ***今天上线的需求都线上回归了吗?*** '
if
currentday
==
4
:
text
=
text
+
'
\n
> ***测试周报都写了吗?*** [去写周报](http://cf.dui88.com/pages/viewpage.action?pageId=92507929) '
print
(
'执行了'
)
Remind
.
send_markdown
(
token
=
token
,
secret
=
secret
,
title
=
'下班前想一想'
,
text
=
text
,
at
=
at
)
@
classmethod
def
zhiban
(
cls
):
zhibanren
=
[[
'赵杨晶'
,
'18100175672'
],
[
'
吉月琳'
,
'15372438813
'
],
[
'
黄博涛'
,
'13641464105
'
],
[
'达敏'
,
'18658862085'
],
[
'吴翠萍'
,
'15201297871'
],
[
'
黄博涛'
,
'13641464105
'
],
[
'
吉月琳'
,
'15372438813
'
],
[
'刘尖学'
,
'18367117637'
],
[
'蒋佳杰'
,
'15957195421'
]]
token
=
'
903ab8b3ba3d46e7c8b934ef83038bd6037e56c04a985e43fab8f2e0bd359cad
'
secret
=
'SEC
7e57fbdd5b20103208482f520420139072d84c754a3cd624641623bd2f225af3
'
token
=
'
11a2ead9ca600cd09e5c69c35d9bcc9486cf0a777ef5fd3c3b81b483f7bb5476
'
secret
=
'SEC
c2b9a64a1af6cd3777eb1d4d8ce039f5c2be2cc49181e431421bbe5e701dd5c1
'
# 获取当天日期
currentdate
=
datetime
.
date
.
today
()
currentday
=
calendar
.
weekday
(
currentdate
.
year
,
currentdate
.
month
,
currentdate
.
day
)
...
...
@@ -95,12 +95,12 @@ class Task:
[
'黄博涛'
,
'15726940779'
],
[
'刘尖学'
,
'18367117637'
],
[
'蒋佳杰'
,
'15957195421'
]]
token
=
'
903ab8b3ba3d46e7c8b934ef83038bd6037e56c04a985e43fab8f2e0bd359cad
'
secret
=
'SEC
7e57fbdd5b20103208482f520420139072d84c754a3cd624641623bd2f225af3
'
token
=
'
11a2ead9ca600cd09e5c69c35d9bcc9486cf0a777ef5fd3c3b81b483f7bb5476
'
secret
=
'SEC
c2b9a64a1af6cd3777eb1d4d8ce039f5c2be2cc49181e431421bbe5e701dd5c1
'
# 获取当天日期
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) '
'
\n
>
**不要忘记发值班日报并记录值班问题哦~**
[去记录](http://cf.dui88.com/pages/viewpage.action?pageId=99955951) '
at
=
{
'atMobiles'
:
[
zhibanren
[
currentday
][
1
]]}
Remind
.
send_markdown
(
token
,
secret
,
'值班提醒'
,
text
,
at
)
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