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
aaa1567c
Commit
aaa1567c
authored
Mar 11, 2016
by
strong
Browse files
Options
Browse Files
Download
Plain Diff
Merge commit '
e405f5d5
' into SANDBOX
parents
3c7cc69e
e405f5d5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
3 deletions
+29
-3
forumThread.js
app/controllers/admin/forumThread.js
+18
-2
forumCommentService.js
app/service/forumCommentService.js
+7
-0
forumMessageService.js
app/service/forumMessageService.js
+4
-1
No files found.
app/controllers/admin/forumThread.js
View file @
aaa1567c
...
...
@@ -923,8 +923,17 @@ router.post('/thread/comment/update/:cid', function(req, res, next) {
router
.
post
(
'/thread/comment/update/:cid/comments'
,
function
(
req
,
res
,
next
)
{
var
tid
=
req
.
body
.
tid
||
null
;
var
cid
=
req
.
params
.
cid
||
null
;
var
floor
=
req
.
body
.
floor
||
null
;
var
replayComment_id
=
req
.
body
.
replayComment_id
;
forumCommentService
.
updateCommentById
(
cid
,
{
var
ent_code
=
req
.
session
.
user
.
ent_code
;
var
conditions
=
{
"thread"
:
tid
,
"level"
:
"1"
,
"floor"
:
floor
,
"ent_code"
:
ent_code
};
forumCommentService
.
updateComment
(
conditions
,
{
$push
:
{
comments
:
replayComment_id
},
...
...
@@ -1013,7 +1022,7 @@ router.post('/thread/comment/add', function(req, res, next) {
forumCommentService
.
createComment
(
entity
,
function
(
err
,
comment
)
{
if
(
err
)
{
callback
(
err
);
}
else
{
}
else
if
(
entity
.
level
==
1
)
{
forumThreadService
.
getById
(
tid
,
function
(
err
,
thread
)
{
if
(
entity
.
level
==
1
)
{
forumAboutMEService
.
saveCommentLevel1
(
thread
,
comment
);
...
...
@@ -1038,6 +1047,13 @@ router.post('/thread/comment/add', function(req, res, next) {
callback
(
null
,
returnData
);
});
});
}
else
{
var
returnData
=
{
comment
:
comment
,
errorcode
:
0
,
errormsg
:
'请求成功'
}
callback
(
null
,
returnData
);
}
});
}
...
...
app/service/forumCommentService.js
View file @
aaa1567c
...
...
@@ -88,6 +88,13 @@ exports.updateCommentById = function(cid, entity, callback) {
});
};
//根据条件更新评论 entity
exports
.
updateComment
=
function
(
conditions
,
entity
,
callback
)
{
ForumComment
.
findOneAndUpdate
(
conditions
,
entity
,
function
(
err
,
doc
)
{
callback
(
err
,
doc
);
});
};
//根据ID删除评论
exports
.
deleteCommentById
=
function
(
cid
,
callback
)
{
...
...
app/service/forumMessageService.js
View file @
aaa1567c
...
...
@@ -183,7 +183,7 @@ exports.getMessages= function(conditions, status, pageNo, pageSize, callback) {
if
(
err
)
{
console
.
error
(
err
);
callback
(
err
,
null
,
null
);
}
else
{
}
else
if
(
docs
)
{
var
messages
=
[];
if
(
docs
.
messages
){
for
(
var
i
=
docs
.
messages
.
length
-
1
;
i
>=
0
;
i
--
)
{
...
...
@@ -200,6 +200,9 @@ exports.getMessages= function(conditions, status, pageNo, pageSize, callback) {
//获取分页后的数组
messages
=
messages
.
slice
(
skip
,
limit
);
callback
(
null
,
total
,
messages
);
}
else
{
var
messages
=
[];
callback
(
null
,
0
,
messages
);
}
});
};
...
...
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