400 lines
13 KiB
JavaScript
Executable File
400 lines
13 KiB
JavaScript
Executable File
var express = require('express');
|
||
var router = express.Router();
|
||
|
||
const comment = [
|
||
{
|
||
id: 1,
|
||
headUrl: "https://upload.jianshu.io/users/upload_avatars/301940/189d69dd-af7c-4290-9e2c-89e98acf3603.jpg?imageMogr2/auto-orient/strip|imageView2/1/w/96/h/96/format/webp",
|
||
name: "白勺啊达",
|
||
creatTime: 1653891944578,
|
||
like: 30,
|
||
content: "歌名:判你[doge][歪嘴]"
|
||
},
|
||
{
|
||
id: 2,
|
||
headUrl: "https://upload.jianshu.io/users/upload_avatars/301940/189d69dd-af7c-4290-9e2c-89e98acf3603.jpg?imageMogr2/auto-orient/strip|imageView2/1/w/96/h/96/format/webp",
|
||
name: "汽水不自闭",
|
||
creatTime: 1653891944578,
|
||
like: 30,
|
||
content: "爱你"
|
||
},
|
||
{
|
||
id: 3,
|
||
headUrl: "https://upload.jianshu.io/users/upload_avatars/301940/189d69dd-af7c-4290-9e2c-89e98acf3603.jpg?imageMogr2/auto-orient/strip|imageView2/1/w/96/h/96/format/webp",
|
||
name: "三木刃",
|
||
creatTime: 1653891944578,
|
||
like: 130,
|
||
content: "爱你哈哈哈"
|
||
},
|
||
{
|
||
id: 4,
|
||
headUrl: "https://upload.jianshu.io/users/upload_avatars/301940/189d69dd-af7c-4290-9e2c-89e98acf3603.jpg?imageMogr2/auto-orient/strip|imageView2/1/w/96/h/96/format/webp",
|
||
name: "爱狂三的星总",
|
||
creatTime: 1653891944578,
|
||
like: 500,
|
||
content: "久违的,本来以为你会做听我说谢谢你,结果没做"
|
||
}
|
||
]
|
||
|
||
const list = [
|
||
{
|
||
id: 1,
|
||
title: '安徽新闻综合广播',
|
||
play_url: 'https://vse2-as-all66.secdn.net/logos-chorigin/live/biblescreen-ad-free/chunklist_sess944471208.m3u8',
|
||
comment_list: []
|
||
},
|
||
{
|
||
id: 2,
|
||
title: '安徽音乐广播',
|
||
play_url: 'https://vse2-as-all66.secdn.net/logos-chorigin/live/biblescreen-ad-free/chunklist_sess944471208.m3u8',
|
||
comment_list: [
|
||
{
|
||
id: 1,
|
||
headUrl: "https://i2.hdslb.com/bfs/face/69d3154db7ed2c07d72af53a477db047c8b9eb89.jpg@160w_160h_1c_1s.webp",
|
||
name: "紅吱鴸",
|
||
createTime: 1653891944578,
|
||
like: 12,
|
||
content: "死亡如果能带走我的秘密,我何必如此小心翼翼。"
|
||
},
|
||
{
|
||
id: 2,
|
||
headUrl: "https://i2.hdslb.com/bfs/face/f735dc6d12d849253d7a90eec3dfaf68bffbacff.jpg@160w_160h_1c_1s.webp",
|
||
name: "烽火狼烟流氓兔",
|
||
createTime: 1653891944578,
|
||
like: 34,
|
||
content: "粉身碎骨浑不怕,要留清白在人间"
|
||
},
|
||
{
|
||
id: 3,
|
||
headUrl: "https://i1.hdslb.com/bfs/face/47ae263d4bf2ead854c2431c1880e1144d6a0c1b.jpg@160w_160h_1c_1s.webp",
|
||
name: "还有一天满十八",
|
||
createTime: 1653891944578,
|
||
like: 11,
|
||
content: "上一个出车祸不删手机的,已经被二三十个女朋友堵在医院了"
|
||
}
|
||
]
|
||
},
|
||
{
|
||
id: 3,
|
||
title: '宿州文艺广播',
|
||
play_url: 'https://vse2-as-all66.secdn.net/logos-chorigin/live/biblescreen-ad-free/chunklist_sess944471208.m3u8',
|
||
comment_list: [
|
||
{
|
||
id: 1,
|
||
headUrl: "https://i2.hdslb.com/bfs/face/51caec58b7dd62cbbf3ae6dcbc544f4483a18672.jpg@160w_160h_1c_1s.webp",
|
||
name: "独行长路_",
|
||
createTime: 1653891944578,
|
||
like: 1,
|
||
content: "粉骨碎身浑不怕,要把手机格式化"
|
||
},
|
||
{
|
||
id: 2,
|
||
headUrl: "https://i2.hdslb.com/bfs/face/f735dc6d12d849253d7a90eec3dfaf68bffbacff.jpg@160w_160h_1c_1s.webp",
|
||
name: "流氓兔",
|
||
createTime: 1653891944578,
|
||
like: 22,
|
||
content: "当初先生还未退出文坛时,无论多么优秀的后生,都不敢轻易发表见解,余发觉此将断送文坛的未来,便策划了这一切,使先生被迫退出文坛。如今人才济济,已然形成一个良性循环,还望先生重出江湖,著书一卷以流传后世"
|
||
},
|
||
{
|
||
id: 3,
|
||
headUrl: "https://i1.hdslb.com/bfs/face/47ae263d4bf2ead854c2431c1880e1144d6a0c1b.jpg@160w_160h_1c_1s.webp",
|
||
name: "满十八",
|
||
createTime: 1653891944578,
|
||
like: 67,
|
||
content: "独老师当时退出文坛时我是第一个不同意的"
|
||
}
|
||
]
|
||
},
|
||
{
|
||
id: 4,
|
||
title: '安徽城市之声',
|
||
play_url: 'https://vse2-as-all66.secdn.net/logos-chorigin/live/biblescreen-ad-free/chunklist_sess944471208.m3u8',
|
||
comment_list: [
|
||
{
|
||
id: 1,
|
||
headUrl: "https://i2.hdslb.com/bfs/face/115451abd5cc3e45b7fc7dcc8c049bb2044f5efb.jpg@160w_160h_1c_1s.webp",
|
||
name: "中国霸天下",
|
||
createTime: 1653891944578,
|
||
like: 34,
|
||
content: "他里面的内容应该不是普通题材的H片,因为普通大家都看没啥社死的。估计是一些奇奇怪怪的题材才让他这么拼。"
|
||
}
|
||
]
|
||
},
|
||
{
|
||
id: 5,
|
||
title: '安徽农村广播',
|
||
play_url: 'https://vse2-as-all66.secdn.net/logos-chorigin/live/biblescreen-ad-free/chunklist_sess944471208.m3u8',
|
||
comment_list: [
|
||
{
|
||
id: 1,
|
||
headUrl: "https://i2.hdslb.com/bfs/face/a06488ccf44948a119e4ea379a7f55454c0b9f87.jpg@160w_160h_1c_1s.webp",
|
||
name: "时崎御坂",
|
||
createTime: 1653891944578,
|
||
like: 87,
|
||
content: "希望以后有人发明一个检测器,一但自己生命体征消失自动格式化家里的电脑"
|
||
}
|
||
]
|
||
},
|
||
{
|
||
id: 6,
|
||
title: '芜湖交通经济广播',
|
||
play_url: 'https://vse2-as-all66.secdn.net/logos-chorigin/live/biblescreen-ad-free/chunklist_sess944471208.m3u8',
|
||
comment_list: [
|
||
{
|
||
id: 1,
|
||
headUrl: "https://i0.hdslb.com/bfs/face/5cd9ee79a853eb782aad4552aa74ea2be67cff5c.jpg@160w_160h_1c_1s.webp",
|
||
name: "寻你-无寂夜",
|
||
createTime: 1653891944578,
|
||
like: 56,
|
||
content: "属实泪目了,害怕敌特分子发现绝密级文件吧"
|
||
}
|
||
]
|
||
},
|
||
{
|
||
id: 7,
|
||
title: '安徽故事广播',
|
||
play_url: 'https://vse2-as-all66.secdn.net/logos-chorigin/live/biblescreen-ad-free/chunklist_sess944471208.m3u8',
|
||
comment_list: [
|
||
{
|
||
id: 1,
|
||
headUrl: "https://i0.hdslb.com/bfs/face/586f2a6d9a21a877b23a30598c19126edb1273d2.jpg@160w_160h_1c_1s.webp",
|
||
name: "超级大冰冰冰冰",
|
||
createTime: 1653891944578,
|
||
like: 32,
|
||
content: "我居然把标题看成“男子把车撞出3米”"
|
||
}
|
||
]
|
||
},
|
||
{
|
||
id: 8,
|
||
title: '黄山新闻综合广播',
|
||
play_url: 'https://vse2-as-all66.secdn.net/logos-chorigin/live/biblescreen-ad-free/chunklist_sess944471208.m3u8',
|
||
comment_list: []
|
||
},
|
||
{
|
||
id: 9,
|
||
title: '宿州交通广播',
|
||
play_url: 'https://vse2-as-all66.secdn.net/logos-chorigin/live/biblescreen-ad-free/chunklist_sess944471208.m3u8',
|
||
comment_list: [
|
||
{
|
||
id: 1,
|
||
headUrl: "https://i2.hdslb.com/bfs/face/716697f4ce8a04b24dd140793a3f32422a411533.jpg@160w_160h_1c_1s.webp",
|
||
name: "I鬼谷千寻l",
|
||
createTime: 1653891944578,
|
||
like: 90,
|
||
content: "死去元知万事空,但悲未格手机式"
|
||
}
|
||
]
|
||
},
|
||
{
|
||
id: 10,
|
||
title: '经典983电台',
|
||
play_url: 'https://vse2-as-all66.secdn.net/logos-chorigin/live/biblescreen-ad-free/chunklist_sess944471208.m3u8',
|
||
comment_list: []
|
||
}
|
||
];
|
||
|
||
|
||
/**
|
||
* @api {get} /radio /radio
|
||
* @apiDescription 获取包河Radio数据,不需要参数,传空对象 {} 即可 )
|
||
* @apiName radio
|
||
* @apiGroup 接口
|
||
* @apiSuccessExample {json} 请求成功的返回:
|
||
* {
|
||
* "status" : 200,
|
||
* "message" : "请求成功"
|
||
* "result" : "asjXzXxmnSp8TZGWiTSlJF8Gb...5LhYoHs86SEI2LBXrTZ9e/a4frZOWHZ"
|
||
* }
|
||
* @apiErrorExample {json} 请求失败的返回
|
||
* {
|
||
* "status": 404,
|
||
* "message" : "请求失败"
|
||
* "result": null
|
||
* }
|
||
* @apiSampleRequest http://127.0.0.1:3000/api/json/radio
|
||
* @apiVersion 1.0.0
|
||
*/
|
||
router.get('/radio', function (req, res, next) {
|
||
res.json({
|
||
status: 200,
|
||
message: '请求成功',
|
||
data: {
|
||
play_title: '包河之声',
|
||
play_img: 'https://pic.qtfm.cn/2020/0311/20200311053004.png',
|
||
play_url: 'https://dh5.cntv.myhwcdn.cn/asp/h5e/hls/1200/0303000a/3/default/884a902046de40f780bee8abd855fb95/1200.m3u8'
|
||
}
|
||
});
|
||
});
|
||
|
||
|
||
/**
|
||
* @api {get} /tv /tv
|
||
* @apiDescription 获取包河tv数据,不需要参数,传空对象 {} 即可 )
|
||
* @apiName tv
|
||
* @apiGroup 接口
|
||
* @apiSuccessExample {json} 请求成功的返回:
|
||
* {
|
||
* "status" : 200,
|
||
* "message" : "请求成功"
|
||
* "result" : "asjXzXxmnSp8TZGWiTSlJF8Gb...5LhYoHs86SEI2LBXrTZ9e/a4frZOWHZ"
|
||
* }
|
||
* @apiErrorExample {json} 请求失败的返回
|
||
* {
|
||
* "status": 404,
|
||
* "message" : "请求失败"
|
||
* "result": null
|
||
* }
|
||
* @apiSampleRequest http://127.0.0.1:3000/api/json/tv
|
||
* @apiVersion 1.0.0
|
||
*/
|
||
router.get('/tv', function (req, res, next) {
|
||
res.json({
|
||
status: 200,
|
||
message: '请求成功',
|
||
data: list
|
||
});
|
||
});
|
||
|
||
|
||
/**
|
||
* @api {get} /videoPlay /videoPlay
|
||
* @apiDescription 视频点播 页面
|
||
* @apiName videoPlay
|
||
* @apiGroup 接口
|
||
* @apiParam {number} id 视频的id
|
||
* @apiSuccessExample {json} 请求成功的返回:
|
||
* {
|
||
* "status" : 200,
|
||
* "message" : "请求成功"
|
||
* "result" : "asjXzXxmnSp8TZGWiTSlJF8Gb...5LhYoHs86SEI2LBXrTZ9e/a4frZOWHZ"
|
||
* }
|
||
* @apiErrorExample {json} 请求失败的返回
|
||
* {
|
||
* "status": 404,
|
||
* "message" : "请求失败"
|
||
* "result": null
|
||
* }
|
||
* @apiSampleRequest http://127.0.0.1:3000/api/json/videoPlay?id=14
|
||
* @apiVersion 1.0.0
|
||
*/
|
||
router.get('/videoPlay', function (req, res, next) {
|
||
const { id } = req.query;
|
||
|
||
res.json({
|
||
status: 200,
|
||
message: '请求成功',
|
||
data: {
|
||
id,
|
||
play_url: 'https://vse2-as-all66.secdn.net/logos-chorigin/live/biblescreen-ad-free/chunklist_sess944471208.m3u8',
|
||
play_title: '加强雪糕产品抽检力度:上半年全国市场监管部门抽检3137批次雪糕产品',
|
||
play_time: '2022-07-12 10:45',
|
||
play_fabulous: 102,
|
||
play_desc: '据初步统计,2022年上半年,全国各级市场监管部门共组织监督抽检3137批次雪糕产品,其中检出不合格样品15批次,不合格项目为菌落总数、大肠菌群、单增李斯特菌和蛋白质。',
|
||
relevantRecommendations: [
|
||
{
|
||
content: "台达伺服电机ASDA-B3",
|
||
creatTime: 1653048900000,
|
||
image: "https://i0.hdslb.com/bfs/article/14cddf36b3efde98e3bc8733c8cde181bcb5e621.png@810w_1311h_progressive.webp"
|
||
},
|
||
{
|
||
content: "【韩网新闻】金钟国x尹恩惠,在刘在石不知情的情况下“恋爱”?…“视网膜”重新点燃",
|
||
creatTime: 1653048900000,
|
||
image: "https://i0.hdslb.com/bfs/article/2d3eacf786742f88d1235d305faf8c9497863fd7.png@810w_455h_progressive.webp"
|
||
},
|
||
],
|
||
comment: comment,
|
||
}
|
||
});
|
||
});
|
||
|
||
/**
|
||
* 溶媒直播
|
||
*/
|
||
router.get('/live', function (req, res, next) {
|
||
res.json({
|
||
status: 200,
|
||
message: '请求成功',
|
||
data: [
|
||
{
|
||
id: 1,
|
||
paly_title: '时政新闻眼丨从四个关键词,看习近平总书记新疆之行',
|
||
paly_img: 'https://p2.img.cctvpic.com/photoworkspace/2022/07/16/2022071616363178983.jpg',
|
||
paly_type: 1,
|
||
paly_text: '正在直播',
|
||
play_count: 2341,
|
||
play_time: null
|
||
},
|
||
{
|
||
id: 2,
|
||
paly_title: '新疆和若铁路开通运营“满月” 日均送客3100多人',
|
||
paly_img: 'https://p2.img.cctvpic.com/photoworkspace/2022/07/16/2022071616352941281.jpg',
|
||
paly_type: 1,
|
||
paly_text: '正在直播',
|
||
play_count: 461,
|
||
play_time: null
|
||
},
|
||
{
|
||
id: 3,
|
||
paly_title: '加拿大一富商遭枪杀 曾被控策划1985年印航恐袭',
|
||
paly_img: 'https://p3.img.cctvpic.com/photoworkspace/2022/07/16/2022071616321582632.jpg',
|
||
paly_type: 2,
|
||
paly_text: '直播预告',
|
||
play_count: 59872,
|
||
play_time: 1653891944578
|
||
},
|
||
{
|
||
id: 4,
|
||
paly_title: '俄美同意两国宇航员“交叉飞行”前往国际空间站',
|
||
paly_img: 'https://p5.img.cctvpic.com/photoworkspace/2022/07/16/2022071616272840854.jpg',
|
||
paly_type: 3,
|
||
paly_text: '回放',
|
||
play_count: 49179,
|
||
play_time: null
|
||
}
|
||
]
|
||
});
|
||
});
|
||
|
||
/**
|
||
* @api {get} /tvInfo /tvInfo
|
||
* @apiDescription 看电视(tv)详情 页面
|
||
* @apiName tvInfo
|
||
* @apiGroup 接口
|
||
* @apiParam {number} id tv的详情id
|
||
* @apiSuccessExample {json} 请求成功的返回:
|
||
* {
|
||
* "status" : 200,
|
||
* "message" : "请求成功"
|
||
* "result" : "asjXzXxmnSp8TZGWiTSlJF8Gb...5LhYoHs86SEI2LBXrTZ9e/a4frZOWHZ"
|
||
* }
|
||
* @apiErrorExample {json} 请求失败的返回
|
||
* {
|
||
* "status": 404,
|
||
* "message" : "请求失败"
|
||
* "result": null
|
||
* }
|
||
* @apiSampleRequest http://127.0.0.1:3000/api/json/tvInfo?id=2
|
||
* @apiVersion 1.0.0
|
||
*/
|
||
router.get('/tvInfo', function (req, res, next) {
|
||
const { id } = req.query
|
||
let arr = {
|
||
current: {},
|
||
list
|
||
}
|
||
list.forEach(v => {
|
||
if (v.id == id) {
|
||
arr.current = v;
|
||
}
|
||
});
|
||
|
||
res.json({
|
||
status: 200,
|
||
message: '请求成功',
|
||
data: arr
|
||
});
|
||
});
|
||
|
||
module.exports = router;
|