|
1
|
|
|
# -*- coding: utf-8 -*- |
|
2
|
|
|
from __future__ import absolute_import, unicode_literals |
|
3
|
|
|
|
|
4
|
|
|
|
|
5
|
|
|
class BaseSchoolApi(object): |
|
6
|
|
|
""" WeChat API base class """ |
|
7
|
|
|
|
|
8
|
|
|
def __init__(self, client=None): |
|
9
|
|
|
self._client = client |
|
10
|
|
|
|
|
11
|
|
|
def _get(self, url, **kwargs): |
|
12
|
|
|
return self._client.get(url, **kwargs) |
|
13
|
|
|
|
|
14
|
|
|
def _post(self, url, **kwargs): |
|
15
|
|
|
return self._client.post(url, **kwargs) |
|
16
|
|
|
|
|
17
|
|
|
def _head(self, url, **kwargs): |
|
18
|
|
|
return self._client.head(url, **kwargs) |
|
19
|
|
|
|
|
20
|
|
|
def _get_view_state(self, url, **kwargs): |
|
21
|
|
|
return self._client.get_view_state(url, **kwargs) |
|
22
|
|
|
|
|
23
|
|
|
def _switch_proxy(self): |
|
24
|
|
|
return self._client.switch_proxy() |
|
25
|
|
|
|
|
26
|
|
|
def _update_url_token(self, url_token): |
|
27
|
|
|
return self._client.update_url_token(url_token) |
|
28
|
|
|
|
|
29
|
|
|
@property |
|
30
|
|
|
def code(self): |
|
31
|
|
|
return self._client.school.code |
|
32
|
|
|
|
|
33
|
|
|
@property |
|
34
|
|
|
def account(self): |
|
35
|
|
|
return self._client.account |
|
36
|
|
|
|
|
37
|
|
|
@property |
|
38
|
|
|
def password(self): |
|
39
|
|
|
return self._client.password |
|
40
|
|
|
|
|
41
|
|
|
@property |
|
42
|
|
|
def session(self): |
|
43
|
|
|
return self._client.session |
|
44
|
|
|
|
|
45
|
|
|
@property |
|
46
|
|
|
def user_type(self): |
|
47
|
|
|
return self._client.user_type |
|
48
|
|
|
|
|
49
|
|
|
@property |
|
50
|
|
|
def base_url(self): |
|
51
|
|
|
return self._client.base_url |
|
52
|
|
|
|
|
53
|
|
|
@property |
|
54
|
|
|
def school_url(self): |
|
55
|
|
|
return self._client.school.url_endpoint[self.user_type] |
|
56
|
|
|
|
|
57
|
|
|
@property |
|
58
|
|
|
def time_list(self): |
|
59
|
|
|
return self._client.school.time_list |
|
60
|
|
|
|