var path       = require('path');
var settings = {
  env:"dev",
  appKey:"38f64854859146db999778f5d941c1bd",
  paasKey:"wx76a324c5d201d1a4",
  secret:"5dfd328901d4478b98ce62f7a07f6c67",
  //为了直接从应用客户端登录,需要查询出当前用户所在公司
  //如果有这个配置，就表示支持从应用自己的客户端登录或注册
  // companyKey:"af4dfb53282d4743866259e0b15b134e",
  salt: "%iatpD1gcxz7iF#B",
  basepath   : path.normalize(path.join(__dirname, '../..')),
  port       : process.env.NODE_PORT || 3004,
  paasUrl:function(){
    if(this.env=="dev"){
      return "http://p.apps.com:4001/";
    }else {
      return "http://open.gongsibao.com/";
    }
  },
  reqEsAddr:function(){
    if(this.env=="dev"){
      var localsettings=require("./localsettings");
      return "http://43.247.184.94:7200/";//localsettings.reqEsDevUrl;
    }else {
      return "http://43.247.184.94:7200/";
    }
  },
  apiconfig:{
    opLogUrl:function(){
      return settings.reqEsAddr()+"bigdata_zc_op_log/_doc?pretty";
    },
    opLogEsIsAdd:function(){
      return 1;
    },
  },
  redis:function(){
    if(this.env=="dev"){
      var localsettings=require("./localsettings");
      return localsettings.redis;
    }else {
      return {
        host:"xxxxx",
        port:xxxxx,
        password:"xxxxx",
        db:xx,
      };
    }
  },
  database:function(){
    if(this.env=="dev"){
      var localsettings=require("./localsettings");
      return  localsettings.database;
    }else{
      return {
       dbname : "xxxxx",
       user     : "xxxx",
       password : "xxxxx",
       config   : {
           host: 'xxxxxx',
           dialect: 'mysql',
           operatorsAliases: false,
           pool: {
             max: 5,
             min: 0,
             acquire: 90000000,
             idle: 1000000
           },
           debug:false,
           dialectOptions:{
               requestTimeout: 999999,
               // instanceName:'DEV'
           }  //设置MSSQL超时时间
       },
     };
    }
  },
};
module.exports = settings;


