|
|
|
'use strict';
|
|
|
|
|
|
|
|
const Department = require('../../controllers/organization/department')
|
|
|
|
const user = require('../../controllers/organization/user')
|
|
|
|
const Authority = require('../../controllers/organization/authority')
|
|
|
|
|
|
|
|
module.exports = function (app, router, opts) {
|
|
|
|
app.fs.api.logAttr['GET/department'] = { content: '获取部门列表', visible: false };
|
|
|
|
router.get('/department', Department.getdep);
|
|
|
|
|
|
|
|
app.fs.api.logAttr['PUT/department'] = { content: '编辑部门信息', visible: false };
|
|
|
|
router.put('/department', Department.editDep);
|
|
|
|
|
|
|
|
app.fs.api.logAttr['DEL/department/:depId'] = { content: '删除部门信息', visible: false };
|
|
|
|
router.del('/department/:depId', Department.delDep);
|
|
|
|
|
|
|
|
app.fs.api.logAttr['GET/user'] = { content: '获取所有用户信息', visible: false };
|
|
|
|
router.get('/user', user.getUserAll);
|
|
|
|
|
|
|
|
app.fs.api.logAttr['GET/department/:depId/user'] = { content: '获取部门下用户信息', visible: false };
|
|
|
|
router.get('/department/:depId/user', user.getUser);
|
|
|
|
|
|
|
|
app.fs.api.logAttr['POST/department/user'] = { content: '创建部门下用户信息', visible: false };
|
|
|
|
router.post('/department/user', user.creatUser);
|
|
|
|
|
|
|
|
app.fs.api.logAttr['PUT/department/user/:userId'] = { content: '修改部门下用户信息', visible: false };
|
|
|
|
router.put('/department/user/:userId', user.updateUser);
|
|
|
|
|
|
|
|
app.fs.api.logAttr['DEL/department/user/:userIds'] = { content: '删除部门下用户信息', visible: false };
|
|
|
|
router.del('/department/user/:userIds', user.deleteUser);
|
|
|
|
|
|
|
|
// app.fs.api.logAttr['PUT/department/user/:userId/resetPwd'] = { content: '重置用户密码', visible: false };
|
|
|
|
// router.put('/department/user/:userId/resetPwd', user.resetPwd);
|
|
|
|
|
|
|
|
app.fs.api.logAttr['PUT/department/user/:userId/password'] = { content: '修改用户密码', visible: false };
|
|
|
|
router.put('/department/user/:userId/password', user.setPassword)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @api {GET} resource 查询所有权限码.
|
|
|
|
* @apiVersion 1.0.0
|
|
|
|
* @apiGroup Org
|
|
|
|
*/
|
|
|
|
app.fs.api.logAttr['GET/resource'] = { content: '查询所有权限码', visible: true };
|
|
|
|
router.get('resource', Authority.getResource);
|
|
|
|
/**
|
|
|
|
* @api {GET} user/resource 查询用户权限.
|
|
|
|
* @apiVersion 1.0.0
|
|
|
|
* @apiGroup Org
|
|
|
|
*/
|
|
|
|
app.fs.api.logAttr['GET/user/resource'] = { content: '查询用户权限', visible: true };
|
|
|
|
router.get('user/resource', Authority.getUserResource);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @api {POST} user/resource 更新用户权限.
|
|
|
|
* @apiVersion 1.0.0
|
|
|
|
* @apiGroup Org
|
|
|
|
*/
|
|
|
|
app.fs.api.logAttr['POST/user/resource'] = { content: '更新用户权限', visible: true };
|
|
|
|
router.post('user/resource', Authority.updateUserRes);
|
|
|
|
|
|
|
|
app.fs.api.logAttr['POST/user/resources'] = { content: '更新用户权限', visible: true };
|
|
|
|
router.post('user/resources', Authority.editeUserRes);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
};
|