@@ -10,39 +10,37 @@ class Schedule(object):
1010 def __init__ (self , jpush ):
1111 self ._jpush = jpush
1212
13- def send (self , method , url , body , content_type = None , version = 3 ):
14- response = self ._jpush ._request (method , body , url , content_type , version = 3 )
13+ def send (self , method , url , body , content_type = None , version = 3 , params = None ):
14+ response = self ._jpush ._request (method , body , url , content_type , version = 3 , params = params )
1515 return ScheduleResponse (response )
1616
1717 def post_schedule (self , schedulepayload ):
18- url = common .BASE_SCHEDULEURL
18+ url = common .SCHEDULE_URL
1919 body = json .dumps (schedulepayload )
2020 result = self .send ("POST" , url , body )
2121 return result
2222
2323 def get_schedule_by_id (self , schedule_id ):
24- url = common .BASE_SCHEDULEURL + schedule_id
24+ url = common .SCHEDULE_URL + schedule_id
2525 body = None
2626 result = self .send ("GET" , url , body )
2727 return result
2828
29- def get_schedule_list (self , page_id ):
30- if page_id is not None :
31- url = common .BASE_LISTURL + page_id
32- else :
33- url = common .BASE_LISTURL
29+ def get_schedule_list (self , page = 1 ):
30+ url = common .SCHEDULE_URL
31+ params = { 'page' : page }
3432 body = None
35- result = self .send ("GET" , url , body )
33+ result = self .send ("GET" , url , body , params = params )
3634 return result
3735
3836 def put_schedule (self , schedulepayload , schedule_id ):
39- url = common .BASE_SCHEDULEURL + schedule_id
37+ url = common .SCHEDULE_URL + schedule_id
4038 body = json .dumps (schedulepayload )
4139 result = self .send ("PUT" , url , body )
4240 return result
4341
4442 def delete_schedule (self ,schedule_id ):
45- url = common .BASE_SCHEDULEURL + schedule_id
43+ url = common .SCHEDULE_URL + schedule_id
4644 body = None
4745 result = self .send ("DELETE" , url , body )
4846 return result
0 commit comments