Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
py12306
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
python
py12306
Commits
8a0309dd
Commit
8a0309dd
authored
Jan 14, 2019
by
Echowxsy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加钉钉消息通知测试
parent
18df704c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
+6
-0
app.py
py12306/app.py
+4
-0
common_log.py
py12306/log/common_log.py
+2
-0
No files found.
py12306/app.py
View file @
8a0309dd
...
@@ -109,6 +109,10 @@ class App:
...
@@ -109,6 +109,10 @@ class App:
CommonLog
.
add_quick_log
(
CommonLog
.
MESSAGE_TEST_SEND_EMAIL
)
.
flush
()
CommonLog
.
add_quick_log
(
CommonLog
.
MESSAGE_TEST_SEND_EMAIL
)
.
flush
()
Notification
.
send_email
(
Config
()
.
EMAIL_RECEIVER
,
'测试发送邮件'
,
'By py12306'
)
Notification
.
send_email
(
Config
()
.
EMAIL_RECEIVER
,
'测试发送邮件'
,
'By py12306'
)
if
Config
()
.
DINGTALK_ENABLED
:
# 钉钉通知
CommonLog
.
add_quick_log
(
CommonLog
.
MESSAGE_TEST_SEND_DINGTALK
)
.
flush
()
Notification
.
dingtalk_webhook
(
'测试发送信息'
)
@
classmethod
@
classmethod
def
run_check
(
cls
):
def
run_check
(
cls
):
"""
"""
...
...
py12306/log/common_log.py
View file @
8a0309dd
...
@@ -23,6 +23,7 @@ class CommonLog(BaseLog):
...
@@ -23,6 +23,7 @@ class CommonLog(BaseLog):
MESSAGE_TEST_SEND_VOICE_CODE
=
'正在测试发送语音验证码...'
MESSAGE_TEST_SEND_VOICE_CODE
=
'正在测试发送语音验证码...'
MESSAGE_TEST_SEND_EMAIL
=
'正在测试发送邮件...'
MESSAGE_TEST_SEND_EMAIL
=
'正在测试发送邮件...'
MESSAGE_TEST_SEND_DINGTALK
=
'正在测试发送钉钉消息...'
MESSAGE_CONFIG_FILE_DID_CHANGED
=
'配置文件已修改,正在重新加载中
\n
'
MESSAGE_CONFIG_FILE_DID_CHANGED
=
'配置文件已修改,正在重新加载中
\n
'
MESSAGE_API_RESPONSE_CAN_NOT_BE_HANDLE
=
'接口返回错误'
MESSAGE_API_RESPONSE_CAN_NOT_BE_HANDLE
=
'接口返回错误'
...
@@ -70,6 +71,7 @@ class CommonLog(BaseLog):
...
@@ -70,6 +71,7 @@ class CommonLog(BaseLog):
self
.
add_quick_log
(
self
.
add_quick_log
(
'语音验证码: {}'
.
format
(
get_true_false_text
(
Config
()
.
NOTIFICATION_BY_VOICE_CODE
,
enable
,
disable
)))
'语音验证码: {}'
.
format
(
get_true_false_text
(
Config
()
.
NOTIFICATION_BY_VOICE_CODE
,
enable
,
disable
)))
self
.
add_quick_log
(
'邮件通知: {}'
.
format
(
get_true_false_text
(
Config
()
.
EMAIL_ENABLED
,
enable
,
disable
)))
self
.
add_quick_log
(
'邮件通知: {}'
.
format
(
get_true_false_text
(
Config
()
.
EMAIL_ENABLED
,
enable
,
disable
)))
self
.
add_quick_log
(
'钉钉通知: {}'
.
format
(
get_true_false_text
(
Config
()
.
DINGTALK_ENABLED
,
enable
,
disable
)))
self
.
add_quick_log
(
'查询间隔: {} 秒'
.
format
(
Config
()
.
QUERY_INTERVAL
))
self
.
add_quick_log
(
'查询间隔: {} 秒'
.
format
(
Config
()
.
QUERY_INTERVAL
))
self
.
add_quick_log
(
'用户心跳检测间隔: {} 秒'
.
format
(
Config
()
.
USER_HEARTBEAT_INTERVAL
))
self
.
add_quick_log
(
'用户心跳检测间隔: {} 秒'
.
format
(
Config
()
.
USER_HEARTBEAT_INTERVAL
))
self
.
add_quick_log
(
'WEB 管理页面: {}'
.
format
(
get_true_false_text
(
Config
()
.
WEB_ENABLE
,
enable
,
disable
)))
self
.
add_quick_log
(
'WEB 管理页面: {}'
.
format
(
get_true_false_text
(
Config
()
.
WEB_ENABLE
,
enable
,
disable
)))
...
...
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