Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jpush-api-python-client
Project
Project
Details
Activity
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
钟尚武
jpush-api-python-client
Commits
9e6d7897
Commit
9e6d7897
authored
May 17, 2018
by
Helperhaps
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add device status & update smsmessage method
parent
b0e84253
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
4 deletions
+21
-4
device_example.py
examples/device_example.py
+4
-0
__init__.py
jpush/__init__.py
+1
-1
core.py
jpush/device/core.py
+12
-0
payload.py
jpush/push/payload.py
+4
-3
No files found.
examples/device_example.py
View file @
9e6d7897
...
...
@@ -52,3 +52,7 @@ def update_device_mobile():
reg_id
=
'1507bfd3f7c466c355c'
entity
=
jpush
.
device_mobile
(
"18588232140"
)
device
.
set_devicemobile
(
reg_id
,
entity
)
def
get_device_status
():
reg_id
=
'1507bfd3f7c466c355c'
device
.
get_device_status
(
reg_id
)
jpush/__init__.py
View file @
9e6d7897
...
...
@@ -75,7 +75,7 @@ __all__ = [
schedulepayload
,
]
__version__
=
'3.
2.9
'
__version__
=
'3.
3.0
'
VERSION
=
tuple
(
map
(
int
,
__version__
.
split
(
'.'
)))
# Silence urllib3 INFO logging by default
...
...
jpush/device/core.py
View file @
9e6d7897
...
...
@@ -88,6 +88,18 @@ class Device(object):
info
=
self
.
send
(
"GET"
,
url
,
params
=
params
)
return
info
def
get_device_status
(
self
,
reg_ids
):
"""Get Online Status of User (VIP Exclusive Interface)
"""
url
=
common
.
get_url
(
'device'
,
self
.
zone
)
+
'status'
if
isinstance
(
reg_ids
,
str
):
reg_ids
=
[
reg_ids
]
entity
=
{
'registration_ids'
:
reg_ids
}
body
=
json
.
dumps
(
entity
)
info
=
self
.
send
(
"POST"
,
url
,
body
)
return
info
class
DeviceResponse
(
object
):
"""Response to a successful device request send.
...
...
jpush/push/payload.py
View file @
9e6d7897
...
...
@@ -158,11 +158,12 @@ def message(msg_content, title=None, content_type=None, extras=None):
payload
[
'extras'
]
=
extras
return
payload
def
smsmessage
(
content
,
delay_time
):
def
smsmessage
(
delay_time
,
temp_id
,
temp_para
=
None
):
payload
=
{}
payload
[
"content"
]
=
content
payload
[
"delay_time"
]
=
delay_time
payload
[
"temp_id"
]
=
temp_id
if
temp_para
is
not
None
:
payload
[
'temp_para'
]
=
temp_para
return
payload
...
...
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