public function created(Material $material) { //artile类型不可放到监听中 if ($material->type != 'article' && !$material->original_id && $material->parent_id) { $material->original_id = $this->materialService->postToRemote($material); } }
/** * Execute the job. */ public function handle(MaterialService $materialService) { if (!$this->account) { $this->delete(); } $materialService->syncRemoteMaterial($this->account, 'news'); $this->delete(); }
/** * 创建一个mediaId类型的回复事件 * * @param string $materialId 原始图片素材Id * * @return string 事件key */ public function makeMediaId($materialId) { $mediaId = $this->materialService->localizeInterimMaterialId($materialId); return $this->eventRepository->storeMaterial($mediaId); }