Commit 1bc91e62 authored by 陈家荣's avatar 陈家荣

添加、更新评论

parent b33fa754
......@@ -121,12 +121,17 @@ router.get('/thread/:tid/get', function(req, res, next) {
//更新文章状态、如:屏蔽
router.post('/thread/:tid/update', function(req, res, next) {
var tid=req.params.tid;
var fatherTitle = req.body.father;
delete req.body.father;
req.body.ent_code=req.session.user.ent_code;
if(tid){
forumThreadService.updateThreadById(tid,req.body,function(err,thread){
if(err){
res.json(returnCode.BUSY);
}else{
res.json(returnCode.SUCCESS);
console.log(thread);
console.log(fatherTitle);
res.json({message:"success",data:thread,title:fatherTitle});
}
});
}else{
......@@ -134,6 +139,7 @@ router.post('/thread/:tid/update', function(req, res, next) {
}
});
//删除文章
router.post('/thread/:tid/delete', function(req, res, next) {
var tid=req.params.tid;
......@@ -196,6 +202,7 @@ router.get('/threads/list', function(req, res, next) {
var pageSize = req.query.pageSize || 10;
var infoId=req.query.infoId;
var tagId=req.query.tagId;
var pid=req.query.pid;
var conditions={
ent_code:req.session.user.ent_code,
level:1
......@@ -206,6 +213,13 @@ router.get('/threads/list', function(req, res, next) {
if(tagId){
conditions.tag={$in:[tagId]};
}
if(pid){
conditions.pid = pid;
conditions.level = 2;
}
console.log(conditions);
forumThreadService.getAllThreadByFid(conditions,pageNo,pageSize,null,function(err,results){
if(err){
console.error(err);
......@@ -216,6 +230,7 @@ router.get('/threads/list', function(req, res, next) {
});
});
//评论列表
router.get('/thread/:tid/comment/list', function(req, res, next) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment