| Total Complexity | 7 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Coverage | 46.15% |
| 1 | # -*- coding: utf-8 -*- |
||
| 6 | 10 | class MerchantExpress(BaseWeChatAPI): |
|
| 7 | |||
| 8 | 10 | def add(self, delivery_template): |
|
| 9 | return self._post( |
||
| 10 | 'merchant/express/add', |
||
| 11 | data={ |
||
| 12 | 'delivery_template': delivery_template |
||
| 13 | } |
||
| 14 | ) |
||
| 15 | |||
| 16 | 10 | def delete(self, template_id): |
|
| 17 | return self._post( |
||
| 18 | 'merchant/express/del', |
||
| 19 | data={ |
||
| 20 | 'template_id': template_id |
||
| 21 | } |
||
| 22 | ) |
||
| 23 | |||
| 24 | 10 | def update(self, template_id, delivery_template): |
|
| 25 | return self._post( |
||
| 26 | 'merchant/express/update', |
||
| 27 | data={ |
||
| 28 | 'template_id': template_id, |
||
| 29 | 'delivery_template': delivery_template |
||
| 30 | } |
||
| 31 | ) |
||
| 32 | |||
| 33 | 10 | def get(self, template_id): |
|
| 34 | res = self._post( |
||
| 35 | 'merchant/express/getbyid', |
||
| 36 | data={ |
||
| 37 | 'template_id': template_id |
||
| 38 | }, |
||
| 39 | result_processor=lambda x: x['template_info'] |
||
| 40 | ) |
||
| 41 | return res |
||
| 42 | |||
| 43 | 10 | def get_all(self): |
|
| 44 | res = self._get( |
||
| 45 | 'merchant/express/getall', |
||
| 46 | result_processor=lambda x: x['template_info'] |
||
| 47 | ) |
||
| 48 | return res |
||
| 49 |