无标题文章

接口文档

1.存一条news

访问路径:

http://localhost:8080/wogan/?action=saveNews&titile=savetest

成功时返回结果:

{"data":21,"status":1,"info":"ok"}

失败时返回结果:

{"data":null,"status”:50000,"info":"save news error"}

2.获得一条新闻

访问路径:

http://localhost:8080/wogan/?action=getNews&id=12

成功时返回结果:

{
"data": {
"id": 12,
"title": "",
"imgBriefUrl": "/images/news/68792873ed6c49759b0bde0333650294.jpg",
"imgContentUrl": "/images/news/dbd6cb8445174becac04039dbedf061c.jpg",
"description": null,
"content": "",
"createTime": 1449467971000,
"updateTime": null
},
"status": 1,
"info": "ok"
}

失败时返回结果:

{"data":null,"status":50001,"info":"get one news error"}

3.删除一条news

访问路径:

http://localhost:8080/wogan/?action=deleteNews&id=18

成功时返回结果:

{"data":null,"status":1,"info":"ok"}

失败时返回结果:

{"data":null,"status":50002,"info":"delete news error"}

4.保存一条news

访问路径:

http://localhost:8080/wogan/?action=uploadNews post请求

成功时返回结果:

{"data":null,"status":1,"info":"ok"}

失败时返回结果:

{"data":null,"status":50005,"info":"update news error"}

5.修改一条news 修改哪些属性则传哪些属性 id必传

访问路径:

http://localhost:8080/wogan/?action=updateNews&id=2&title=tt

成功时返回结果:

{"data":null,"status":1,"info":"ok"}

失败时返回结果:

{"data":null,"status":50004,"info":"update news error"}

6.获得news 分页

访问路径:

http://localhost:8080/wogan/?action=getNewsPagination&start=0&limit=10

成功时返回结果:

{
"data": {
"totalCount": 13,
"list": [
{
"id": 1,
"title": "title",
"imgBriefUrl": "http://wnxg.jhd.link/images/1.png",
"imgContentUrl": "url2",
"description": "desc",
"content": "content",
"createTime": 1449113147000,
"updateTime": 1449113147000
},
{
"id": 2,
"title": "tt",
"imgBriefUrl": "aaa",
"imgContentUrl": "url2",
"description": "desc",
"content": "content",
"createTime": 1449113596000,
"updateTime": 1449474149000
},
{
"id": 3,
"title": "title3",
"imgBriefUrl": "bbb",
"imgContentUrl": "url2",
"description": null,
"content": "content",
"createTime": 1449131777000,
"updateTime": 1449457905000
},
{
"id": 10,
"title": "1",
"imgBriefUrl": "/images/news/c37e9ebaf1b44a8aa9defcb65176f155.jpg",
"imgContentUrl": "/images/news/9f661deb41434e4185f391952addc5de.jpg",
"description": null,
"content": "3",
"createTime": null,
"updateTime": null
},
{
"id": 11,
"title": "newTitle",
"imgBriefUrl": null,
"imgContentUrl": null,
"description": null,
"content": null,
"createTime": null,
"updateTime": null
},
{
"id": 12,
"title": "",
"imgBriefUrl": "/images/news/68792873ed6c49759b0bde0333650294.jpg",
"imgContentUrl": "/images/news/dbd6cb8445174becac04039dbedf061c.jpg",
"description": null,
"content": "",
"createTime": 1449467971000,
"updateTime": null
},
{
"id": 13,
"title": "",
"imgBriefUrl": "/images/news/f71295dbc81c4f6daac4e9e6f85d4f9e.jpg",
"imgContentUrl": "/images/news/1014dc0fd18c407f8fc619c29e29f30e.jpg",
"description": null,
"content": "",
"createTime": 1449468913000,
"updateTime": null
},
{
"id": 14,
"title": "",
"imgBriefUrl": "/images/news/f57ed44a7e0542d89d80ca45863435a1.jpg",
"imgContentUrl": "/images/news/bdc603264db44e4894aeac6ebf294643.jpg",
"description": null,
"content": "",
"createTime": 1449469756000,
"updateTime": null
},
{
"id": 15,   
"title": "",
"imgBriefUrl": "/images/news/4690485d8df943688496c469fffecb23.jpg",
"imgContentUrl": "/images/news/4fd827a60ceb4b0aa01bc32066842193.jpg",
"description": null,
"content": "",
"createTime": 1449470243000,
"updateTime": null
},
{
"id": 16,
"title": "",
"imgBriefUrl": "/images/news/48b79d5fcfad4b6d94bfa18229db1e92.jpg",
"imgContentUrl": "/images/news/fe5d3915da464456a222374bc95bd793.jpg",
"description": null,
"content": "",
"createTime": 1449471854000,
"updateTime": null  
}
]
},
"status": 1,
"info": "ok"
}

失败时返回结果:

{"data":null,"status":50004,"info":"update news error"}

你可能感兴趣的:(无标题文章)