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
fe5664f8
Commit
fe5664f8
authored
Jan 22, 2015
by
张淼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
22958fe5
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
149 additions
and
25 deletions
+149
-25
forumFavorite.js
app/controllers/forumFavorite.js
+45
-0
forumInfo.js
app/controllers/forumInfo.js
+4
-0
forumRolePermission.js
app/controllers/forumRolePermission.js
+3
-14
forumThread.js
app/controllers/forumThread.js
+73
-9
rolePermission.js
app/controllers/service/rolePermission.js
+22
-0
forumThread.js
app/models/forumThread.js
+2
-2
No files found.
app/controllers/forumFavorite.js
0 → 100644
View file @
fe5664f8
'use strict'
;
var
express
=
require
(
'express'
),
router
=
express
.
Router
(),
returnCode
=
require
(
'../utils/returnCode'
),
_
=
require
(
'lodash'
);
module
.
exports
=
function
(
app
)
{
app
.
use
(
'/forum'
,
router
);
};
//文章收藏
router
.
post
(
'/favorite/creaet/:tid'
,
function
(
req
,
res
,
next
)
{
var
tid
=
req
.
body
.
tid
||
null
;
console
.
log
(
tid
);
//1.检查是否有权限
//2.校验是否已收藏
//3.新增用户收藏
/**
返回数据:
{
errorcode:0,
errormsg:''
}
**/
});
//删除收藏
router
.
post
(
'/favorite/delete/:tid'
,
function
(
req
,
res
,
next
)
{
var
tid
=
req
.
body
.
tid
||
null
;
console
.
log
(
tid
);
//1.删除用户收藏
/**
返回数据:
{
errorcode:0,
errormsg:''
}
**/
});
//获取当前用户的收藏列表
router
.
get
(
'/favorite/getAll'
,
function
(
req
,
res
,
next
)
{
console
.
log
(
''
);
});
app/controllers/forumInfo.js
View file @
fe5664f8
...
...
@@ -46,4 +46,8 @@ router.get('/info/get/:fid', function(req, res, next) {
router
.
get
(
'/info/get/:gid'
,
function
(
req
,
res
,
next
)
{
var
gid
=
req
.
params
.
gid
||
null
;
console
.
log
(
gid
);
//1.获取用户对应的角色
//2.获取当前角色可访问的板块列表
});
\ No newline at end of file
app/controllers/forumRolePermission.js
View file @
fe5664f8
...
...
@@ -10,7 +10,6 @@ module.exports = function(app) {
//新增角色权限
router
.
post
(
'/rolePermiss/create'
,
function
(
req
,
res
,
next
)
{
console
.
log
(
''
);
});
//获取角色权限列表
...
...
@@ -18,18 +17,8 @@ router.get('/rolePermiss/getAll', function(req, res, next) {
console
.
log
(
''
);
});
//检查是否有操作权限
router
.
get
(
'/rolePermiss/checkPermiss'
,
function
(
req
,
res
,
next
)
{
var
action
=
req
.
query
.
action
||
''
;
//操作
//1.获取用户经验、积分
//2.获取角色权限列表
//3.根据积分、经验匹配对应的角色
//4.检查用户对应的角色是否有对应的操作权限
console
.
log
(
action
);
//获取当前用户的操作权限
router
.
get
(
'/rolePermiss/getUserPermission'
,
function
(
req
,
res
,
next
)
{
console
.
log
(
''
);
});
app/controllers/forumThread.js
View file @
fe5664f8
...
...
@@ -7,6 +7,57 @@ module.exports = function(app) {
app
.
use
(
'/forum'
,
router
);
};
//---------------------列表操作---------------------------------
/**
获取目标论坛文章列表
输入:文章板块ID
**/
router
.
get
(
'/thread/getAllThread/:infoId'
,
function
(
req
,
res
,
next
)
{
console
.
log
(
''
);
//1.获取论坛文章
/**返回数据格式:
{
"threads":[{文章对象},{文章对象}]
}
**/
});
/**
获取目标论坛文章列表及标签列表
输入:文章板块ID
**/
router
.
get
(
'/thread/getAllThreadAndTag/:infoId'
,
function
(
req
,
res
,
next
)
{
console
.
log
(
''
);
//1.获取论坛文章
//2.获取标签列表
/**返回数据格式:
{
"threads":[{文章对象},{文章对象}],
"tags":[{标签对象},{标签对象}]
}
**/
});
/**
根据标签获取目标论坛文章列表
输入:文章板块ID
**/
router
.
get
(
'/thread/getAllThreadByTagId/:tagId'
,
function
(
req
,
res
,
next
)
{
console
.
log
(
''
);
//1.获取论坛文章
/**返回数据格式:
{
"threads":[{文章对象},{文章对象}]
}
**/
});
//---------------------文章表单操作---------------------------------
//新增论坛文章
router
.
post
(
'/thread/create'
,
function
(
req
,
res
,
next
)
{
var
rs
=
{};
...
...
@@ -42,6 +93,14 @@ router.post('/thread/updateRaise/:tid', function(req, res, next) {
//3.更新文章统计数据(点赞数)
//4.创建点赞日志
/**
返回数据:
{
errorcode:0,
errormsg:''
}
**/
});
//更新文章分享数
...
...
@@ -55,6 +114,13 @@ router.post('/thread/updateShare/:tid', function(req, res, next) {
//3.更新文章统计数据(分享数)
//4.创建分享日志
/**
返回数据:
{
errorcode:0,
errormsg:''
}
**/
});
//新增文章评论
...
...
@@ -76,13 +142,11 @@ router.post('/thread/updateComment/:tid', function(req, res, next) {
//3.新增文章评论
//4.更新文章统计数据(评论数)
});
//文章收藏
router
.
post
(
'/thread/favorite/:tid'
,
function
(
req
,
res
,
next
)
{
var
tid
=
req
.
body
.
tid
||
null
;
console
.
log
(
tid
);
//1.检查是否有权限
//2.新增用户收藏
/**
返回数据:
{
errorcode:0,
errormsg:''
}
**/
});
\ No newline at end of file
app/controllers/service/rolePermission.js
0 → 100644
View file @
fe5664f8
'use strict'
;
//获取用户角色
exports
.
getRolePermiss
=
function
(
callback
){
//1.获取用户经验、积分
//2.获取角色权限列表
//3.根据积分、经验匹配对应的角色
};
//检查是否有操作权限
exports
.
checkRolePermiss
=
function
(
action
,
callback
){
var
action
=
req
.
query
.
action
||
''
;
//操作
//1.获取用户角色权限
//2.检查用户对应的角色是否有对应的操作权限
console
.
log
(
action
);
};
\ No newline at end of file
app/models/forumThread.js
View file @
fe5664f8
...
...
@@ -9,11 +9,11 @@ var ForumThreadSchema = new Schema({
require
:
true
,
index
:
true
},
forum
:
{
forum
Info
:
{
type
:
Schema
.
Types
.
ObjectId
,
require
:
true
,
index
:
true
,
ref
:
'Forum'
ref
:
'Forum
Info
'
},
from
:
{
//发帖者
type
:
Schema
.
Types
.
ObjectId
,
...
...
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