# 获取文章
- 1.通过文章```id```获取一篇文章
~~~[api]
get:/article/get/id
*string:id=1#文章id
<<<
success
{
"status": true,
"resdata": {
"id": 1,
"title": "天商计科专业简介",
"content": "文章内容....",
"cover": null,
"time": "2018-02-26 15:30:36",
"tagid": "[\"001\"]",
"typeid": 3,
"publishcount": 0,
"collection": false,
"viewcount": 1,
"tags": [
{
"tagid": "001",
"tagname": "计算机科学与技术"
}
]
}
}
<<<
error
{
"status": false,
"title": "文章不存在"
}
~~~
- 2.获取文章类型
~~~[api]
get:/article/get/articletype
<<<
success
{
"status": true,
"resdata": [
{
"typeid": 1,
"typename": "招生文章"
},
{
"typeid": 2,
"typename": "学校文章"
},
{
"typeid": 3,
"typename": "院系简介"
},
{
"typeid": 4,
"typename": "实时文章"
}
]
}
<<<
error
{
"status": false,
"title": "文章类型不存在"
}
~~~
- 3.通过文章类型获取文章
~~~[api]
get:/article/get/type
*string:type=1#文章类型
*int:page=1#当前页码
*int:count=2#数量
<<<
success
{
"status": true,
"resdata": [
{
"id": 5,
"title": "测试文章",
"content": "this is a test article!",
"cover": null,
"time": "2018-12-01 16:06:31",
"tagid": "[\"001\", \"002\", \"003\"]",
"typeid": 1,
"publishcount": 0,
"viewcount": 0,
"tags": [
{
"tagid": "001",
"tagname": "计算机科学与技术"
},
{
"tagid": "002",
"tagname": "软件工程"
},
{
"tagid": "003",
"tagname": "电子商务"
}
]
},
{
"id": 4,
"title": "天津商业大学2018年在安徽艺术类专业招生录取相关情况一览表",
"content": "<p style=\"text-align: center\">\r\n\t<img src=\"http://zs.tjcu.edu.cn/__local/F/39/C3/0DFA0443823A016BFD663BE7894_B28549B9_D81B.jpg\" width=\"100%\" />\r\n</p>",
"cover": "http://zs.tjcu.edu.cn/__local/F/39/C3/0DFA0443823A016BFD663BE7894_B28549B9_D81B.jpg",
"time": "2018-10-11 18:40:41",
"tagid": "[\"003\"]",
"typeid": 1,
"publishcount": 1,
"viewcount": 0,
"tags": [
{
"tagid": "003",
"tagname": "电子商务"
}
]
}
],
"total": 3
}
<<<
error
{
"status": false,
"title": "文章不存在"
}
~~~
- 4.通过标签获取文章
~~~[api]
get:/article/get/tag
*string:tag=001#文章标签
*int:page=1#当前页码
*int:count=2#数量
<<<
success
{
"status": true,
"resdata": [
{
"id": 5,
"title": "测试文章",
"content": "this is a test article!",
"cover": null,
"time": "2018-12-01 16:06:31",
"tagid": "[\"001\", \"002\", \"003\"]",
"typeid": 1,
"publishcount": 0,
"viewcount": 0,
"tags": [
{
"tagid": "001",
"tagname": "计算机科学与技术"
},
{
"tagid": "002",
"tagname": "软件工程"
},
{
"tagid": "003",
"tagname": "电子商务"
}
]
},
{
"id": 3,
"title": "天津商业大学2018年普通本科招生章程",
"content": " ...content.... ",
"cover": null,
"time": "2018-12-02 17:52:55",
"tagid": "[\"001\"]",
"typeid": 1,
"publishcount": 1,
"viewcount": 0,
"tags": [
{
"tagid": "001",
"tagname": "计算机科学与技术"
}
]
}
],
"total": 3
}
<<<
error
{
"status": false,
"title": "文章不存在"
}
~~~
- 5.通过学院```id```获取具体介绍
~~~[api]
get:/article/get/college
*string:id=10#学校院id
<<<
success
{
"status": true,
"resdata": {
"id": 10,
"title": "信息工程学院",
"content": "学院简介HTML内容",
"major": [
"计算机科学与技术",
"软件工程",
"电子商务",
"信息管理与信息系统",
"自动化",
"通信工程"
],
"cover": "",
"publishcount": 0,
"viewcount": 5
}
}
<<<
error
{
"status": false,
"title": "文章不存在"
}
~~~
- 6.获取学院列表
~~~[api]
get:/article/get/collegelist
<<<
success
{
"status": true,
"resdata": [
{
"id": 1,
"title": "机械工程学院",
"content": "学院简介...",
"major": [
"能源与动力工程",
"建筑环境与能源应用工程",
"包装工程",
"机械设计制造及自动化"
],
"cover": "",
"publishcount": 0,
"viewcount": 1
},
{
"id": 2,
"title": "经济学院",
"content": "学院简介...",
"major": [
"经济学",
"国际经济与贸易",
"财政学",
"金融学",
"信用管理"
],
"cover": "",
"publishcount": 0,
"viewcount": 0
},
{
"id": 3,
"title": "管理学院",
"content": "学院简介...",
"major": [
"工商管理",
"市场营销",
"人力资源管理",
"物流管理",
"宝石及材料工艺学",
"旅游管理",
"酒店管理",
"工程管理"
],
"cover": "",
"publishcount": 0,
"viewcount": 0
},
{
"id": 4,
"title": "会计学院",
"content": "学院简介...",
"major": [
"会计学",
"财务管理"
],
"cover": "",
"publishcount": 0,
"viewcount": 0
},
{
"id": 5,
"title": "生物技术与食品科学学院",
"content": "学院简介...",
"major": [
"食品科学与工程",
"生物工程",
"制药工程",
"生物技术",
"食品质量与安全",
"药事管理",
"应用化学"
],
"cover": "",
"publishcount": 0,
"viewcount": 0
},
{
"id": 6,
"title": "法学院",
"content": "学院简介...",
"major": [
"法学",
"应用心理学"
],
"cover": "",
"publishcount": 0,
"viewcount": 0
},
{
"id": 7,
"title": "公共管理学院",
"content": "学院简介...",
"major": [
"行政管理",
"公共事业管理",
"土地资源管理",
"会展经济与管理"
],
"cover": "",
"publishcount": 0,
"viewcount": 0
},
{
"id": 8,
"title": "外国语学院",
"content": "学院简介...",
"major": [
"英语",
"日语"
],
"cover": "",
"publishcount": 0,
"viewcount": 0
},
{
"id": 9,
"title": "理学院",
"content": "<学院简介...",
"major": [
"信息与计算科学",
"数学与应用数学",
"应用物理学",
"统计学",
"应用统计学"
],
"cover": "",
"publishcount": 0,
"viewcount": 0
},
{
"id": 10,
"title": "信息工程学院",
"content": "学院简介...",
"major": [
"计算机科学与技术",
"软件工程",
"电子商务",
"信息管理与信息系统",
"自动化",
"通信工程"
],
"cover": "",
"publishcount": 0,
"viewcount": 17
},
{
"id": 11,
"title": "国际教育合作学院",
"content": "学院简介...",
"major": [
"酒店管理(中美合作)",
"财务管理(中澳合作)",
"旅游管理(高尔夫经营管理方向)"
],
"cover": "",
"publishcount": 0,
"viewcount": 0
},
{
"id": 12,
"title": "艺术学院",
"content": "学院简介...",
"major": [
"视觉传达设计",
"环境设计",
"产品设计",
"动画",
"造型艺术",
"艺术管理",
"工业设计(理工类)"
],
"cover": "",
"publishcount": 0,
"viewcount": 0
}
]
}
<<<
error
{
"status": false,
"title": "没有获取到数据"
}
~~~