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

let express = require("express");
let calcProgramRouter =express.Router();
import CalcProgramController from "../controllers/calc_program_controller";
let calcProgramController = new CalcProgramController();

module.exports =function (app) {

    calcProgramRouter.get("/main", calcProgramController.auth, calcProgramController.init, calcProgramController.main);
    calcProgramRouter.post("/addLib", calcProgramController.auth, calcProgramController.init, calcProgramController.addLib);
    calcProgramRouter.post("/findLib", calcProgramController.auth, calcProgramController.init, calcProgramController.findLib);
    calcProgramRouter.post("/saveLib", calcProgramController.auth, calcProgramController.init, calcProgramController.saveLib);
    calcProgramRouter.post("/deleteLibByID", calcProgramController.auth, calcProgramController.init, calcProgramController.deleteLibByID);
    calcProgramRouter.get("/edit/:libID", calcProgramController.auth, calcProgramController.init, calcProgramController.edit);
    app.use("/calcProgram", calcProgramRouter);
};
