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
a7287daf
Commit
a7287daf
authored
Mar 27, 2015
by
张淼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
47910bdf
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
85 additions
and
6 deletions
+85
-6
forumInfo.js
app/controllers/admin/forumInfo.js
+1
-1
forumThread.js
app/controllers/admin/forumThread.js
+2
-2
forumInfo.js
app/controllers/mobile/forumInfo.js
+2
-1
forumThread.js
app/controllers/mobile/forumThread.js
+80
-2
No files found.
app/controllers/admin/forumInfo.js
View file @
a7287daf
...
...
@@ -97,7 +97,7 @@ router.get('/info/:fid/threads', function(req, res, next) {
ent_code
:
req
.
session
.
user
.
ent_code
,
info
:
fid
};
forumThreadService
.
getAllThreadByFid
(
conditions
,
pageNo
,
pageSize
,
function
(
err
,
results
){
forumThreadService
.
getAllThreadByFid
(
conditions
,
pageNo
,
pageSize
,
null
,
function
(
err
,
results
){
if
(
err
){
console
.
error
(
err
);
res
.
json
(
returnCode
.
BUSY
);
...
...
app/controllers/admin/forumThread.js
View file @
a7287daf
...
...
@@ -30,7 +30,8 @@ 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=req.session.user.id;
var
uid
=
'12345'
;
if
(
userUtil
.
getUserSession
(
req
)){
req
.
body
.
from
=
userUtil
.
getUserSession
.
_id
;
...
...
@@ -105,7 +106,6 @@ router.get('/thread/:tid/get', function(req, res, next) {
function
(
callback
){
forumThreadService
.
getThreadById
(
tid
,
function
(
err
,
thread
){
if
(
err
){
res
.
json
(
returnCode
.
BUSY
);
callback
(
err
,
null
);
}
else
{
callback
(
null
,
thread
);
...
...
app/controllers/mobile/forumInfo.js
View file @
a7287daf
...
...
@@ -129,6 +129,7 @@ router.get('/info/:fid/threads', function(req, res, next) {
var
fid
=
req
.
params
.
fid
;
var
conditions
=
{
ent_code
:
req
.
session
.
user
.
ent_code
,
level
:
1
};
if
(
fid
){
conditions
.
info
=
fid
;
...
...
@@ -156,7 +157,7 @@ router.get('/info/:fid/threads', function(req, res, next) {
if
(
result
){
conditions
.
_id
=
{
$nin
:
result
.
thread
};
}
forumThreadService
.
getAllThreadByFid
(
conditions
,
pageNo
,
pageSize
,
function
(
err
,
results
){
forumThreadService
.
getAllThreadByFid
(
conditions
,
pageNo
,
pageSize
,
null
,
function
(
err
,
results
){
if
(
err
){
console
.
error
(
err
);
res
.
json
(
returnCode
.
BUSY
);
...
...
app/controllers/mobile/forumThread.js
View file @
a7287daf
...
...
@@ -56,7 +56,6 @@ function create(req,callback){
router
.
post
(
'/thread/create'
,
function
(
req
,
res
,
next
)
{
var
integral
=
req
.
session
.
openUser
.
integral
||
0
;
var
exp
=
req
.
session
.
openUser
.
exp
||
0
;
forumRolePermissionService
.
checkRolePermiss
(
req
.
session
.
user
.
ent_code
,
'create'
,
integral
,
exp
,
function
(
err
,
result
){
if
(
err
){
res
.
json
(
returnCode
.
BUSY
);
...
...
@@ -740,4 +739,83 @@ router.post('/thread/:tid/userShield', function(req, res, next) {
}
else
{
res
.
json
(
returnCode
.
WRONG_PARAM
);
}
});
\ No newline at end of file
});
//获取论坛话题列表
router
.
get
(
'/thread/:tid/topics'
,
function
(
req
,
res
,
next
)
{
var
tid
=
req
.
params
.
tid
||
null
;
var
pageNo
=
req
.
query
.
pageNo
||
1
;
var
pageSize
=
req
.
query
.
pageSize
||
10
;
var
conditions
=
{
pid
:
tid
,
type
:
3
};
if
(
tid
){
//获取最新5条评论
forumThreadService
.
getAllThreadByFid
(
conditions
,
pageNo
,
pageSize
,
null
,
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
.
get
(
'/thread/:tid/latestPhotos'
,
function
(
req
,
res
,
next
)
{
var
tid
=
req
.
params
.
tid
||
null
;
var
pageNo
=
req
.
query
.
pageNo
||
1
;
var
pageSize
=
req
.
query
.
pageSize
||
10
;
var
conditions
=
{
pid
:
tid
,
type
:
3
};
if
(
tid
){
//获取最新5条评论
forumThreadService
.
getAllThreadByFid
(
conditions
,
pageNo
,
pageSize
,
'-created'
,
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
.
get
(
'/thread/:tid/hotPhotos'
,
function
(
req
,
res
,
next
)
{
var
tid
=
req
.
params
.
tid
||
null
;
var
pageNo
=
req
.
query
.
pageNo
||
1
;
var
pageSize
=
req
.
query
.
pageSize
||
10
;
var
conditions
=
{
pid
:
tid
,
type
:
3
};
if
(
tid
){
//获取最新5条评论
forumThreadService
.
getAllThreadByFid
(
conditions
,
pageNo
,
pageSize
,
'-praise_count'
,
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
);
}
});
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