Commit fe5664f8 authored by 张淼's avatar 张淼

1

parent 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('/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('');
});
......@@ -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
......@@ -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('');
});
......@@ -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
'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
......@@ -9,11 +9,11 @@ var ForumThreadSchema = new Schema({
require: true,
index: true
},
forum: {
forumInfo: {
type: Schema.Types.ObjectId,
require: true,
index: true,
ref: 'Forum'
ref: 'ForumInfo'
},
from: { //发帖者
type: Schema.Types.ObjectId,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment