/**
 * Created by zhang on 2017/7/12.
 */
let express = require("express");
let templateRouter =express.Router();
import BillsTemplateController from "../controllers/bills_template_controller";
let billsTemplateController = new BillsTemplateController();



module.exports =function (app) {

    templateRouter.get("/main", billsTemplateController.auth, billsTemplateController.init, billsTemplateController.main);
    templateRouter.get("/editTemplate/:libID", billsTemplateController.auth, billsTemplateController.init, billsTemplateController.editTemplate);
    templateRouter.post("/getLibByID", billsTemplateController.auth, billsTemplateController.init, billsTemplateController.getLibByID);
    templateRouter.post("/saveLib", billsTemplateController.auth, billsTemplateController.init, billsTemplateController.saveLib);
    templateRouter.post("/deleteLibByID", billsTemplateController.auth, billsTemplateController.init, billsTemplateController.deleteLibByID);
    templateRouter.post("/add-lib", billsTemplateController.auth, billsTemplateController.init, billsTemplateController.addLib);
    templateRouter.post("/copyLib", billsTemplateController.auth, billsTemplateController.init, billsTemplateController.copyLib);
    templateRouter.post("/updateBillsTemplateItem/:libID", billsTemplateController.auth, billsTemplateController.init, billsTemplateController.updateBillsTemplateItem);
    app.use("/billsTemplate", templateRouter);

};


