Authored by 邱骏

增加接口说明

... ... @@ -93,12 +93,14 @@ class ArticleModel extends global.yoho.BaseModel {
* @returns {*}
*/
getSingleArticle(articleId, actId) {
return mysqlCli.query(`select act_article.id,content,good_count,
act_article_img.img_url from ${TABLE_ACT_ARTICLE}
join ${TABLE_ACT_ARTICLE_IMG}
where act_article_img.article_id = act_article.id
and act_article.act_id = :actId
and act_article.id = :articleId;`,
return mysqlCli.query(`SELECT AA.id AS id,AA.content AS content,AA.good_count AS good_count,
DATE_FORMAT(AA.create_time, '%Y-%m-%d %H:%i:%S') AS create_time,
AAI.img_url
FROM ${TABLE_ACT_ARTICLE} AS AA
INNER JOIN ${TABLE_ACT_ARTICLE_IMG} AS AAI
WHERE AAI.article_id = AA.id
AND AA.act_id = :actId
AND AA.id = :articleId;`,
{
actId,
articleId
... ...
... ... @@ -10,8 +10,8 @@
**请求参数**
| 名称 | 类型 | 描述 | 备注
| ---- | ----- |---- | ---
| 名称 | 类型 | 描述 | 备注 | aaa
| ---- | ----- |---- | --- | ---
| mobile|string|手机号|
| area | string|区域码| 默认:86
... ... @@ -195,4 +195,43 @@
### 六、图片详情
**请求路径**
> {host}/article/querySingle
**请求方法**
> GET
**请求参数**
|名称 | 类型 |必填| 描述
|------|-------|-----|----
|actId|string |是|活动Id
|articleId|string |是|文章Id
**应答参数**
| 名称 | 描述
| -------| -------
| id | 文章ID
| content | 文章内容
| good_count | 点赞数
| img_url | 图片地址
| create_time | 创建时间
### Request (URL)
?actId=1&articleId=1
### Result
{
"code": 200,
"data": [
{
"id": 1,
"content": "减肥的萨克雷;放假啊到路口;非金属矿了;法电视剧付款啦第三节课了scriptalert('aaa')/script",
"good_count": 0,
"create_time": "2017-07-03 13:57:13",
"img_url": "http://img01.yohoboys.com/o_1bk3gc79c11p21c4l1e4ksk0vdl7.jpg?imageMogr2/auto-orient/thumbnail/626/strip/gravity/Center/quality/60/crop/626x530/format/jpg"
}
],
"message": "获取文章详情成功"
}
... ...