On this page
指定视频下的所有视频列表
控制器: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);