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
3d6d5a60
Commit
3d6d5a60
authored
Apr 16, 2015
by
陈志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
发帖 与 评论 推送积分
parent
ade03469
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
forumThread.js
app/controllers/mobile/forumThread.js
+6
-5
No files found.
app/controllers/mobile/forumThread.js
View file @
3d6d5a60
...
@@ -76,6 +76,7 @@ router.post('/thread/create', function(req, res, next) {
...
@@ -76,6 +76,7 @@ router.post('/thread/create', function(req, res, next) {
if
(
err
){
if
(
err
){
res
.
json
(
returnCode
.
BUSY
);
res
.
json
(
returnCode
.
BUSY
);
}
else
{
}
else
{
httpService
.
sendRequest
(
req
.
session
.
user
.
ent_code
,
req
.
session
.
openUser
.
mid
,
'post'
);
var
rs
=
{};
var
rs
=
{};
rs
.
data
=
{
'id'
:
thread
.
_id
};
rs
.
data
=
{
'id'
:
thread
.
_id
};
res
.
json
(
_
.
assign
(
rs
,
returnCode
.
SUCCESS
));
res
.
json
(
_
.
assign
(
rs
,
returnCode
.
SUCCESS
));
...
@@ -221,7 +222,7 @@ router.post('/thread/:tid/raise', function(req, res, next) {
...
@@ -221,7 +222,7 @@ router.post('/thread/:tid/raise', function(req, res, next) {
console
.
error
(
err
);
console
.
error
(
err
);
res
.
json
(
returnCode
.
BUSY
);
res
.
json
(
returnCode
.
BUSY
);
}
else
{
}
else
{
httpService
.
sendRequest
(
req
.
session
.
user
.
ent_code
,
user
.
getOpenId
(
req
),
tid
,
'
raise'
);
httpService
.
sendRequest
(
req
.
session
.
user
.
ent_code
,
req
.
session
.
openUser
.
mid
,
'thread_p
raise'
);
forumThreadService
.
getThreadById
(
tid
,
function
(
err
,
doc
){
forumThreadService
.
getThreadById
(
tid
,
function
(
err
,
doc
){
if
(
err
){
if
(
err
){
console
.
error
(
err
);
console
.
error
(
err
);
...
@@ -305,7 +306,7 @@ router.post('/thread/:tid/share', function(req, res, next) {
...
@@ -305,7 +306,7 @@ router.post('/thread/:tid/share', function(req, res, next) {
console
.
error
(
err
);
console
.
error
(
err
);
res
.
json
(
returnCode
.
BUSY
);
res
.
json
(
returnCode
.
BUSY
);
}
else
{
}
else
{
httpService
.
sendRequest
(
req
.
session
.
user
.
ent_code
,
user
.
getOpenId
(
req
),
t
id
,
'share'
);
// httpService.sendRequest(req.session.user.ent_code,req.session.openUser.m
id,'share');
res
.
json
(
returnCode
.
SUCCESS
);
res
.
json
(
returnCode
.
SUCCESS
);
}
}
});
});
...
@@ -396,7 +397,7 @@ router.post('/thread/:tid/comment/create', function(req, res, next) {
...
@@ -396,7 +397,7 @@ router.post('/thread/:tid/comment/create', function(req, res, next) {
console
.
error
(
err
);
console
.
error
(
err
);
res
.
json
(
returnCode
.
BUSY
);
res
.
json
(
returnCode
.
BUSY
);
}
else
{
}
else
{
httpService
.
sendRequest
(
req
.
session
.
user
.
ent_code
,
user
.
getOpenId
(
req
),
t
id
,
'comment'
);
httpService
.
sendRequest
(
req
.
session
.
user
.
ent_code
,
req
.
session
.
openUser
.
m
id
,
'comment'
);
async
.
parallel
([
async
.
parallel
([
function
(
callback
){
function
(
callback
){
//获取最新5条评论
//获取最新5条评论
...
@@ -522,7 +523,7 @@ router.post('/thread/:tid/comment/:cid/create', function(req, res, next) {
...
@@ -522,7 +523,7 @@ router.post('/thread/:tid/comment/:cid/create', function(req, res, next) {
console
.
error
(
err
);
console
.
error
(
err
);
res
.
json
(
returnCode
.
BUSY
);
res
.
json
(
returnCode
.
BUSY
);
}
else
{
}
else
{
httpService
.
sendRequest
(
req
.
session
.
user
.
ent_code
,
user
.
getOpenId
(
req
),
t
id
,
'reply'
);
httpService
.
sendRequest
(
req
.
session
.
user
.
ent_code
,
req
.
session
.
openUser
.
m
id
,
'reply'
);
ForumComment
.
populate
(
results
[
0
],
{
path
:
'from to'
,
select
:
'uid nickName icon comments'
}
,
function
(
err
,
c
){
ForumComment
.
populate
(
results
[
0
],
{
path
:
'from to'
,
select
:
'uid nickName icon comments'
}
,
function
(
err
,
c
){
if
(
err
){
if
(
err
){
res
.
json
(
returnCode
.
BUSY
);
res
.
json
(
returnCode
.
BUSY
);
...
@@ -682,7 +683,7 @@ router.post('/thread/:tid/comment/:cid/raise', function(req, res, next) {
...
@@ -682,7 +683,7 @@ router.post('/thread/:tid/comment/:cid/raise', function(req, res, next) {
console
.
error
(
err
);
console
.
error
(
err
);
res
.
json
(
returnCode
.
BUSY
);
res
.
json
(
returnCode
.
BUSY
);
}
else
{
}
else
{
httpService
.
sendRequest
(
req
.
session
.
user
.
ent_code
,
user
.
getOpenId
(
req
),
tid
,
'
raise'
);
httpService
.
sendRequest
(
req
.
session
.
user
.
ent_code
,
req
.
session
.
openUser
.
mid
,
'comment_p
raise'
);
//返回点赞总数
//返回点赞总数
forumCommentService
.
getCommentById
(
cid
,
function
(
err
,
doc
){
forumCommentService
.
getCommentById
(
cid
,
function
(
err
,
doc
){
if
(
err
){
if
(
err
){
...
...
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