getNoticeByUser($uid); $message->setResponse($data); } /** * 设置通知的开关 * @param UpdateNoticeByKeyMessage $message * @throws \App\Exceptions\AlertException * @throws \App\Exceptions\ApiException */ public function updateNoticeByKey(UpdateNoticeByKeyMessage $message) { $key = $message->getKey(); $open = $message->getIsOpen(); $uid = Auth::auth(); $manageService = new ManageService(); $manageService->updateNoticeByKey($uid, $key, $open); } /** * 设置群组通知的开关 * @param UpdateNoticeByGroupMessage $message * @throws \App\Exceptions\AlertException * @throws \App\Exceptions\ApiException */ public function updateNoticeByGroup(UpdateNoticeByGroupMessage $message) { $uid = Auth::auth(); $group = $message->getGroup(); $open = $message->getIsOpen(); $manageService = new ManageService(); $manageService->updateNoticeByGroup($uid, $group, $open); } /** * 获取通知开关 * @param GetNoticeByKeyToIntMessage $message * @throws \App\Exceptions\AlertException * @throws \App\Exceptions\ApiException */ public function getNoticeByKeyToInt(GetNoticeByKeyToIntMessage $message) { $key = $message->getKey(); $uid = Auth::auth(); $manageService = new ManageService(); $open = $manageService->getNoticeByKey2Int($uid, $key); $message->setResponse([ 'isopen' => $open ]); } }