post()->goCheck('greet'); $result = MessageLogic::greetMessage($params); if ($result) { return $this->success(); } return $this->fail(MessageLogic::getError()); } catch (HttpResponseException $e) { return $this->fail($e->getResponse()->getData()['msg'] ?? ''); } } /** * @desc 发送消息 */ public function send() { try { $params = (new MessageValidate())->post()->goCheck('send'); $result = MessageLogic::sendMessage($params); if ($result) { return $this->success(); } return $this->fail(MessageLogic::getError()); } catch (HttpResponseException $e) { return $this->fail($e->getResponse()->getData()['msg'] ?? ''); } } }