Commit d4a12bdc authored by TesterYao's avatar TesterYao

增加流量线测试群提醒

parent 93f76909
import requests
URL = 'https://engine.tuia.cn/apollo/getIdMapStrByKeyStr?keyStr=onlin.watch.list'
def get_watcher_list(business):
try:
r = requests.get(url=URL)
if r.ok:
print(r.json())
return r.json().get(business)
else:
get_watcher_list('cx')
except:
get_watcher_list('cx')
from robot.pangu import get_watcher_list
from robot.remind import Remind
import datetime
import calendar
# 流量问题值班群token&secret
ll_token = '11a2ead9ca600cd09e5c69c35d9bcc9486cf0a777ef5fd3c3b81b483f7bb5476'
ll_secret = 'SECc2b9a64a1af6cd3777eb1d4d8ce039f5c2be2cc49181e431421bbe5e701dd5c1'
# 广告问题值班群token&secret
gg_token = '18a408be88a6c0ed4f56e7edf8c40fa9d30c0b40d3695674ba326f7ccfc79310'
gg_secret = 'SEC3d0e79f76b5207c3f945762dc79e34a645ec80c391fb25942f96afc1a60a5475'
# 创新问题值班群token&secret
cx_token = '786c9b2957e6fdf44d91df3bc02f86ff5196ac39f31726d2b7055189b7355ed7'
cx_secret = 'SECcc1be901d1ed9099e35711da3df17f090b780a44318abae72dac68c860a5548e'
# 百奇问题值班群token&secret
bq_token = '915e0bb0729a82575d2b77bf8e89a986eae0d8592842a1966d6a4d748df8dcd3'
bq_secret = 'SEC257309c734c7c21888355a3ae7106ba2fa3a2c59aceb4304995f01882be36cd9'
# 测试群token&secret
token = 'fb8da62f0af606820fe8bdfdf8ea261d468f09b57c22faaa454d45855ea82eef'
secret = 'SECf2cc843306d667575a491650c777d8aa21788c4c60f3f0949d5d0b61c86e5aef'
class Task:
@classmethod
def liuliang_everyday(cls):
token = '903ab8b3ba3d46e7c8b934ef83038bd6037e56c04a985e43fab8f2e0bd359cad'
secret = 'SEC7e57fbdd5b20103208482f520420139072d84c754a3cd624641623bd2f225af3'
text = '***今天排查的线上问题记录了吗?\n\n\r 测试用例上传了吗?\n\n\r 提测bug都提交了吗?\n\n\r 今天上线的需求都线上回归了吗?\n\n\r 业务文档都更新了吗?***'
btns = [{
"title": "线上问题记录",
"actionURL": "http://cf.dui88.com/pages/viewpage.action?pageId=97986428"
},
{
"title": "测试用例上传",
"actionURL": "http://cf.dui88.com/pages/viewpage.action?pageId=67163062"
},
{
"title": "提测bug提交并更新状态",
"actionURL": "http://jira.dui88.com"
},
{
"title": "业务文档更新",
"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)
@classmethod
def liuliang_everyday1(cls):
token = '903ab8b3ba3d46e7c8b934ef83038bd6037e56c04a985e43fab8f2e0bd359cad'
secret = 'SEC7e57fbdd5b20103208482f520420139072d84c754a3cd624641623bd2f225af3'
text = '# 下班前先想一想 ' \
'\n> ***今天排查的线上问题记录了吗?*** [去记录](http://cf.dui88.com/pages/viewpage.action?pageId=97986428) ' \
'\n> ***测试用例上传了吗?*** [去上传](http://cf.dui88.com/pages/viewpage.action?pageId=67163062) ' \
'\n> ***提测bug都提交了吗?*** [去提交](http://jira.dui88.com) ' \
'\n> ***业务文档都更新了吗?*** [去更新](http://cf.dui88.com/pages/viewpage.action?pageId=78912619)'
text = text + ' \n> ***今天上线的需求都线上回归了吗?***'
text = text + ' \n> ***测试周报都写了吗?*** [去写周报](http://cf.dui88.com/pages/viewpage.action?pageId=92507929)'
at = {'atMobiles': ['15726940779'], 'isAtAll': False}
Remind.send_markdown(token=token, secret=secret, title='下班前想一想', text=text, at=at)
class Task:
@classmethod
def ceshi(cls):
token = 'fb8da62f0af606820fe8bdfdf8ea261d468f09b57c22faaa454d45855ea82eef'
secret = 'SECf2cc843306d667575a491650c777d8aa21788c4c60f3f0949d5d0b61c86e5aef'
text = '# 下班前先想一想 ' \
'\n> ***今天做的事情和PBC相关吗?*** [去review](http://cf.dui88.com/pages/viewpage.action?pageId=98008715) ' \
'\n> ***今天排查的线上问题记录了吗?*** [去记录](http://cf.dui88.com/pages/viewpage.action?pageId=97986428) ' \
'\n> ***今天写的测试用例上传了吗?*** [去上传](http://yunce.dui88.com/tc) ' \
'\n> ***今天的提测bug都提交了吗?*** [去提交](http://jira.dui88.com) ' \
'\n> ***业务文档都更新了吗?*** [去更新](http://cf.dui88.com/pages/viewpage.action?pageId=78912619) '
at = {'isAtAll': True}
# 获取当天日期
currentdate = datetime.date.today()
currentday = calendar.weekday(currentdate.year, currentdate.month, currentdate.day)
......@@ -70,49 +43,14 @@ class Task:
@classmethod
def zhiban(cls):
ll_zhibanren = [['林昊', '17866673125'],
['黄博涛', '13641464105'],
['达敏', '18658862085'],
['吴翠萍', '15201297871'],
['吉月琳', '15372438813'],
['刘尖学', '18367117637'],
['蒋佳杰', '15957195421']]
ll_token = '11a2ead9ca600cd09e5c69c35d9bcc9486cf0a777ef5fd3c3b81b483f7bb5476'
ll_secret = 'SECc2b9a64a1af6cd3777eb1d4d8ce039f5c2be2cc49181e431421bbe5e701dd5c1'
gg_zhibanren = [['李健', '15961709154'],
['徐鑫鑫', '18768147457'],
['苏志道', '15521876004'],
['陈凯林', '18363750961'],
['黎俊芳', '13609444067'],
['樊佳', '13007295320'],
['余宁宁', '15356195820']]
gg_token = '18a408be88a6c0ed4f56e7edf8c40fa9d30c0b40d3695674ba326f7ccfc79310'
gg_secret = 'SEC3d0e79f76b5207c3f945762dc79e34a645ec80c391fb25942f96afc1a60a5475'
cx_zhibanren = [['何亚辉', '15536261700'],
['张国政', '18538976289'],
['赵肖炜', '18768105694'],
['毛宝', '17681879658'],
['余伟华', '15756006525'],
['金周萍', '13666745601'],
['陶燕红', '15061800715']]
cx_token = '786c9b2957e6fdf44d91df3bc02f86ff5196ac39f31726d2b7055189b7355ed7'
cx_secret = 'SECcc1be901d1ed9099e35711da3df17f090b780a44318abae72dac68c860a5548e'
bq_zhibanren = [['雷婷婷', '15858168079'],
['周梓武', '15932935281'],
['韩占利', '13116742018'],
['杨贺晨吉', '13588735854'],
['余宁宁', '15356195820'],
['廖锟', '15168288343'],
['王鹏飞', '18621027261']]
bq_token = '915e0bb0729a82575d2b77bf8e89a986eae0d8592842a1966d6a4d748df8dcd3'
bq_secret = 'SEC257309c734c7c21888355a3ae7106ba2fa3a2c59aceb4304995f01882be36cd9'
ll_zhibanren = get_watcher_list('media')
gg_zhibanren = get_watcher_list('advert')
cx_zhibanren = get_watcher_list('cx')
bq_zhibanren = get_watcher_list('bq')
# 获取当天日期
currentdate = datetime.date.today()
currentday = calendar.weekday(currentdate.year, currentdate.month, currentdate.day)
ll_text = '今日技术值班人:' + ll_zhibanren[currentday][0] + ',请关注问题反馈群,及时跟进群任务'
ll_text = '今日技术值班人:' + get_watcher_list('media')[currentday][0] + ',请关注问题反馈群,及时跟进群任务'
ll_at = {'atMobiles': [ll_zhibanren[currentday][1]]}
Remind.send_messages(ll_token, ll_secret, ll_text, ll_at)
gg_text = '今日技术值班人:' + gg_zhibanren[currentday][0] + ',请关注问题反馈群,及时跟进群任务'
......@@ -127,45 +65,10 @@ class Task:
@classmethod
def zhiban1(cls):
ll_zhibanren = [['林昊', '17866673125'],
['黄博涛', '13641464105'],
['达敏', '18658862085'],
['吴翠萍', '15201297871'],
['吉月琳', '15372438813'],
['刘尖学', '18367117637'],
['蒋佳杰', '15957195421']]
ll_token = '11a2ead9ca600cd09e5c69c35d9bcc9486cf0a777ef5fd3c3b81b483f7bb5476'
ll_secret = 'SECc2b9a64a1af6cd3777eb1d4d8ce039f5c2be2cc49181e431421bbe5e701dd5c1'
gg_zhibanren = [['李健', '15961709154'],
['徐鑫鑫', '18768147457'],
['苏志道', '15521876004'],
['陈凯林', '18363750961'],
['黎俊芳', '13609444067'],
['樊佳', '13007295320'],
['余宁宁', '15356195820']]
gg_token = '18a408be88a6c0ed4f56e7edf8c40fa9d30c0b40d3695674ba326f7ccfc79310'
gg_secret = 'SEC3d0e79f76b5207c3f945762dc79e34a645ec80c391fb25942f96afc1a60a5475'
cx_zhibanren = [['何亚辉', '15536261700'],
['张国政', '18538976289'],
['赵肖炜', '18768105694'],
['毛宝', '17681879658'],
['余伟华', '15756006525'],
['金周萍', '13666745601'],
['陶燕红', '15061800715']]
cx_token = '786c9b2957e6fdf44d91df3bc02f86ff5196ac39f31726d2b7055189b7355ed7'
cx_secret = 'SECcc1be901d1ed9099e35711da3df17f090b780a44318abae72dac68c860a5548e'
bq_zhibanren = [['雷婷婷', '15858168079'],
['周梓武', '15932935281'],
['韩占利', '13116742018'],
['杨贺晨吉', '13588735854'],
['余宁宁', '15356195820'],
['廖锟', '15168288343'],
['王鹏飞', '18621027261']]
bq_token = '915e0bb0729a82575d2b77bf8e89a986eae0d8592842a1966d6a4d748df8dcd3'
bq_secret = 'SEC257309c734c7c21888355a3ae7106ba2fa3a2c59aceb4304995f01882be36cd9'
ll_zhibanren = get_watcher_list('media')
gg_zhibanren = get_watcher_list('advert')
cx_zhibanren = get_watcher_list('cx')
bq_zhibanren = get_watcher_list('bq')
# 获取当天日期
currentdate = datetime.date.today()
currentday = calendar.weekday(currentdate.year, currentdate.month, currentdate.day)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment