/**
 * 科拓车场镜像库
 * @date 2022-03
 * @author 何华东
 */

import * as KnexUtils from './KnexUtils'
import Contants from './Contants';
import { getParkImageKnexConfig } from './Config';

/**
 * 车场镜像测试库
 */
export const testParkImageKnexConfig = {
    connection: {
        host: '121.36.160.42',
        port: 3306,
        user: 'nkc_test',
        password: 'nkc_test_ZahJ5een',
        database: 'park_image',
        multipleStatements: true
    }
};

/**
 * 车场镜像正式库
 */
export const prodParkImageKnexConfig = {
    connection: {
        host: '122.112.252.51',
        port: 33390,
        user: 'nostandar',
        password: 'Keytop@!#321',
        database: 'park_image_new',
        multipleStatements: true
    }
};

export const defaultParkImageKnexConfig = Contants.IS_PROD ? prodParkImageKnexConfig : testParkImageKnexConfig;

/**
 * 车场镜像库
 * 
 * 车场镜像库可以通过knex直连，不用走收费系统SQL通道
 */
export const knexInstance = KnexUtils.generateMySqlKnexInstance(Object.assign(defaultParkImageKnexConfig, getParkImageKnexConfig()));
