/**
 * 用户管理相关路由
 *
 * @author CaiAoLin
 * @date 2017/6/7
 * @version
 */
import Express from "express";
import UserController from "../controllers/user_controller";

const router = Express.Router();
const userController = new UserController();

module.exports =function (app) {
    // action定义区域
    router.get('/', userController.auth, userController.init, userController.normalUsers);
    router.get('/testUser', userController.auth, userController.init, userController.testUsers);
    router.get('/search', userController.auth, userController.init, userController.search);
    router.post('/findByID', userController.auth, userController.init, userController.findByID);
    router.post('/getOnlineInfo', userController.auth, userController.init, userController.getOnlineInfo);
    router.post('/getUserList', userController.auth, userController.init, userController.getUserList);
    router.post('/updateUser', userController.auth, userController.init, userController.updateUser);
    router.post('/deleteUser', userController.auth, userController.init, userController.deleteUser);
    app.use("/user", router);
};