Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pisns-forum-api
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
scrmGroup
pisns-forum-api
Commits
1ab8ca15
Commit
1ab8ca15
authored
Jul 28, 2016
by
陈志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
去除打印
parent
caade030
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
99 deletions
+0
-99
forumThread.js
app/controllers/mobile/forumThread.js
+0
-99
No files found.
app/controllers/mobile/forumThread.js
View file @
1ab8ca15
...
...
@@ -2274,97 +2274,6 @@ router.get('/thread/getThreadWithNotPopulateComment/hot', function(req, res, nex
});
});
//获取话题下子文章
// router.get('/thread/:tid/get/subThreads/:type', function(req, res, next) {
// var tid = req.params.tid || null;
// var type = req.params.type || null;
// var pageNo = req.query.pageNo || 1;
// var pageSize = req.query.pageSize || 10;
// var ent_code = req.session.user.ent_code;
// var rs = {};
// var conditions = {
// ent_code: ent_code,
// pid: tid,
// // type: 2,
// status: 1
// };
// var sort = null; //排序条件
// if(type == 1){ //最新
// sort = '-created';
// }else if(type == 2){ //最热
// sort = '-praise_count -comment_count -created';
// }
// if (tid) {
// async.waterfall([
// function(callback) {
// forumThreadService.getByConditionsSelectyField({_id:tid}, 'type', function(err, thread) {
// if (err) {
// console.error(err);
// callback(err, null);
// } else {
// callback(null, thread);
// }
// });
// },
// function(thread, callback) {
// forumUserThreadControlService.getUserThreadControlById(user.getMobileUser(req), function(err, doc) {
// if (err) {
// console.error(err);
// callback(err, null, null);
// } else {
// if (doc) {
// callback(null, thread, doc);
// } else {
// callback(null, thread, null);
// }
// }
// });
// },
// function(thread, doc, callback) {
// if (thread.type == 2) { //查询子列表
// if (doc) {
// conditions._id = {
// $nin: doc.thread
// };
// }
// //获取子话题数据
// forumThreadService.getThreadWithNotPopulateComment(conditions, pageNo, pageSize, sort, function(err, results) {
// if (err) {
// console.error(err);
// callback(err, null);
// } else {
// callback(null, results);
// }
// });
// } else {
// callback(null, null);
// }
// }
// ], function(err, results) {
// if (err) {
// console.error(err);
// res.json(returnCode.BUSY);
// } else {
// if(results){
// util.loadLevel(ent_code, results.items, function() {
// handleThreadList(req, results, ent_code, function(result){
// res.json(_.assign(result, returnCode.SUCCESS));
// });
// });
// }else{
// res.json(returnCode.SUCCESS);
// }
// }
// });
// } else {
// res.json(returnCode.WRONG_PARAM);
// }
// });
//(缓存)获取话题下子文章
router
.
get
(
'/thread/:tid/get/subThreads/:type'
,
function
(
req
,
res
,
next
)
{
var
tid
=
req
.
params
.
tid
||
null
;
...
...
@@ -2395,9 +2304,7 @@ router.get('/thread/:tid/get/subThreads/:type', function(req, res, next) {
}
else
{
async
.
waterfall
([
function
(
callback
)
{
var
getByConditionsSelectyFieldBegin
=
new
Date
();
forumThreadService
.
getByConditionsSelectyField
({
_id
:
tid
},
'type'
,
function
(
err
,
thread
)
{
console
.
log
(
"获取父帖子耗时:"
+
Math
.
abs
(
new
Date
()
-
getByConditionsSelectyFieldBegin
));
if
(
err
)
{
console
.
error
(
err
);
callback
(
err
,
null
);
...
...
@@ -2416,10 +2323,8 @@ router.get('/thread/:tid/get/subThreads/:type', function(req, res, next) {
$nin
:
doc
.
thread
};
}
var
getThreadWithNotPopulateCommentBegin
=
new
Date
();
//获取子话题数据
forumThreadService
.
getThreadWithNotPopulateComment
(
conditions
,
pageNo
,
pageSize
,
sort
,
function
(
err
,
results
)
{
console
.
log
(
"查询子帖子列表耗时:"
+
Math
.
abs
(
new
Date
()
-
getThreadWithNotPopulateCommentBegin
));
if
(
err
)
{
console
.
error
(
err
);
callback
(
err
,
null
);
...
...
@@ -2437,12 +2342,8 @@ router.get('/thread/:tid/get/subThreads/:type', function(req, res, next) {
res
.
json
(
returnCode
.
BUSY
);
}
else
{
if
(
results
){
var
loadLevelBegin
=
new
Date
();
util
.
loadLevel
(
ent_code
,
results
.
items
,
function
()
{
console
.
log
(
"查询用户经验耗时:"
+
Math
.
abs
(
new
Date
()
-
loadLevelBegin
));
var
handleThreadListBegin
=
new
Date
();
handleThreadList
(
req
,
results
,
ent_code
,
function
(
result
){
console
.
log
(
"查询用户对帖子点赞耗时:"
+
Math
.
abs
(
new
Date
()
-
handleThreadListBegin
));
redis
.
set
(
key
,
JSON
.
stringify
(
result
));
redis
.
expire
(
key
,
2
);
res
.
json
(
_
.
assign
(
result
,
returnCode
.
SUCCESS
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment