Commit e642fd1a authored by 陈家荣's avatar 陈家荣

增加逻辑删除接口

parent 1b847856
...@@ -1033,3 +1033,32 @@ router.get('/thread/:tid/hotPhotos', function(req, res, next) { ...@@ -1033,3 +1033,32 @@ router.get('/thread/:tid/hotPhotos', function(req, res, next) {
}); });
//逻辑删除文章
router.post('/thread/:tid/logicDeleteThread', function(req, res, next) {
var user_id = user.getMobileUser(req);
var tid = req.params.tid;
if (tid) {
forumThreadService.getThreadById(tid,function(err,thread){
if(thread.from && user_id){
if(thread.from.toString() == user_id.toString()){
forumThreadService.logicDeleteThreadById(tid, function(err, flag) {
if (err) {
res.json(returnCode.BUSY);
} else {
res.json(returnCode.SUCCESS);
}
});
}else{
res.json(returnCode.ACTION_NOT_PERMISSION);
}
}else{
res.json(returnCode.WRONG_PARAM);
}
})
} else {
res.json(returnCode.WRONG_PARAM);
}
});
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