| @@ 17-55 (lines=39) @@ | ||
| 14 | * @property string $thumb_media_id |
|
| 15 | * @property string $show_cover |
|
| 16 | */ |
|
| 17 | class Article extends AbstractMessage |
|
| 18 | { |
|
| 19 | /** |
|
| 20 | * Properties. |
|
| 21 | * |
|
| 22 | * @var array |
|
| 23 | */ |
|
| 24 | protected $properties = [ |
|
| 25 | 'thumb_media_id', |
|
| 26 | 'author', |
|
| 27 | 'title', |
|
| 28 | 'content', |
|
| 29 | 'digest', |
|
| 30 | 'source_url', |
|
| 31 | 'show_cover', |
|
| 32 | ]; |
|
| 33 | ||
| 34 | /** |
|
| 35 | * Aliases of attribute. |
|
| 36 | * |
|
| 37 | * @var array |
|
| 38 | */ |
|
| 39 | protected $aliases = [ |
|
| 40 | 'source_url' => 'content_source_url', |
|
| 41 | 'show_cover' => 'show_cover_pic', |
|
| 42 | ]; |
|
| 43 | ||
| 44 | /** |
|
| 45 | * @param $mediaId |
|
| 46 | * |
|
| 47 | * @return $this |
|
| 48 | */ |
|
| 49 | public function thumb($mediaId) |
|
| 50 | { |
|
| 51 | $this->setAttribute('thumb_media_id', $mediaId); |
|
| 52 | ||
| 53 | return $this; |
|
| 54 | } |
|
| 55 | } |
|
| 56 | ||
| @@ 16-63 (lines=48) @@ | ||
| 13 | * @property string $digest |
|
| 14 | * @property string $show_cover |
|
| 15 | */ |
|
| 16 | class MpNews extends AbstractMessage |
|
| 17 | { |
|
| 18 | /** |
|
| 19 | * Message type. |
|
| 20 | * |
|
| 21 | * @var string |
|
| 22 | */ |
|
| 23 | protected $type = 'mpnews'; |
|
| 24 | ||
| 25 | /** |
|
| 26 | * Properties. |
|
| 27 | * |
|
| 28 | * @var array |
|
| 29 | */ |
|
| 30 | protected $properties = [ |
|
| 31 | 'title', |
|
| 32 | 'thumb_media_id', |
|
| 33 | 'author', |
|
| 34 | 'source_url', |
|
| 35 | 'content', |
|
| 36 | 'digest', |
|
| 37 | 'show_cover', |
|
| 38 | ]; |
|
| 39 | ||
| 40 | /** |
|
| 41 | * Aliases of attribute. |
|
| 42 | * |
|
| 43 | * @var array |
|
| 44 | */ |
|
| 45 | protected $aliases = [ |
|
| 46 | 'source_url' => 'content_source_url', |
|
| 47 | 'show_cover' => 'show_cover_pic', |
|
| 48 | ]; |
|
| 49 | ||
| 50 | /** |
|
| 51 | * 设置音乐封面. |
|
| 52 | * |
|
| 53 | * @param string $mediaId |
|
| 54 | * |
|
| 55 | * @return $this |
|
| 56 | */ |
|
| 57 | public function thumb($mediaId) |
|
| 58 | { |
|
| 59 | $this->setAttribute('thumb_media_id', $mediaId); |
|
| 60 | ||
| 61 | return $this; |
|
| 62 | } |
|
| 63 | } |
|
| 64 | ||