...
|
...
|
@@ -60,7 +60,7 @@ const editor = (req, res, next) => { |
|
|
} else {
|
|
|
return next();
|
|
|
}
|
|
|
|
|
|
|
|
|
}).catch(next);
|
|
|
|
|
|
};
|
...
|
...
|
@@ -178,7 +178,7 @@ const tag = (req, res, next) => { |
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
responseData.pageHeader.navTitle = param.tag || '标签';
|
|
|
|
|
|
|
...
|
...
|
@@ -192,49 +192,49 @@ const tag = (req, res, next) => { |
|
|
* @param req
|
|
|
* @param res
|
|
|
*/
|
|
|
const listDynamicData = (req, res) => {
|
|
|
let ids = req.query.ids;
|
|
|
|
|
|
let udid = req.sessionID;
|
|
|
|
|
|
let other = {};
|
|
|
let query = req.query.query,
|
|
|
type = req.query.type;
|
|
|
|
|
|
if (req.user.uid) {
|
|
|
other.uid = req.user.uid;
|
|
|
}
|
|
|
|
|
|
if (query) {
|
|
|
other.query = query;
|
|
|
}
|
|
|
|
|
|
if (type) {
|
|
|
other.type = type;
|
|
|
}
|
|
|
|
|
|
indexModel.getDynamicDataByIds(ids, udid, other).then(ret => {
|
|
|
res.send(ret);
|
|
|
});
|
|
|
};
|
|
|
|
|
|
const listDynamicData = (req, res) => {
|
|
|
let ids = req.query.ids;
|
|
|
|
|
|
let udid = req.sessionID;
|
|
|
|
|
|
let other = {};
|
|
|
let query = req.query.query,
|
|
|
type = req.query.type;
|
|
|
|
|
|
if (req.user.uid) {
|
|
|
other.uid = req.user.uid;
|
|
|
}
|
|
|
|
|
|
if (query) {
|
|
|
other.query = query;
|
|
|
}
|
|
|
|
|
|
if (type) {
|
|
|
other.type = type;
|
|
|
}
|
|
|
|
|
|
indexModel.getDynamicDataByIds(ids, udid, other).then(ret => {
|
|
|
res.send(ret);
|
|
|
});
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 详情页动态数据,如:评论数,回复数,是否点赞,是否收藏
|
|
|
* @param req
|
|
|
* @param res
|
|
|
*/
|
|
|
const detailDynamicData = (req, res) => {
|
|
|
|
|
|
let id = req.query.id,
|
|
|
uid = req.user.uid,
|
|
|
udid = req.sessionID;
|
|
|
|
|
|
indexModel.getDynamicDataById(id, uid, udid).then((ret) => {
|
|
|
res.status(200).send(ret);
|
|
|
}).catch(() => {
|
|
|
res.status(400);
|
|
|
});
|
|
|
};
|
|
|
const detailDynamicData = (req, res) => {
|
|
|
|
|
|
let id = req.query.id,
|
|
|
uid = req.user.uid,
|
|
|
udid = req.sessionID;
|
|
|
|
|
|
indexModel.getDynamicDataById(id, uid, udid).then((ret) => {
|
|
|
res.status(200).send(ret);
|
|
|
}).catch(() => {
|
|
|
res.status(400);
|
|
|
});
|
|
|
};
|
|
|
|
|
|
module.exports = {
|
|
|
editor,
|
...
|
...
|
|