/**
 * Created by Tony on 2017/6/26.
 * 报表模板路由 - 前台专用（无任何update）
 */
const express = require("express");
let rptTplRouter = express.Router();
const reportTplController = require("./../controllers/rpt_tpl_controller");

module.exports = function (app) {
    app.get('/rpt_print',  function(req, res) {
        if (!req.session.sessionUser.id) {
            res.redirect('/login');
        }
        else {
            res.render('building_saas//report/html/rpt_print.html',
                {
                    userAccount: req.session.userAccount,
                    userID: req.session.sessionUser.id
                }
            );
        }
    });

    rptTplRouter.post('/getRptTplTree', reportTplController.getRptTplTree);

    app.use("/report_tpl_api", rptTplRouter);
};