Skip to content
关注公众号,获取新课通知

指定视频下的所有视频列表


控制器:app/controller/video_detail.js

js
async index() {
       let { ctx, app } = this;
       ctx.validate({
           video_id: {
               type: "int",
               required: true,
               desc: "视频ID"
           }
       });
       let { video_id } = ctx.params;
       let rows = await app.model.VideoDetail.findAll({
           where: {
               video_id
           }
       });
       ctx.apiSuccess(rows);
   }

路由:app/router.js

js
router.get("/video_detail/:video_id", controller.videoDetail.index);