12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <?php
- namespace App\Http\Controllers\KuaiYingYong\Book;
- use Illuminate\Http\Request;
- use App\Http\Controllers\Controller;
- use App\Modules\Book\Services\BookCategoryService;
- class BookCategoryController extends Controller
- {
- /**
- * @apiDefine Book 图书
- */
- /**
- * @apiVersion 1.0.0
- * @apiDescription 获取分类
- * @api {get} books/getCategory 获取分类
- * @apiParam {String} [token] token
- * @apiHeader {String} [Authorization] token 两个token任选其一
- * @apiGroup Book
- * @apiName getCategory
- * @apiSuccess {int} code 状态码
- * @apiSuccess {String} msg 信息
- * @apiSuccess {object} data 结果集
- * @apiSuccessExample {json} Success-Response:
- * HTTP/1.1 200 OK
- * {
- * code: 0,
- * msg: "",
- * data: [
- * {
- * id: 1,
- * name: "男频",
- * children: [
- * {
- * id: 7,
- * name: "灵异鬼怪"
- * },
- * {
- * id: 8,
- * name: "历史穿越"
- * },
- * {
- * id: 30,
- * name: "青春爱情"
- * }
- * ]
- * },
- * {
- * id: 2,
- * name: "女频",
- * children: [
- * {
- * id: 26,
- * name: "豪门总裁"
- * },
- * {
- * id: 35,
- * name: "民国爱情"
- * }
- * ]
- * }
- * ]
- * }
- */
- public function getCategory(Request $request){
- $res = BookCategoryService::getCategory(true);
- return response()->success($res);
- }
- }
|