...
|
...
|
@@ -16,8 +16,9 @@ const article = { |
|
|
* 文章列表
|
|
|
* @param req
|
|
|
* @param res
|
|
|
* @param next
|
|
|
*/
|
|
|
list(req, res) {
|
|
|
list(req, res, next) {
|
|
|
const query = req.query;
|
|
|
const actId = query.actId;
|
|
|
const pageNo = query.pageNo || 1;
|
...
|
...
|
@@ -80,7 +81,8 @@ const article = { |
|
|
message: GET_SUCCESS
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
})
|
|
|
.catch(next);
|
|
|
|
|
|
},
|
|
|
|
...
|
...
|
@@ -88,8 +90,9 @@ const article = { |
|
|
* 发布文章
|
|
|
* @param req
|
|
|
* @param res
|
|
|
* @param next
|
|
|
*/
|
|
|
publish(req, res) {
|
|
|
publish(req, res, next) {
|
|
|
let newId;
|
|
|
let errorMsg = '';
|
|
|
const actId = req.body.actId;
|
...
|
...
|
@@ -130,15 +133,17 @@ const article = { |
|
|
},
|
|
|
message: POST_SUCCESS
|
|
|
});
|
|
|
});
|
|
|
})
|
|
|
.catch(next);
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 查询单个article详情
|
|
|
* @param req
|
|
|
* @param res
|
|
|
* @param next
|
|
|
*/
|
|
|
querySingle(req, res) {
|
|
|
querySingle(req, res, next) {
|
|
|
let errorMsg = '';
|
|
|
const actId = req.query.actId;
|
|
|
const articleId = req.query.articleId;
|
...
|
...
|
@@ -178,15 +183,17 @@ const article = { |
|
|
data: final_result,
|
|
|
message: GET_SUCCESS
|
|
|
});
|
|
|
});
|
|
|
})
|
|
|
.catch(next);
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 文章点赞
|
|
|
* @param req
|
|
|
* @param res
|
|
|
* @param next
|
|
|
*/
|
|
|
like(req, res) {
|
|
|
like(req, res, next) {
|
|
|
const actId = req.body.actId;
|
|
|
const articleId = req.body.articleId;
|
|
|
|
...
|
...
|
@@ -207,7 +214,8 @@ const article = { |
|
|
code: 200,
|
|
|
message: POST_SUCCESS
|
|
|
});
|
|
|
});
|
|
|
})
|
|
|
.catch(next);
|
|
|
}
|
|
|
};
|
|
|
|
...
|
...
|
|