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
065902a8
Commit
065902a8
authored
Apr 24, 2015
by
陈家荣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aaa
parent
db3a8266
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
forumThread.js
app/controllers/admin/forumThread.js
+10
-9
No files found.
app/controllers/admin/forumThread.js
View file @
065902a8
...
@@ -290,7 +290,7 @@ router.post('/thread/comment/update/:cid', function(req, res, next) {
...
@@ -290,7 +290,7 @@ router.post('/thread/comment/update/:cid', function(req, res, next) {
forumThreadService
.
getById
(
tid
,
function
(
err
,
result
)
{
forumThreadService
.
getById
(
tid
,
function
(
err
,
result
)
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
err
);
console
.
error
(
err
);
callback
(
err
,
null
);
res
.
json
(
returnCode
.
BUSY
);
}
else
{
}
else
{
result
.
comment_count
-=
1
;
result
.
comment_count
-=
1
;
var
commentList
=
result
.
comments
;
var
commentList
=
result
.
comments
;
...
@@ -298,7 +298,7 @@ router.post('/thread/comment/update/:cid', function(req, res, next) {
...
@@ -298,7 +298,7 @@ router.post('/thread/comment/update/:cid', function(req, res, next) {
forumThreadService
.
updateThreadById
(
tid
,
result
,
function
(
err
,
result
)
{
forumThreadService
.
updateThreadById
(
tid
,
result
,
function
(
err
,
result
)
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
err
);
console
.
error
(
err
);
callback
(
err
,
null
);
res
.
json
(
returnCode
.
BUSY
);
}
else
{
}
else
{
res
.
json
(
returnCode
.
SUCCESS
);
res
.
json
(
returnCode
.
SUCCESS
);
}
}
...
@@ -308,9 +308,9 @@ router.post('/thread/comment/update/:cid', function(req, res, next) {
...
@@ -308,9 +308,9 @@ router.post('/thread/comment/update/:cid', function(req, res, next) {
}
else
{
// 删除子评论
}
else
{
// 删除子评论
// 更新文章评论 - 1
// 更新文章评论 - 1
forumThreadService
.
updateThreadCommentCount
(
tid
,
comment_count
-
1
,
function
(
err
,
result
)
{
forumThreadService
.
updateThreadCommentCount
(
tid
,
function
(
err
,
result
)
{
if
(
err
)
{
if
(
err
)
{
callback
(
err
,
null
);
res
.
json
(
returnCode
.
BUSY
);
}
}
});
});
...
@@ -319,7 +319,7 @@ router.post('/thread/comment/update/:cid', function(req, res, next) {
...
@@ -319,7 +319,7 @@ router.post('/thread/comment/update/:cid', function(req, res, next) {
forumCommentService
.
getCommentById
(
parent_cid
,
function
(
err
,
result
)
{
forumCommentService
.
getCommentById
(
parent_cid
,
function
(
err
,
result
)
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
err
);
console
.
error
(
err
);
callback
(
err
,
null
);
res
.
json
(
returnCode
.
BUSY
);
}
else
{
}
else
{
var
commentList
=
result
.
comments
;
var
commentList
=
result
.
comments
;
result
.
comments
=
forumCommentService
.
remove
(
commentList
,
cid
);
result
.
comments
=
forumCommentService
.
remove
(
commentList
,
cid
);
...
@@ -382,15 +382,15 @@ router.post('/thread/comment/update/:cid/comments', function(req, res, next) {
...
@@ -382,15 +382,15 @@ router.post('/thread/comment/update/:cid/comments', function(req, res, next) {
forumCommentService
.
getCommentById
(
cid
,
function
(
err
,
result
)
{
forumCommentService
.
getCommentById
(
cid
,
function
(
err
,
result
)
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
err
);
console
.
error
(
err
);
callback
(
err
,
null
);
res
.
json
(
returnCode
.
BUSY
);
}
else
{
}
else
{
var
commentList
=
result
.
comments
;
var
commentList
=
result
.
comments
;
result
.
comments
.
push
(
replayComment_id
);
result
.
comments
.
push
(
replayComment_id
);
forumCommentService
.
updateCommentById
(
cid
,
result
,
function
(
err
,
result
)
{
forumCommentService
.
updateCommentById
(
cid
,
result
,
function
(
err
,
result
)
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
err
);
res
.
json
(
returnCode
.
BUSY
);
res
.
json
(
returnCode
.
BUSY
);
}
else
{
}
else
{
res
.
json
(
returnCode
.
SUCCESS
);
res
.
json
(
returnCode
.
SUCCESS
);
...
@@ -447,6 +447,7 @@ router.post('/thread/comment/add', function(req, res, next) {
...
@@ -447,6 +447,7 @@ router.post('/thread/comment/add', function(req, res, next) {
};
};
forumUserService
.
createUser
(
userentity
,
function
(
err
,
doc
)
{
forumUserService
.
createUser
(
userentity
,
function
(
err
,
doc
)
{
if
(
err
)
{
if
(
err
)
{
console
.
log
(
err
);
res
.
json
(
returnCode
.
BUSY
);
res
.
json
(
returnCode
.
BUSY
);
}
else
{
}
else
{
entity
.
from
=
doc
.
_id
;
entity
.
from
=
doc
.
_id
;
...
@@ -502,7 +503,7 @@ router.post('/thread/:tid/updateComments', function(req, res, next) {
...
@@ -502,7 +503,7 @@ router.post('/thread/:tid/updateComments', function(req, res, next) {
forumThreadService
.
getById
(
tid
,
function
(
err
,
result
)
{
forumThreadService
.
getById
(
tid
,
function
(
err
,
result
)
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
err
);
console
.
error
(
err
);
callback
(
err
,
null
);
res
.
json
(
returnCode
.
BUSY
);
}
else
{
}
else
{
result
.
comments
.
push
(
cid
);
result
.
comments
.
push
(
cid
);
result
.
comment_count
+=
1
;
result
.
comment_count
+=
1
;
...
@@ -510,7 +511,7 @@ router.post('/thread/:tid/updateComments', function(req, res, next) {
...
@@ -510,7 +511,7 @@ router.post('/thread/:tid/updateComments', function(req, res, next) {
forumThreadService
.
updateThreadById
(
tid
,
result
,
function
(
err
,
result
)
{
forumThreadService
.
updateThreadById
(
tid
,
result
,
function
(
err
,
result
)
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
err
);
console
.
error
(
err
);
callback
(
err
,
null
);
res
.
json
(
returnCode
.
BUSY
);
}
else
{
}
else
{
res
.
json
(
returnCode
.
SUCCESS
);
res
.
json
(
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