success($this->service->getReceiveMessage($this->request->all())); } /** * 已发送消息列表 * @return ResponseInterface * @throws \Psr\Container\ContainerExceptionInterface * @throws \Psr\Container\NotFoundExceptionInterface */ #[GetMapping("sendList")] public function sendList(): ResponseInterface { return $this->success($this->service->getSendMessage($this->request->all())); } /** * 发私信 * @param MessageRequest $request * @return ResponseInterface * @throws \Psr\Container\ContainerExceptionInterface * @throws \Psr\Container\NotFoundExceptionInterface * @throws \Throwable */ #[PostMapping("sendPrivateMessage")] public function sendPrivateMessage(MessageRequest $request): ResponseInterface { return $this->service->sendPrivateMessage($request->validated()) ? $this->success() : $this->error(); } /** * 获取接收人列表 * @return ResponseInterface * @throws \Psr\Container\ContainerExceptionInterface * @throws \Psr\Container\NotFoundExceptionInterface */ #[GetMapping("getReceiveUser")] public function getReceiveUser(): ResponseInterface { return $this->success( $this->service->getReceiveUserList( (int) $this->request->input('id', 0), $this->request->all() ) ); } /** * 单个或批量删除数据到回收站 * @return ResponseInterface * @throws \Psr\Container\ContainerExceptionInterface * @throws \Psr\Container\NotFoundExceptionInterface */ #[DeleteMapping("deletes")] public function deletes(): ResponseInterface { return $this->service->delete((array) $this->request->input('ids', [])) ? $this->success() : $this->error(); } /** * 更新状态到已读 * @return ResponseInterface * @throws \Psr\Container\ContainerExceptionInterface * @throws \Psr\Container\NotFoundExceptionInterface */ #[PutMapping("updateReadStatus")] public function updateReadStatus(): ResponseInterface { return $this->service->updateDataStatus((array) $this->request->input('ids', [])) ? $this->success() : $this->error(); } }