/**
 * Created by zhang on 2018/8/22.
 */

let express = require("express");
let repRouter =express.Router();
import ReplaceController from "../controllers/material_replace_controller";
let replaceController = new ReplaceController();

module.exports =function (app){

    repRouter.get("/main", replaceController.auth, replaceController.init, replaceController.main);
    repRouter.get("/edit/:libID", replaceController.auth, replaceController.init, replaceController.edit);
    repRouter.post("/findLib", replaceController.auth, replaceController.init, replaceController.findLib);
    repRouter.post("/addLib", replaceController.auth, replaceController.init, replaceController.addLib);
    repRouter.post("/saveLib", replaceController.auth, replaceController.init, replaceController.saveLib);
    repRouter.post("/deleteLibByID", replaceController.auth, replaceController.init, replaceController.deleteLibByID);
    repRouter.post("/saveBills", replaceController.auth, replaceController.init, replaceController.saveBills);
    repRouter.post("/saveMaterial", replaceController.auth, replaceController.init, replaceController.saveMaterial);
    repRouter.post("/findMaterial", replaceController.auth, replaceController.init, replaceController.findMaterial);
    app.use("/materialReplace", repRouter);
};


