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
b1e512e2
Commit
b1e512e2
authored
Apr 21, 2015
by
刘文胜
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'development' of git.wxpai.cn:scrmgroup/pisns-forum-api into development
parents
707e5c69
f2a61e4b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
280 additions
and
204 deletions
+280
-204
forumLog.js
app/controllers/admin/forumLog.js
+47
-12
forumThread.js
app/controllers/admin/forumThread.js
+87
-2
forumShare.js
app/controllers/mobile/forumShare.js
+0
-177
forumThread.js
app/controllers/mobile/forumThread.js
+73
-8
forumThreadService.js
app/service/forumThreadService.js
+73
-5
No files found.
app/controllers/admin/forumLog.js
View file @
b1e512e2
...
...
@@ -8,25 +8,60 @@ var express = require('express'),
mongoose
=
require
(
'mongoose'
);
//模型
var
ForumPvLog
=
mongoose
.
model
(
'ForumPVLog'
),
ForumUvLog
=
mongoose
.
model
(
'ForumUVLog'
);
ForumUvLog
=
mongoose
.
model
(
'ForumUVLog'
),
ForumThread
=
mongoose
.
model
(
'ForumThread'
);
module
.
exports
=
function
(
app
)
{
app
.
use
(
'/admin/forum'
,
router
);
};
var
dateFormat
=
function
(
date
){
return
moment
(
new
Date
(
date
)).
format
(
'YYYY-MM-DD'
);
};
//社区情况(首页)
router
.
post
(
'/statistic '
,
function
(
req
,
res
,
next
)
{
then
(
function
(
cont
){
}).
then
(
function
(
cont
){
}).
then
(
function
(
cont
){
router
.
get
(
'/statistic'
,
function
(
req
,
res
,
next
)
{
var
yesterday
=
moment
(
new
Date
().
getTime
()
-
24
*
3600
*
1000
).
format
(
'YYYY-MM-DD'
),
before_yesterday
=
moment
(
new
Date
().
getTime
()
-
2
*
24
*
3600
*
1000
).
format
(
'YYYY-MM-DD'
);
var
y_begin
=
yesterday
,
y_end
=
yesterday
+
' 23:59:59'
,
by_begin
=
before_yesterday
,
by_end
=
before_yesterday
+
' 23:59:59'
;
var
q
=
{
ent_code
:
req
.
session
.
user
.
ent_code
};
then
.
parallel
([
function
(
cont
){
//昨天访问用户
q
.
created
=
{
$gte
:
y_begin
,
$lte
:
y_end
};
ForumUvLog
.
count
(
q
,
cont
);
},
function
(
cont
){
//前天访问用户
q
.
created
=
{
$gte
:
by_begin
,
$lte
:
by_end
};
ForumUvLog
.
count
(
q
,
cont
);
},
function
(
cont
){
//昨天发帖数
q
.
created
=
{
$gte
:
y_begin
,
$lte
:
y_end
};
ForumThread
.
count
(
q
,
cont
);
},
function
(
cont
){
//前天发帖数
q
.
created
=
{
$gte
:
by_begin
,
$lte
:
by_end
};
ForumThread
.
count
(
q
,
cont
);
}
]).
then
(
function
(
cont
,
datas
){
var
y_user
=
datas
[
0
],
by_user
=
datas
[
1
],
y_thread
=
datas
[
2
],
by_thread
=
datas
[
3
];
var
user_rate
=
(
by_user
===
0
)?
y_user
:(
y_user
/
by_user
).
toFixed
(
4
)
-
1
,
thread_rate
=
(
by_thread
===
0
)?
y_thread
:(
y_thread
/
by_thread
).
toFixed
(
4
)
-
1
;
cont
(
null
,
y_user
,
user_rate
,
y_thread
,
thread_rate
);
}).
then
(
function
(
cont
,
y_user
,
user_rate
,
y_thread
,
thread_rate
){
res
.
json
({
result
:
true
,
data
:{
user
:
y_user
,
user_rate
:
Math
.
round
(
user_rate
>
1
?
100
:
user_rate
<
0
?
0
:
user_rate
*
100
),
thread
:
y_thread
,
thread_rate
:
Math
.
round
(
thread_rate
>
1
?
100
:
thread_rate
<
0
?
0
:
thread_rate
*
100
)
}})
}).
fail
(
function
(
cont
,
err
){
console
.
error
(
err
);
res
.
json
({
result
:
false
,
err
:
err
});
});
});
app/controllers/admin/forumThread.js
View file @
b1e512e2
...
...
@@ -29,9 +29,10 @@ router.post('/thread/create', function(req, res, next) {
var
rs
=
{};
req
.
body
.
ent_code
=
req
.
session
.
user
.
ent_code
;
var
uid
=
req
.
session
.
user
.
id
;
// var uid='12345';
async
.
waterfall
([
function
(
callback
){
forumUserService
.
getUserByUid
(
uid
,
callback
);
...
...
@@ -120,13 +121,17 @@ router.get('/thread/:tid/get', function(req, res, next) {
//更新文章状态、如:屏蔽
router
.
post
(
'/thread/:tid/update'
,
function
(
req
,
res
,
next
)
{
var
tid
=
req
.
params
.
tid
;
var
fatherTitle
=
req
.
body
.
father
;
delete
req
.
body
.
father
;
req
.
body
.
ent_code
=
req
.
session
.
user
.
ent_code
;
if
(
tid
){
forumThreadService
.
updateThreadById
(
tid
,
req
.
body
,
function
(
err
,
thread
){
if
(
err
){
res
.
json
(
returnCode
.
BUSY
);
}
else
{
res
.
json
(
returnCode
.
SUCCESS
);
console
.
log
(
thread
);
console
.
log
(
fatherTitle
);
res
.
json
({
message
:
"success"
,
data
:
thread
,
title
:
fatherTitle
});
}
});
}
else
{
...
...
@@ -134,6 +139,7 @@ router.post('/thread/:tid/update', function(req, res, next) {
}
});
//删除文章
router
.
post
(
'/thread/:tid/delete'
,
function
(
req
,
res
,
next
)
{
var
tid
=
req
.
params
.
tid
;
...
...
@@ -196,6 +202,7 @@ router.get('/threads/list', function(req, res, next) {
var
pageSize
=
req
.
query
.
pageSize
||
10
;
var
infoId
=
req
.
query
.
infoId
;
var
tagId
=
req
.
query
.
tagId
;
var
pid
=
req
.
query
.
pid
;
var
conditions
=
{
ent_code
:
req
.
session
.
user
.
ent_code
,
level
:
1
...
...
@@ -206,6 +213,13 @@ router.get('/threads/list', function(req, res, next) {
if
(
tagId
){
conditions
.
tag
=
{
$in
:[
tagId
]};
}
if
(
pid
){
conditions
.
pid
=
pid
;
conditions
.
level
=
2
;
}
console
.
log
(
conditions
);
forumThreadService
.
getAllThreadByFid
(
conditions
,
pageNo
,
pageSize
,
null
,
function
(
err
,
results
){
if
(
err
){
console
.
error
(
err
);
...
...
@@ -214,4 +228,75 @@ router.get('/threads/list', function(req, res, next) {
res
.
json
(
_
.
assign
(
results
,
returnCode
.
SUCCESS
));
}
});
});
//评论列表
router
.
get
(
'/thread/:tid/comment/list'
,
function
(
req
,
res
,
next
)
{
var
tid
=
req
.
params
.
tid
||
null
;
var
pageNo
=
req
.
query
.
pageNo
||
1
;
var
pageSize
=
req
.
query
.
pageSize
||
10
;
var
conditions
=
{
ent_code
:
req
.
session
.
user
.
ent_code
,
thread
:
tid
,
level
:
'1'
,
status
:{
$ne
:
2
}
//过滤被删除的数据,status 为 2 表示删除
};
if
(
tid
){
//获取最新5条评论
forumCommentService
.
getAllComment
(
conditions
,
pageNo
,
pageSize
,
function
(
err
,
results
){
if
(
err
){
console
.
log
(
err
);
res
.
json
(
returnCode
.
BUSY
);
}
else
{
res
.
json
(
_
.
assign
(
results
,
returnCode
.
SUCCESS
));
}
});
}
else
{
res
.
json
(
returnCode
.
WRONG_PARAM
);
}
});
// 更新评论
router
.
post
(
'/thread/comment/update/:cid'
,
function
(
req
,
res
,
next
){
var
cid
=
req
.
params
.
cid
||
null
;
var
status
=
req
.
body
.
status
;
if
(
cid
){
forumCommentService
.
updateCommentById
(
cid
,
status
,
function
(
err
,
result
){
if
(
err
){
res
.
json
(
returnCode
.
BUSY
);
}
else
{
res
.
json
(
returnCode
.
SUCCESS
);
}
});
}
else
{
res
.
json
(
returnCode
.
WRONG_PARAM
);
}
});
//添加评论
router
.
post
(
'/thread/comment/add'
,
function
(
req
,
res
,
next
)
{
var
tid
=
req
.
body
.
tid
||
null
;
var
entity
=
req
.
body
;
entity
.
created
=
new
Date
();
entity
.
ent_code
=
req
.
session
.
user
.
ent_code
;
// entity.from = req.session.mobileForumUser.userId; // 正式环境
entity
.
from
=
'55015675868b65a028187c49'
;
// 测试环境
if
(
tid
){
// 添加评论
forumCommentService
.
createComment
(
entity
,
function
(
err
,
result
){
if
(
err
){
res
.
json
(
returnCode
.
BUSY
);
}
else
{
res
.
json
(
returnCode
.
SUCCESS
);
}
});
}
});
\ No newline at end of file
app/controllers/mobile/forumShare.js
View file @
b1e512e2
...
...
@@ -17,7 +17,6 @@ module.exports = function(app) {
app
.
use
(
'/v1/forum'
,
router
);
};
function
write
(
res
,
title
,
desc
,
link
,
imgUrl
,
mid
,
ent_code
)
{
link
=
config
.
service
+
link
+
"&mid="
+
mid
;
res
.
writeHead
(
200
,
{
...
...
@@ -75,179 +74,3 @@ function getWX(res, title, desc, link, imgUrl, mid,ent_code, id,type,forumThread
}
//微信分享接口
router
.
get
(
'/:ent_code/share.js'
,
function
(
req
,
res
,
next
)
{
var
rs
=
{};
var
type
=
req
.
query
.
type
;
var
id
=
req
.
query
.
id
;
var
mid
=
0
;
if
(
req
.
session
.
openUser
&&
req
.
session
.
openUser
.
mid
)
{
mid
=
req
.
session
.
openUser
.
mid
;
}
var
ent_code
=
req
.
params
.
ent_code
;
var
link
=
'/app/forum/'
+
ent_code
+
'/index?pageUrl='
;
if
(
type
)
{
//板块微信接口
if
(
type
===
'Info'
)
{
then
(
function
(
cont
)
{
forumShareConfigService
.
getByKey
(
ent_code
,
'share'
,
function
(
err
,
result
)
{
console
.
log
(
err
);
var
title
=
''
,
desc
=
''
,
imgUrl
=
''
;
if
(
result
)
{
result
=
result
.
meta_value
;
for
(
var
i
=
0
;
i
<
result
.
length
;
i
++
)
{
if
(
result
[
i
].
type
===
'info'
)
{
title
=
result
[
i
].
title
;
desc
=
result
[
i
].
desc
;
imgUrl
=
result
[
i
].
imgUrl
;
}
}
if
(
id
)
{
link
=
link
+
'index&infoId='
+
id
;
}
else
{
link
=
link
+
'index'
;
}
getWX
(
res
,
title
,
desc
,
link
,
imgUrl
,
mid
,
ent_code
,
id
,
type
,
null
);
}
else
{
cont
(
err
);
}
});
}).
fail
(
function
(
cont
,
err
)
{
console
.
error
(
err
);
res
.
json
({
result
:
false
,
code
:
'10002'
});
});
}
else
if
(
!
id
)
{
console
.
error
(
"ID不能为空"
);
res
.
json
({
message
:
'ID不能为空'
,
result
:
false
,
code
:
'10002'
});
}
else
if
(
type
===
'Thread'
)
{
then
(
function
(
cont
)
{
//获得文章
forumThreadService
.
getById
(
id
,
function
(
err
,
result
)
{
if
(
result
)
{
cont
(
null
,
result
);
}
else
{
cont
(
err
);
}
});
}).
then
(
function
(
cont
,
result
)
{
//如果没有share值则用默认值
if
(
!
result
.
share
||
result
.
share_type
==
1
)
{
forumShareConfigService
.
getByKey
(
ent_code
,
'share'
,
function
(
err
,
sc
)
{
var
title
=
''
,
desc
=
''
,
imgUrl
=
''
;
if
(
sc
)
{
if
(
result
.
type
===
1
||
(
result
.
type
===
2
&&
result
.
level
===
2
))
{
link
=
link
+
'thread&infoId='
+
result
.
info
+
'&ent_code='
+
ent_code
+
'&id='
+
result
.
_id
;
}
else
if
(
result
.
type
===
2
&&
result
.
level
===
1
)
{
link
=
link
+
'topicList&infoId='
+
result
.
info
+
'&ent_code='
+
ent_code
+
'&id='
+
result
.
_id
;
}
else
if
(
result
.
type
===
3
)
{
link
=
link
+
'photoList&infoId='
+
result
.
info
+
'&ent_code='
+
ent_code
+
'&id='
+
result
.
_id
;
}
//1、文章 2、话题 3、照片墙
sc
=
sc
.
meta_value
;
for
(
var
i
=
0
;
i
<
sc
.
length
;
i
++
)
{
if
(
result
.
type
===
1
||
(
result
.
type
===
2
&&
result
.
level
===
2
))
{
if
(
sc
[
i
].
type
===
'article'
)
{
title
=
sc
[
i
].
title
;
desc
=
sc
[
i
].
desc
;
imgUrl
=
sc
[
i
].
imgUrl
;
}
}
else
if
(
result
.
type
===
2
&&
result
.
level
===
1
)
{
if
(
sc
[
i
].
type
===
'topic'
)
{
title
=
sc
[
i
].
title
;
desc
=
sc
[
i
].
desc
;
imgUrl
=
sc
[
i
].
imgUrl
;
}
}
else
if
(
result
.
type
===
3
)
{
if
(
sc
[
i
].
type
===
'photo'
)
{
title
=
sc
[
i
].
title
;
desc
=
sc
[
i
].
desc
;
imgUrl
=
sc
[
i
].
imgUrl
;
}
}
}
getWX
(
res
,
title
,
desc
,
link
,
imgUrl
,
mid
,
ent_code
,
result
.
_id
,
type
,
result
);
}
else
{
cont
(
err
);
}
});
}
else
{
//如果有分享设置,则返回分享设置
forumShareService
.
getById
(
result
.
share
,
function
(
err
,
forumShare
)
{
//1、文章 2、话题 3、照片墙
if
(
result
.
type
===
1
||
(
result
.
type
===
2
&&
result
.
level
===
2
))
{
link
=
link
+
'thread&infoId='
+
result
.
info
+
'&ent_code='
+
ent_code
+
'&id='
+
result
.
_id
;
//key = 'article';
}
else
if
(
result
.
type
===
2
&&
result
.
level
===
1
)
{
link
=
link
+
'topicList&infoId='
+
result
.
info
+
'&ent_code='
+
ent_code
+
'&id='
+
result
.
_id
;
//key = 'topic';
}
else
if
(
result
.
type
===
3
)
{
link
=
link
+
'photoList&infoId='
+
result
.
info
+
'&ent_code='
+
ent_code
+
'&id='
+
result
.
_id
;
//key = 'photo';
}
getWX
(
res
,
forumShare
.
title
,
forumShare
.
description
,
link
,
forumShare
.
icon
,
mid
,
ent_code
,
result
.
_id
,
type
,
result
);
});
}
}).
fail
(
function
(
cont
,
err
)
{
console
.
error
(
err
);
res
.
json
({
result
:
false
,
code
:
'10002'
});
});
}
}
else
{
res
.
json
({
result
:
false
,
code
:
'10002'
});
}
});
//微信分享接口
router
.
get
(
'/:ent_code/timeline'
,
function
(
req
,
res
,
next
)
{
var
mid
=
req
.
session
.
openUser
.
mid
,
action
=
'share_timeline'
,
ent_code
=
req
.
session
.
user
.
ent_code
;
httpService
.
sendRequest
(
ent_code
,
mid
,
action
);
res
.
status
(
200
).
end
();
});
app/controllers/mobile/forumThread.js
View file @
b1e512e2
...
...
@@ -63,6 +63,71 @@ function create(req, callback) {
});
}
//根据发帖者分页查询话题列表
router
.
get
(
'/thread/searchThread'
,
function
(
req
,
res
,
next
)
{
//参数
var
pageNo
=
req
.
query
.
pageNo
,
pageSize
=
req
.
query
.
pageSize
,
from
=
req
.
session
.
mobileForumUser
.
userId
,
status
=
1
,
ent_code
=
req
.
session
.
user
.
ent_code
;
if
(
pageNo
&&
pageSize
)
{
var
q
=
{
ent_code
:
ent_code
,
status
:
status
,
from
:
from
};
forumThreadService
.
findThreadByPage
(
pageNo
,
pageSize
,
q
,
function
(
err
,
result
)
{
if
(
err
)
{
console
.
error
(
err
);
}
res
.
json
(
result
);
});
}
else
{
console
.
error
(
'params error'
);
res
.
json
({
result
:
false
,
err
:
'params error'
});
}
});
//文章评论
router
.
get
(
'/thread/searchComment'
,
function
(
req
,
res
,
next
)
{
//参数
var
pageNo
=
req
.
query
.
pageNo
,
pageSize
=
req
.
query
.
pageSize
,
from
=
req
.
session
.
mobileForumUser
.
userId
,
status
=
1
,
ent_code
=
req
.
session
.
user
.
ent_code
;
if
(
pageNo
&&
pageSize
)
{
var
q
=
{
ent_code
:
ent_code
,
status
:
status
,
from
:
req
.
session
.
mobileForumUser
.
from
};
forumThreadService
.
findCommentByPage
(
pageNo
,
pageSize
,
q
,
function
(
err
,
result
)
{
if
(
err
)
{
console
.
error
(
err
);
}
res
.
json
(
result
);
});
}
else
{
console
.
error
(
'params error'
);
res
.
json
({
result
:
false
,
err
:
'params error'
});
}
});
//新增论坛文章
router
.
post
(
'/thread/create'
,
function
(
req
,
res
,
next
)
{
var
integral
=
req
.
session
.
openUser
.
integral
||
0
;
...
...
@@ -112,13 +177,13 @@ router.get('/thread/:tid/get', function(req, res, next) {
var
info_id
=
thread
.
info
.
_id
,
pid
=
thread
.
pid
;
if
(
thread
.
type
==
1
&&
thread
.
level
==
1
)
{
httpService
.
createLog
(
req
,
info_id
,
3
,
1
,
tid
);
}
else
if
(
thread
.
type
==
1
&&
thread
.
level
==
2
)
{
httpService
.
createLog
(
req
,
info_id
,
3
,
4
,
tid
,
pid
);
}
else
if
(
thread
.
type
==
2
&&
thread
.
level
==
1
)
{
httpService
.
createLog
(
req
,
info_id
,
3
,
2
,
tid
);
}
else
if
(
thread
.
type
==
3
&&
thread
.
level
==
1
)
{
httpService
.
createLog
(
req
,
info_id
,
3
,
3
,
tid
);
httpService
.
createLog
(
req
,
info_id
,
3
,
1
,
tid
);
}
else
if
(
thread
.
type
==
1
&&
thread
.
level
==
2
)
{
httpService
.
createLog
(
req
,
info_id
,
3
,
4
,
tid
,
pid
);
}
else
if
(
thread
.
type
==
2
&&
thread
.
level
==
1
)
{
httpService
.
createLog
(
req
,
info_id
,
3
,
2
,
tid
);
}
else
if
(
thread
.
type
==
3
&&
thread
.
level
==
1
)
{
httpService
.
createLog
(
req
,
info_id
,
3
,
3
,
tid
);
}
...
...
@@ -633,7 +698,7 @@ router.get('/thread/:tid/comment/list', function(req, res, next) {
};
if
(
tid
)
{
//获取最新5条评论
//获取最新5条评论
forumCommentService
.
getAllComment
(
conditions
,
pageNo
,
pageSize
,
function
(
err
,
results
)
{
if
(
err
)
{
console
.
log
(
err
);
...
...
app/service/forumThreadService.js
View file @
b1e512e2
...
...
@@ -7,6 +7,69 @@ var ForumShare = mongoose.model('ForumShare');
var
forumCommentService
=
require
(
'./forumCommentService'
);
var
async
=
require
(
'async'
);
var
then
=
require
(
'thenjs'
);
//查询帖子
exports
.
findThreadByPage
=
function
(
pageNo
,
pageSize
,
q
,
callback
)
{
then
(
function
(
cont
)
{
ForumThread
.
find
(
q
).
populate
(
'from'
).
count
(
cont
);
}).
then
(
function
(
cont
,
count
)
{
var
skip
=
(
pageNo
-
1
)
*
pageSize
;
var
limit
=
count
-
skip
>
pageSize
?
pageSize
:
(
count
-
skip
);
ForumThread
.
find
(
q
).
skip
(
skip
).
limit
(
limit
).
sort
(
'-created'
).
exec
(
function
(
err
,
docs
)
{
cont
(
err
,
count
,
docs
);
});
}).
then
(
function
(
cont
,
count
,
threads
)
{
var
rsJson
=
{
result
:
true
,
total
:
count
,
datas
:
threads
};
callback
(
null
,
rsJson
);
}).
fail
(
function
(
cont
,
err
)
{
console
.
error
(
err
);
var
rsJson
=
{
result
:
false
,
err
:
err
};
callback
(
err
,
rsJson
);
});
};
//查询评论
exports
.
findCommentByPage
=
function
(
pageNo
,
pageSize
,
q
,
callback
)
{
then
(
function
(
cont
)
{
ForumComment
.
find
(
q
).
populate
(
'from'
).
count
(
cont
);
}).
then
(
function
(
cont
,
count
)
{
var
skip
=
(
pageNo
-
1
)
*
pageSize
;
var
limit
=
count
-
skip
>
pageSize
?
pageSize
:
(
count
-
skip
);
ForumComment
.
find
(
q
).
skip
(
skip
).
limit
(
limit
).
sort
(
'-created'
).
populate
(
'from'
).
exec
(
function
(
err
,
docs
)
{
cont
(
err
,
count
,
docs
);
});
}).
then
(
function
(
cont
,
count
,
threads
)
{
var
rsJson
=
{
result
:
true
,
total
:
count
,
datas
:
threads
};
callback
(
null
,
rsJson
);
}).
fail
(
function
(
cont
,
err
)
{
console
.
error
(
err
);
var
rsJson
=
{
result
:
false
,
err
:
err
};
callback
(
err
,
rsJson
);
});
};
//创建文章
exports
.
createThread
=
function
(
entity
,
callback
)
{
...
...
@@ -191,8 +254,13 @@ exports.getThreadById = function(tid, callback) {
//根据ID更新文章
exports
.
updateThreadById
=
function
(
tid
,
entity
,
callback
)
{
var
shareEntity
=
entity
.
share
;
entity
.
share
=
entity
.
share
.
_id
;
if
(
entity
.
share
.
_id
)
{
entity
.
share
=
entity
.
share
.
_id
;
}
else
{
entity
.
share
=
''
;
}
if
(
entity
.
share
)
{
ForumThread
.
update
({
_id
:
tid
},
entity
,
null
,
function
(
err
,
result
)
{
...
...
@@ -202,12 +270,12 @@ exports.updateThreadById = function(tid, entity, callback) {
}
else
{
ForumShare
.
update
({
_id
:
shareEntity
.
_id
},
shareEntity
,
null
,
function
(
err
,
result
)
{
},
shareEntity
,
null
,
function
(
err
,
se
)
{
if
(
err
)
{
console
.
error
(
err
);
callback
(
err
,
null
);
}
else
{
callback
(
null
,
null
);
callback
(
null
,
entity
);
}
});
...
...
@@ -228,7 +296,7 @@ exports.updateThreadById = function(tid, entity, callback) {
console
.
error
(
err
);
callback
(
err
,
null
);
}
else
{
callback
(
null
,
null
);
callback
(
null
,
entity
);
}
});
...
...
@@ -242,7 +310,7 @@ exports.updateThreadById = function(tid, entity, callback) {
console
.
error
(
err
);
callback
(
err
,
null
);
}
else
{
callback
(
null
,
null
);
callback
(
null
,
entity
);
}
});
...
...
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