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
96ec2a51
Commit
96ec2a51
authored
Aug 30, 2021
by
TesterYao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加流量线测试群提醒
parent
d4a12bdc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
16 deletions
+32
-16
pangu.py
robot/pangu.py
+4
-0
task.py
robot/task.py
+28
-16
No files found.
robot/pangu.py
View file @
96ec2a51
from
time
import
sleep
import
requests
import
requests
URL
=
'https://engine.tuia.cn/apollo/getIdMapStrByKeyStr?keyStr=onlin.watch.list'
URL
=
'https://engine.tuia.cn/apollo/getIdMapStrByKeyStr?keyStr=onlin.watch.list'
...
@@ -9,7 +11,9 @@ def get_watcher_list(business):
...
@@ -9,7 +11,9 @@ def get_watcher_list(business):
print
(
r
.
json
())
print
(
r
.
json
())
return
r
.
json
()
.
get
(
business
)
return
r
.
json
()
.
get
(
business
)
else
:
else
:
sleep
(
1500
)
get_watcher_list
(
'cx'
)
get_watcher_list
(
'cx'
)
except
:
except
:
sleep
(
1500
)
get_watcher_list
(
'cx'
)
get_watcher_list
(
'cx'
)
robot/task.py
View file @
96ec2a51
...
@@ -44,49 +44,61 @@ class Task:
...
@@ -44,49 +44,61 @@ class Task:
@
classmethod
@
classmethod
def
zhiban
(
cls
):
def
zhiban
(
cls
):
ll_zhibanren
=
get_watcher_list
(
'media'
)
ll_zhibanren
=
get_watcher_list
(
'media'
)
ll_pepole
=
[
i
for
i
in
ll_zhibanren
.
keys
()]
ll_num
=
[
i
for
i
in
ll_zhibanren
.
values
()]
gg_zhibanren
=
get_watcher_list
(
'advert'
)
gg_zhibanren
=
get_watcher_list
(
'advert'
)
gg_pepole
=
[
i
for
i
in
gg_zhibanren
.
keys
()]
gg_num
=
[
i
for
i
in
gg_zhibanren
.
values
()]
cx_zhibanren
=
get_watcher_list
(
'cx'
)
cx_zhibanren
=
get_watcher_list
(
'cx'
)
cx_pepole
=
[
i
for
i
in
cx_zhibanren
.
keys
()]
cx_num
=
[
i
for
i
in
cx_zhibanren
.
values
()]
bq_zhibanren
=
get_watcher_list
(
'bq'
)
bq_zhibanren
=
get_watcher_list
(
'bq'
)
bq_pepole
=
[
i
for
i
in
bq_zhibanren
.
keys
()]
bq_num
=
[
i
for
i
in
bq_zhibanren
.
values
()]
# 获取当天日期
# 获取当天日期
currentdate
=
datetime
.
date
.
today
()
currentdate
=
datetime
.
date
.
today
()
currentday
=
calendar
.
weekday
(
currentdate
.
year
,
currentdate
.
month
,
currentdate
.
day
)
currentday
=
calendar
.
weekday
(
currentdate
.
year
,
currentdate
.
month
,
currentdate
.
day
)
ll_text
=
'今日技术值班人:'
+
get_watcher_list
(
'media'
)[
currentday
][
0
]
+
',请关注问题反馈群,及时跟进群任务'
ll_text
=
'今日技术值班人:'
+
ll_pepole
[
currentday
]
+
',请关注问题反馈群,及时跟进群任务'
ll_at
=
{
'atMobiles'
:
[
ll_
zhibanren
[
currentday
][
1
]]}
ll_at
=
{
'atMobiles'
:
[
ll_
num
[
currentday
]]}
Remind
.
send_messages
(
ll_token
,
ll_secret
,
ll_text
,
ll_at
)
Remind
.
send_messages
(
ll_token
,
ll_secret
,
ll_text
,
ll_at
)
gg_text
=
'今日技术值班人:'
+
gg_
zhibanren
[
currentday
][
0
]
+
',请关注问题反馈群,及时跟进群任务'
gg_text
=
'今日技术值班人:'
+
gg_
pepole
[
currentday
]
+
',请关注问题反馈群,及时跟进群任务'
gg_at
=
{
'atMobiles'
:
[
gg_
zhibanren
[
currentday
][
1
]]}
gg_at
=
{
'atMobiles'
:
[
gg_
num
[
currentday
]]}
Remind
.
send_messages
(
gg_token
,
gg_secret
,
gg_text
,
gg_at
)
Remind
.
send_messages
(
gg_token
,
gg_secret
,
gg_text
,
gg_at
)
cx_text
=
'今日技术值班人:'
+
cx_
zhibanren
[
currentday
][
0
]
+
',请关注问题反馈群,及时跟进群任务'
cx_text
=
'今日技术值班人:'
+
cx_
pepole
[
currentday
]
+
',请关注问题反馈群,及时跟进群任务'
cx_at
=
{
'atMobiles'
:
[
cx_
zhibanren
[
currentday
][
1
]]}
cx_at
=
{
'atMobiles'
:
[
cx_
num
[
currentday
]]}
Remind
.
send_messages
(
cx_token
,
cx_secret
,
cx_text
,
cx_at
)
Remind
.
send_messages
(
cx_token
,
cx_secret
,
cx_text
,
cx_at
)
bq_text
=
'今日技术值班人:'
+
bq_
zhibanren
[
currentday
][
0
]
+
',请关注问题反馈群,及时跟进群任务'
bq_text
=
'今日技术值班人:'
+
bq_
pepole
[
currentday
]
+
',请关注问题反馈群,及时跟进群任务'
bq_at
=
{
'atMobiles'
:
[
bq_
zhibanren
[
currentday
][
1
]]}
bq_at
=
{
'atMobiles'
:
[
bq_
num
[
currentday
]]}
Remind
.
send_messages
(
bq_token
,
bq_secret
,
bq_text
,
bq_at
)
Remind
.
send_messages
(
bq_token
,
bq_secret
,
bq_text
,
bq_at
)
@
classmethod
@
classmethod
def
zhiban1
(
cls
):
def
zhiban1
(
cls
):
ll_zhibanren
=
get_watcher_list
(
'media'
)
ll_zhibanren
=
get_watcher_list
(
'media'
)
ll_num
=
[
i
for
i
in
ll_zhibanren
.
values
()]
gg_zhibanren
=
get_watcher_list
(
'advert'
)
gg_zhibanren
=
get_watcher_list
(
'advert'
)
gg_num
=
[
i
for
i
in
gg_zhibanren
.
values
()]
cx_zhibanren
=
get_watcher_list
(
'cx'
)
cx_zhibanren
=
get_watcher_list
(
'cx'
)
cx_num
=
[
i
for
i
in
cx_zhibanren
.
values
()]
bq_zhibanren
=
get_watcher_list
(
'bq'
)
bq_zhibanren
=
get_watcher_list
(
'bq'
)
bq_num
=
[
i
for
i
in
bq_zhibanren
.
values
()]
# 获取当天日期
# 获取当天日期
currentdate
=
datetime
.
date
.
today
()
currentdate
=
datetime
.
date
.
today
()
currentday
=
calendar
.
weekday
(
currentdate
.
year
,
currentdate
.
month
,
currentdate
.
day
)
currentday
=
calendar
.
weekday
(
currentdate
.
year
,
currentdate
.
month
,
currentdate
.
day
)
ll_text
=
'@'
+
ll_
zhibanren
[
currentday
][
1
]
+
',值班同学辛苦啦~ '
\
ll_text
=
'@'
+
ll_
num
[
currentday
]
+
',值班同学辛苦啦~ '
\
'
\n
> **不要忘记发值班日报并记录值班问题哦~** [去记录](http://cf.dui88.com/pages/viewpage.action?pageId=99955951) '
'
\n
> **不要忘记发值班日报并记录值班问题哦~** [去记录](http://cf.dui88.com/pages/viewpage.action?pageId=99955951) '
ll_at
=
{
'atMobiles'
:
[
ll_
zhibanren
[
currentday
][
1
]]}
ll_at
=
{
'atMobiles'
:
[
ll_
num
[
currentday
]]}
Remind
.
send_markdown
(
ll_token
,
ll_secret
,
'值班提醒'
,
ll_text
,
ll_at
)
Remind
.
send_markdown
(
ll_token
,
ll_secret
,
'值班提醒'
,
ll_text
,
ll_at
)
gg_text
=
'@'
+
gg_
zhibanren
[
currentday
][
1
]
+
',值班同学辛苦啦~ '
\
gg_text
=
'@'
+
gg_
num
[
currentday
]
+
',值班同学辛苦啦~ '
\
'
\n
> **不要忘记发值班日报并记录值班问题哦~** [去记录](http://cf.dui88.com/pages/viewpage.action?pageId=99951008) '
'
\n
> **不要忘记发值班日报并记录值班问题哦~** [去记录](http://cf.dui88.com/pages/viewpage.action?pageId=99951008) '
gg_at
=
{
'atMobiles'
:
[
gg_
zhibanren
[
currentday
][
1
]]}
gg_at
=
{
'atMobiles'
:
[
gg_
num
[
currentday
]]}
Remind
.
send_markdown
(
gg_token
,
gg_secret
,
'值班提醒'
,
gg_text
,
gg_at
)
Remind
.
send_markdown
(
gg_token
,
gg_secret
,
'值班提醒'
,
gg_text
,
gg_at
)
cx_text
=
'@'
+
cx_
zhibanren
[
currentday
][
1
]
+
',值班同学辛苦啦~ '
\
cx_text
=
'@'
+
cx_
num
[
currentday
]
+
',值班同学辛苦啦~ '
\
'
\n
> **不要忘记发值班日报并记录值班问题哦~** [去记录](http://cf.dui88.com/pages/viewpage.action?pageId=111230681) '
'
\n
> **不要忘记发值班日报并记录值班问题哦~** [去记录](http://cf.dui88.com/pages/viewpage.action?pageId=111230681) '
cx_at
=
{
'atMobiles'
:
[
cx_
zhibanren
[
currentday
][
1
]]}
cx_at
=
{
'atMobiles'
:
[
cx_
num
[
currentday
]]}
Remind
.
send_markdown
(
cx_token
,
cx_secret
,
'值班提醒'
,
cx_text
,
cx_at
)
Remind
.
send_markdown
(
cx_token
,
cx_secret
,
'值班提醒'
,
cx_text
,
cx_at
)
bq_text
=
'@'
+
bq_
zhibanren
[
currentday
][
1
]
+
',值班同学辛苦啦~ '
\
bq_text
=
'@'
+
bq_
num
[
currentday
]
+
',值班同学辛苦啦~ '
\
'
\n
> **不要忘记发值班日报并记录值班问题哦~** [去记录](http://cf.dui88.com/pages/viewpage.action?pageId=92509345) '
'
\n
> **不要忘记发值班日报并记录值班问题哦~** [去记录](http://cf.dui88.com/pages/viewpage.action?pageId=92509345) '
bq_at
=
{
'atMobiles'
:
[
bq_
zhibanren
[
currentday
][
1
]]}
bq_at
=
{
'atMobiles'
:
[
bq_
num
[
currentday
]]}
Remind
.
send_markdown
(
bq_token
,
bq_secret
,
'值班提醒'
,
bq_text
,
bq_at
)
Remind
.
send_markdown
(
bq_token
,
bq_secret
,
'值班提醒'
,
bq_text
,
bq_at
)
@
classmethod
@
classmethod
...
...
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