/**
 * Created by zhang on 2018/9/10.
 */

let express = require("express");
let materialRouter =express.Router();
import MaterialController from "../controllers/material_controller";
let materialController = new MaterialController();

module.exports =function (app) {

    materialRouter.get("/main", materialController.auth, materialController.init, materialController.main);
    materialRouter.post("/addLib", materialController.auth, materialController.init, materialController.addLib);
    materialRouter.post("/findLib", materialController.auth, materialController.init, materialController.findLib);
    materialRouter.post("/saveLib", materialController.auth, materialController.init, materialController.saveLib);
    materialRouter.post("/deleteLibByID", materialController.auth, materialController.init, materialController.deleteLibByID);
    materialRouter.get("/edit/:libID", materialController.auth, materialController.init, materialController.edit);


    app.use("/material", materialRouter);
};