package com.comet.search.config;

import java.util.ArrayList;
import java.util.List;

public class DatabaseConfig {

    public static final String DB_USER = "root";
    public static final String DB_PASSWORD = "P@$$ion@07071995";
    public static final String DB_HOST = "localhost";

    private String dbName;
    private String table1;
    private String table2;

    public DatabaseConfig(String dbName, String table1, String table2) {
        this.dbName = dbName;
        this.table1 = table1;
        this.table2 = table2;
    }

    public String getDbName() {
        return dbName;
    }

    public String getTable1() {
        return table1;
    }

    public String getTable2() {
        return table2;
    }

    public String getJdbcUrl() {
        return "jdbc:mysql://" + DB_HOST + ":3306/" + dbName + "?useSSL=false&serverTimezone=UTC";
    }

    public static List<DatabaseConfig> getAllDatabases() {
        List<DatabaseConfig> dbs = new ArrayList<>();
        dbs.add(new DatabaseConfig("postdata", "postdata1", "postdata2"));
        dbs.add(new DatabaseConfig("postdata20", "postdata201", "postdata202"));
        dbs.add(new DatabaseConfig("postdatanew", "postdatanew1", "postdatanew2"));
        dbs.add(new DatabaseConfig("postdelhi", "postdelhi1", "postdelhi2"));
        dbs.add(new DatabaseConfig("postguj", "postguj1", "postguj2"));
        dbs.add(new DatabaseConfig("postkarna", "postkarna1", "postkarna2"));
        dbs.add(new DatabaseConfig("postup", "postup1", "postup2"));
        return dbs;
    }
}
