/*
/!**
 * Created by jimiz on 2017/4/17.
 *!/
/!**
 * Created by jimiz on 2017/4/7.
 *!/
var GLJData = require('../models/glj');

//统一回调函数
var callback = function(req, res, err, message, data){
    res.json({error: err, message: message, data: data});
};

module.exports = {
    getData: function(req, res){
        var data = JSON.parse(req.body.data);
        GLJData.getData(data.projectId, function(err, message, GLJList){
            if (err === 0) {
                callback(req, res, err, message, GLJList);
            } else {
                callback(req, res, err, message, null);
            }
        });
    },

    getItemTemplate: function(req, res){
        //var data = JSON.parse(req.body.data);
        GLJData.getItemTemplate(function(err, message,GLJItem){
            if (billsItem) {
                callback(req, res, err, message, GLJItem);
            } else {
                callback(req, res, err, message, null);
            }
        });
    },

    allocIDs: function(req, res){
        GLJData.allocIDs(function(err, message, data){
            if (err) {
                callback(req, res, err, message, data);
            } else {
                callback(req, res, err, message, null);
            }
        });
    }

};*/
