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
d90ee2ab
Commit
d90ee2ab
authored
Dec 14, 2015
by
杨翌文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口减肥
parent
68fa8baa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
7 deletions
+25
-7
forumThreadService.js
app/service/forumThreadService.js
+25
-7
No files found.
app/service/forumThreadService.js
View file @
d90ee2ab
...
...
@@ -10,6 +10,24 @@ var forumCommentService = require('./forumCommentService');
var
async
=
require
(
'async'
);
var
then
=
require
(
'thenjs'
);
var
threadFields
=
{
'content'
:
1
,
'type'
:
1
,
'title'
:
1
,
'pid'
:
1
,
'from'
:
1
,
'created'
:
1
,
'recommend'
:
1
,
'praise_count'
:
1
,
'comment_count'
:
1
,
'images'
:
1
,
'comments'
:
1
,
'level'
:
1
,
'top'
:
1
,
'address'
:
1
};
//根据发帖者分页查询话题列表
exports
.
findThreadByPage
=
function
(
pageNo
,
pageSize
,
q
,
callback
)
{
then
(
function
(
cont
)
{
...
...
@@ -611,7 +629,7 @@ function getSubThreads(doc, sort, callback) {
if
(
sort
)
{
sortBy
=
sort
;
}
ForumThread
.
find
(
conditions
).
populate
(
'from'
).
sort
(
sortBy
).
exec
(
function
(
err
,
docs
)
{
ForumThread
.
find
(
conditions
).
populate
(
'from'
,
'uid mid nickName icon'
).
sort
(
sortBy
).
exec
(
function
(
err
,
docs
)
{
if
(
err
)
{
console
.
error
(
err
);
callback
(
err
,
null
);
...
...
@@ -642,8 +660,8 @@ function getAllThreadByFidHelp(conditions, pageNo, pageSize, sort, callback) {
if
(
sort
)
{
sortBy
=
sort
;
}
ForumThread
.
find
(
conditions
).
populate
(
'from'
).
populate
(
'info
'
).
populate
({
path
:
'tag'
ForumThread
.
find
(
conditions
,
threadFields
).
populate
(
'from'
,
'uid mid nickName icon'
).
populate
(
'info'
,
'name icon pv_count
'
).
populate
({
path
:
'tag'
,
select
:
'title pv_count'
}).
populate
({
path
:
'comments'
,
options
:
{
...
...
@@ -710,8 +728,8 @@ function getAllThreadByFidHelpNoLimit(conditions, pageNo, pageSize, sort, callba
if
(
sort
)
{
sortBy
=
sort
;
}
ForumThread
.
find
(
conditions
).
populate
(
'from'
).
populate
(
'info
'
).
populate
({
path
:
'tag'
ForumThread
.
find
(
conditions
,
threadFields
).
populate
(
'from'
,
'uid mid nickName icon'
).
populate
(
'info'
,
'name icon pv_count
'
).
populate
({
path
:
'tag'
,
select
:
'title pv_count'
}).
populate
({
path
:
'comments'
,
options
:
{
...
...
@@ -1027,8 +1045,8 @@ function getAllThreadByFidAndUserHelp(user_ids, conditions, pageNo, pageSize, so
if
(
sort
)
{
sortBy
=
sort
;
}
ForumThread
.
find
(
conditions
)
.
populate
(
'from'
).
populate
(
'info
'
).
populate
({
path
:
'tag'
ForumThread
.
find
(
conditions
)
populate
(
'from'
,
'uid mid nickName icon'
).
populate
(
'info'
,
'name icon pv_count
'
).
populate
({
path
:
'tag'
,
select
:
'title pv_count'
}).
populate
({
path
:
'comments'
,
options
:
{
...
...
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