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
22958fe5
Commit
22958fe5
authored
Jan 21, 2015
by
张淼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
090e0b51
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
206 additions
and
0 deletions
+206
-0
forumInfo.js
app/controllers/forumInfo.js
+6
-0
forumRole.js
app/controllers/forumRole.js
+29
-0
forumRolePermission.js
app/controllers/forumRolePermission.js
+35
-0
forumThread.js
app/controllers/forumThread.js
+88
-0
intergal.js
app/controllers/service/intergal.js
+6
-0
forumRolePermission.js
app/models/forumRolePermission.js
+34
-0
forumThread.js
app/models/forumThread.js
+8
-0
No files found.
app/controllers/forumInfo.js
View file @
22958fe5
...
...
@@ -40,4 +40,10 @@ router.get('/info/get/:fid', function(req, res, next) {
}
else
{
res
.
json
(
returnCode
.
WRONG_PARAM
);
}
});
//根据论坛组ID获取目标论坛板块列表
router
.
get
(
'/info/get/:gid'
,
function
(
req
,
res
,
next
)
{
var
gid
=
req
.
params
.
gid
||
null
;
console
.
log
(
gid
);
});
\ No newline at end of file
app/controllers/forumRole.js
0 → 100644
View file @
22958fe5
'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
(
'/role/create'
,
function
(
req
,
res
,
next
)
{
var
rs
=
{};
var
forum
=
new
mongodb
.
ForumRole
(
req
.
body
);
forum
.
save
(
function
(
err
,
forum
)
{
if
(
err
)
{
console
.
error
(
err
);
res
.
json
(
returnCode
.
BUSY
);
}
else
{
rs
.
data
=
forum
;
res
.
json
(
_
.
assign
(
rs
,
returnCode
.
SUCCESS
));
}
});
});
//获取角色列表
router
.
get
(
'/role/getAll'
,
function
(
req
,
res
,
next
)
{
console
.
log
(
''
);
});
app/controllers/forumRolePermission.js
0 → 100644
View file @
22958fe5
'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
(
'/rolePermiss/create'
,
function
(
req
,
res
,
next
)
{
console
.
log
(
''
);
});
//获取角色权限列表
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
);
});
app/controllers/forumThread.js
0 → 100644
View file @
22958fe5
'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
(
'/thread/create'
,
function
(
req
,
res
,
next
)
{
var
rs
=
{};
var
forum
=
new
mongodb
.
ForumThread
(
req
.
body
);
forum
.
save
(
function
(
err
,
forum
)
{
if
(
err
)
{
console
.
error
(
err
);
res
.
json
(
returnCode
.
BUSY
);
}
else
{
rs
.
data
=
forum
;
res
.
json
(
_
.
assign
(
rs
,
returnCode
.
SUCCESS
));
}
});
});
//获取目标论坛文章
router
.
get
(
'/thread/get/:tid'
,
function
(
req
,
res
,
next
)
{
console
.
log
(
''
);
//1.获取论坛文章
//2.获取评论、回复
});
//更新文章点赞数
router
.
post
(
'/thread/updateRaise/:tid'
,
function
(
req
,
res
,
next
)
{
var
tid
=
req
.
body
.
tid
||
null
;
console
.
log
(
tid
);
//1.检查是否有权限
//2.获取论坛文章
//3.更新文章统计数据(点赞数)
//4.创建点赞日志
});
//更新文章分享数
router
.
post
(
'/thread/updateShare/:tid'
,
function
(
req
,
res
,
next
)
{
var
tid
=
req
.
body
.
tid
||
null
;
console
.
log
(
tid
);
//1.检查是否有权限
//2.获取论坛文章
//3.更新文章统计数据(分享数)
//4.创建分享日志
});
//新增文章评论
/**
**输入:
tid:文章id
pId:评论父id
comment:评论内容
**输出:
操作结果
**/
router
.
post
(
'/thread/updateComment/:tid'
,
function
(
req
,
res
,
next
)
{
var
tid
=
req
.
body
.
tid
||
null
;
console
.
log
(
tid
);
//1.检查是否有权限
//2.获取论坛文章
//3.新增文章评论
//4.更新文章统计数据(评论数)
});
//文章收藏
router
.
post
(
'/thread/favorite/:tid'
,
function
(
req
,
res
,
next
)
{
var
tid
=
req
.
body
.
tid
||
null
;
console
.
log
(
tid
);
//1.检查是否有权限
//2.新增用户收藏
});
\ No newline at end of file
app/controllers/service/intergal.js
0 → 100644
View file @
22958fe5
'use strict'
;
//根据会员ID获取
exports
.
getIntegralById
=
function
(
mid
,
callback
){
console
.
log
(
''
);
};
\ No newline at end of file
app/models/forumRolePermission.js
0 → 100644
View file @
22958fe5
'use strict'
;
var
mongoose
=
require
(
'mongoose'
),
Schema
=
mongoose
.
Schema
;
//论坛角色权限
var
ForumRolePermissionSchema
=
new
Schema
({
ent_code
:
{
type
:
Number
,
require
:
true
,
index
:
true
},
role
:
{
//角色
type
:
Schema
.
Types
.
ObjectId
,
require
:
true
,
index
:
true
,
ref
:
'ForumRole'
},
action
:
{
//动作
type
:
Array
},
rules
:{
//角色匹配规则
type
:
String
},
status
:
{
//权限1,可用,0禁用
type
:
Number
,
require
:
true
,
default
:
0
}
},
{
'collection'
:
'pisns_forum_role_permission'
});
module
.
exports
=
mongoose
.
model
(
'ForumRolePermission'
,
ForumRolePermissionSchema
);
\ No newline at end of file
app/models/forumThread.js
View file @
22958fe5
...
...
@@ -25,6 +25,14 @@ var ForumThreadSchema = new Schema({
type
:
String
,
require
:
true
},
type
:{
//文章类型 1、文章 2、照片墙
type
:
String
,
require
:
true
},
pid
:{
//文章父ID
type
:
Schema
.
Types
.
ObjectId
,
ref
:
'ForumThread'
}
content
:
{
//话题内容
type
:
String
,
require
:
true
...
...
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