const mysql = require('think-model-mysql');
const redisCache = require('think-cache-redis');
const {Console, File, DateFile} = require('think-logger3');
/**
 * 生产环境 cache adapter config
 * @type {Object}
 */
exports.cache = {
  type: 'redis',
  common: {
    timeout: 24 * 60 * 60 * 1000
  },
  redis: {
    handle: redisCache,
    host: '127.0.0.1',
    port: 6319,
    password: '8cLgEgZSdWr57CTe',
    timeout: 0,
    log_connect: true
  }
};

/**
 * 生产环境 model adapter config
 * @type {Object}
 */
exports.model = {
  type: 'pap',
  common: {
    logConnect: true,
    logSql: true,
    logger: msg => think.logger.info(msg)
  },
  // pap 线上数据库
  // pap: {
  //   handle: mysql,
  //   database: 'pap_web',
  //   prefix: '',
  //   encoding: 'utf8mb4',
  //   host: 'sh-cynosdbmysql-grp-jjq5h0fk.sql.tencentcdb.com',
  //   port: '26822',
  //   user: 'root',
  //   password: '5orKUdDN3QhESVcS',
  //   dateStrings: true
  // }
};

exports.logger = {
  type: 'console',
  console: {
    handle: Console
  }
};