'use strict';

/**
 *
 *
 * @author Zhong
 * @date 2018/5/29
 * @version
 */
import express from 'express';
import BillsGuideLibController from '../controllers/libController';
import ViewsController from '../controllers/viewController';
const router = express.Router();
const billsGuideLibController = new BillsGuideLibController();
const viewsController = new ViewsController();

module.exports = function (app) {
    app.get('/billsGuidance/main', viewsController.auth, viewsController.init, viewsController.redirectMain);
    app.get('/billsGuidance/guidance', viewsController.auth, viewsController.init, viewsController.redirectGuidance);
    router.post('/getComBillsLibInfo', billsGuideLibController.auth, billsGuideLibController.init, billsGuideLibController.getComBillsLibInfo);
    router.post('/getBillsGuideLibs', billsGuideLibController.auth, billsGuideLibController.init, billsGuideLibController.getBillsGuideLibs);
    router.post('/updateBillsGuideLib', billsGuideLibController.auth, billsGuideLibController.init, billsGuideLibController.updateBillsGuideLib);
    router.post('/getLibWithBills', billsGuideLibController.auth, billsGuideLibController.init, billsGuideLibController.getLibWithBills);
    router.post('/getItemsByBills', billsGuideLibController.auth, billsGuideLibController.init, billsGuideLibController.getItemsByBills);
    router.post('/updateItems', billsGuideLibController.auth, billsGuideLibController.init, billsGuideLibController.updateItems);
    //test
    //router.post('/testItems', billsGuideLibController.auth, billsGuideLibController.init, billsGuideLibController.testItems);


    app.use('/billsGuidance/api', router);
};