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