getChannelId(); $book_id = $request->has('book_id') ? $request->input('book_id') : ''; $subscribe_chapter_id = $request->has('subscribe_chapter_seq') ? $request->input('subscribe_chapter_seq') : ''; if (empty($book_id) || empty($subscribe_chapter_id)) { return response()->error("PARAM_EMPTY"); } $book_id = Hashids::decode($book_id)[0]; if (!is_numeric($book_id) || !is_numeric($subscribe_chapter_id)) { return response()->error("PARAM_ERROR"); } $result = BookSubscribleChapterService::setSubcribleChapter(compact('channel_id', 'book_id', 'subscribe_chapter_id')); if ($result) { return response()->success(); } else { return response()->error("HANDLE_FAILED"); } } /** * @apiVersion 1.0.0 * @apiDescription 查询强关章节 * @api {get} book/getSubScribleChapter 查询强关章节 * @apiGroup Book * @apiParam {Number} book_id 图书id * @apiName getSubScribleChapter * @apiSuccessExample {json} Success-Response: * * { * "code": 0, * "msg": "", * "data":11, * } */ function getSubScribleChapter(Request $request) { $book_id = $request->has('book_id') ? $request->input('book_id') : ''; if (empty($book_id)) { return response()->error("PARAM_EMPTY"); } $book_id = Hashids::decode($book_id)[0]; if (!is_numeric($book_id)) { return response()->error("PARAM_ERROR"); } $distribution_channel_id = $this->getChannelId(); $result = BookSubscribleChapterService::getSubcribleChapter($book_id, $distribution_channel_id); return response()->success($result); } }