获取-新闻列表
GET
/api/news获取新闻列表
请求参数
无
示例代码
返回响应
成功(200)
HTTP 状态码: 200
内容格式: JSONapplication/json
数据结构
message
string
响应消息
data
array [object {6}]
响应数据
id
integer
新闻id
title
string
新闻标题
source
string
新闻来源
cmtcount
integer
新闻评论总数
img
string
新闻图片地址
只有后半段_前面自己拼接基地址/public再使用
例如: http://ajax-api.itheima.net/public/images/2.webp
time
string
新闻发布时间
示例成功示例
{
"message": "获取新闻列表成功",
"data": [
{
"id": 1,
"title": "5G商用在即,三大运营商营收持续下降",
"source": "新京报经济新闻",
"cmtcount": 58,
"img": "/images/0.webp",
"time": "2019-10-28 11:50:28"
},
{
"id": 2,
"title": "国际媒体头条速览:特朗普宣布杀死巴格达迪时,有人想起了奥巴马",
"source": "环视全球",
"cmtcount": 56,
"img": "/images/1.webp",
"time": "2019-10-27 13:50:55"
},
{
"id": 3,
"title": "华为5G随行WiFi发布,5G布局全面领先苹果、三星",
"source": "驱动中国网络传媒",
"cmtcount": 32,
"img": "/images/2.webp",
"time": "2019-10-26 16:51:30"
},
{
"id": 4,
"title": "沈义人:首批5G手机最好选集成SoC和双模SA+NSA",
"source": "手机中国",
"cmtcount": 18,
"img": "/images/3.webp",
"time": "2019-10-25 18:03:21"
},
{
"id": 5,
"title": "为什么说中美阶段性协议再近一步,读懂周末的这些关键信息",
"source": "澎湃新闻",
"cmtcount": 131,
"img": "/images/4.webp",
"time": "2019-10-24 09:08:34"
},
{
"id": 6,
"title": "阿根廷大选结果揭晓:反对派候选人费尔南德斯当选下任总统",
"source": "海外网",
"cmtcount": 99,
"img": "/images/5.webp",
"time": "2019-10-23 17:41:15"
},
{
"id": 7,
"title": "赵薇谈演员整容:不是一件坏事情,但劝大家别整太像",
"source": "腾讯视频Big磅来了",
"cmtcount": 154,
"img": "/images/6.webp",
"time": "2019-10-23 00:43:29"
},
{
"id": 8,
"title": "LV母公司史上最大并购:报价145亿美元购Tiffany",
"source": "澎湃新闻",
"cmtcount": 119,
"img": "/images/7.webp",
"time": "2019-10-22 03:59:44"
},
{
"id": 9,
"title": "黄峥1350亿蝉联80后白手起家首富:过去1年财富每天涨1个亿",
"source": "胡润百富",
"cmtcount": 676,
"img": "/images/8.webp",
"time": "2019-10-21 06:19:37"
}
]
}
最后修改时间: 2 年前