var Service = require('Service');
var util = require('util');

/**
 * 获得用户应用
 */
var GetListUserApp = function () {
  Service.call(this);
};

util.inherits(GetListUserApp, Service);

module.exports = GetListUserApp;

/**
 * 处理服务请求
 * @param  {Object} req 服务请求对象
 * @param  {Object} res 服务响应对象
 */
GetListUserApp.prototype.process = function (req, res) {
  var self = this;
  res.apps = [{
      "code": "aaaa",
      "name": "超",
      "icon": "component",
       "url": "../datamodel/createmodel/index.html"
    },{
      "code": "aaaa0",
      "name": "连接",
      "icon": "component",
      "url": "../datamodel/connection/index.html"
    },
    {
      "code": "bbbb",
      "name": "组织机构",
      "icon": "user",
      "url": "",
      "children": [{
        "code": "dddddd",
        "name": "部门管理", 
        "url": "../sys/ndep/getTree.html"
      },{
        "code": "hhhhhhh",
        "name": "用户管理", 
        "url": "../sys/nuser/getList.html" 
      },{
        "code": "zzzzzzz",
        "name": "组织机构", 
        "url": "../system/org/index.html"
      },{
        "code": "eeeeee",
        "name": "扩展", 
        "url": "",
        "children": [{
          "code": "aa",
          "name": "代码",
          "url": "../builder/datasource/sqlEditor.html"
        },{
          "code": "bb",
          "name": "Excel",
          "url": "../builder/reportdesign/excelMode.html"
        },{
          "code": "cc",
          "name": "模块二二三",
          "url": ""
        }]
      },
      {
        "code": "aaa",
        "name": "数据源",
        // "icon": "component",
        "url": "../datamodel/wf_datasource/index.html"
      },
      {
        "code": "bbb",
        "name": "数据查询",
        // "icon": "component",
        "url": "../datamodel/wf_dataquery/index.html"
      },
      {
        "code": "ccc",
        "name": "数据表",
        // "icon": "component",
        "url": "../datamodel/wf_datatable/index.html"
      }
    ]
    },
    {
      "code": "cccc",
      "name": "模块三",
      "icon": "senior",
      "url": "",
      "children": [{
        "code": "ffffff",
        "name": "模块三一",
        "url": ""
      },{
        "code": "gggggg",
        "name": "模块三二",
        "url": ""
      }]
    }
  ];
  self.end(res);
};