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
c07708d1
Commit
c07708d1
authored
Oct 29, 2015
by
刘文胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
111111
parent
55d36ef2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
0 deletions
+44
-0
forumInfo.js
app/controllers/admin/forumInfo.js
+11
-0
forumNotice.js
app/controllers/admin/forumNotice.js
+21
-0
forumTag.js
app/controllers/admin/forumTag.js
+12
-0
No files found.
app/controllers/admin/forumInfo.js
View file @
c07708d1
...
@@ -224,6 +224,17 @@ router.get('/infos/list', function(req, res, next) {
...
@@ -224,6 +224,17 @@ router.get('/infos/list', function(req, res, next) {
});
});
});
});
//直接修改序号
router
.
put
(
'/infos/orderIDX/:id/:order'
,
function
(
req
,
res
,
next
)
{
var
id
=
req
.
params
.
id
;
var
idx
=
req
.
params
.
order
;
forumInfoService
.
updateInfoIdx
(
id
,
idx
,
function
(
err
,
result
){
if
(
err
||
!
result
){
return
res
.
json
(
returnCode
.
BUSY
);
}
return
res
.
json
(
_
.
assign
({
data
:
true
},
returnCode
.
SUCCESS
));
});
});
//板块上移
//板块上移
router
.
put
(
'/infos/moveUP/:id/:order'
,
function
(
req
,
res
,
next
)
{
router
.
put
(
'/infos/moveUP/:id/:order'
,
function
(
req
,
res
,
next
)
{
var
id
=
req
.
params
.
id
;
var
id
=
req
.
params
.
id
;
...
...
app/controllers/admin/forumNotice.js
View file @
c07708d1
...
@@ -73,6 +73,14 @@ function queryList(condition,sort,pageNo,pageSize,callback){
...
@@ -73,6 +73,14 @@ function queryList(condition,sort,pageNo,pageSize,callback){
if
(
err
){
if
(
err
){
return
callback
&&
callback
({
err
:
err
});
return
callback
&&
callback
({
err
:
err
});
}
}
_
.
forEach
(
results
,
function
(
o
,
i
){
if
(
o
.
populated
(
'plate'
)
&&
!
o
.
plate
){
//对应的板块不存在
results
[
i
]
=
o
.
toObject
();
results
[
i
].
plate
=
{
deleted
:
true
};
}
});
return
callback
&&
callback
(
false
,{
data
:
results
,
total
:
count
});
return
callback
&&
callback
(
false
,{
data
:
results
,
total
:
count
});
});
});
})
})
...
@@ -197,6 +205,19 @@ router.post('/notice/search', function(req, res, next) {
...
@@ -197,6 +205,19 @@ router.post('/notice/search', function(req, res, next) {
});
});
});
});
//直接修改序号
router
.
put
(
'/notice/orderIDX/:id/:order'
,
function
(
req
,
res
,
next
)
{
var
id
=
req
.
params
.
id
;
var
idx
=
req
.
params
.
order
;
updateNoticIdx
(
id
,
idx
,
function
(
err
,
result
){
if
(
err
||
!
result
){
console
.
log
(
err
);
return
res
.
json
(
returnCode
.
BUSY
);
}
return
res
.
json
(
_
.
assign
({
data
:
true
},
returnCode
.
SUCCESS
));
});
});
//上移
//上移
router
.
put
(
'/notice/moveUP/:id/:order'
,
function
(
req
,
res
,
next
)
{
router
.
put
(
'/notice/moveUP/:id/:order'
,
function
(
req
,
res
,
next
)
{
var
id
=
req
.
params
.
id
;
var
id
=
req
.
params
.
id
;
...
...
app/controllers/admin/forumTag.js
View file @
c07708d1
...
@@ -95,6 +95,18 @@ router.get('/tag/:tid/get', function(req, res, next) {
...
@@ -95,6 +95,18 @@ router.get('/tag/:tid/get', function(req, res, next) {
}
}
});
});
//直接修改序号
router
.
put
(
'/tag/orderIDX/:id/:order'
,
function
(
req
,
res
,
next
)
{
var
id
=
req
.
params
.
id
;
var
idx
=
req
.
params
.
order
;
forumTagService
.
updateTagIdx
(
id
,
idx
,
function
(
err
,
result
){
if
(
err
||
!
result
){
return
res
.
json
(
returnCode
.
BUSY
);
}
return
res
.
json
(
_
.
assign
({
data
:
true
},
returnCode
.
SUCCESS
));
});
});
//上移
//上移
router
.
put
(
'/tag/moveUP/:id/:order'
,
function
(
req
,
res
,
next
)
{
router
.
put
(
'/tag/moveUP/:id/:order'
,
function
(
req
,
res
,
next
)
{
var
id
=
req
.
params
.
id
;
var
id
=
req
.
params
.
id
;
...
...
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