/**
 * 用户相关路由
 *
 * @author CaiAoLin
 * @date 2017/6/13
 * @version
 */
const Express = require("express");
const UserController = require("../controllers/user_controller");

module.exports = function (app) {

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

// action定义区域
    router.get('/info', userController.init, userController.info);
    router.get('/safe', userController.init, userController.safe);
    router.get('/buy', userController.init, userController.buy);
    router.get('/preferences', userController.init, userController.preferences);
    router.post('/save-preferences', userController.init, userController.savePreferences);
    router.post('/info', userController.init, userController.saveData);
    router.post('/getUserByMobile', userController.init, userController.getUserByMobile);
    router.post('/getUsers', userController.init, userController.getUsers);
    router.post('/isFree', userController.init, userController.isFree);

    router.post('/getVersionInfo', userController.init, userController.getVersionInfo);
    router.post('/change/isSmsLogin', userController.init, userController.changeIsSmsLogin);
    router.post('/change/isLoginValid', userController.init, userController.changeIsLoginValid);

    // router.get('/isFree', userController.init, userController.isFree);
    app.use('/user',router);
};
