package kd.bos.debug.mservice;

import kd.bos.config.client.util.ConfigUtils;
import kd.bos.db.DB;
import kd.bos.db.SqlLogger;
import kd.bos.login.utils.LoginUtils;
import kd.bos.service.webserver.JettyServer;
import kd.bos.util.PasswordEncryptUtil;

public class DebugServer {

	public static void main(String[] args) throws Exception	{

		System.setProperty(ConfigUtils.APP_NAME_KEY, "kdcosmic-xiejinqguan-8881");

		//设置集群环境名称和配置服务器地址
		System.setProperty("clusterName", "ierp");
		System.setProperty("domain.tenantCode","ierp");

		System.setProperty(ConfigUtils.CONFIG_URL_KEY, "10.201.51.205:2181/?user=cosmic&password=Cosmic@2023");
		System.setProperty("configAppName", "mservice,web");
		System.setProperty("webmserviceinone", "true");

		System.setProperty("file.encoding", "utf-8");
		System.setProperty("xdb.enable", "false");

		System.setProperty("mq.consumer.register", "true");
		System.setProperty("MONITOR_HTTP_PORT", "9998");
		System.setProperty("JMX_HTTP_PORT", "9091");
		System.setProperty("dubbo.protocol.port", "28888");
		System.setProperty("dubbo.consumer.url", "dubbo://localhost:28888");
		System.setProperty("dubbo.consumer.url.qing", "dubbo://localhost:30880");
		System.setProperty("dubbo.registry.register", "true");
		System.setProperty("dubbo.service.lookup.local", "true");
		System.setProperty("appSplit", "false");

		System.setProperty("lightweightdeploy","true");

		//开启sql日志输出
		System.setProperty("db.sql.out","true");
		//开启sql日志参数输出
		System.setProperty("db.sql.out.withParameter","true");


		System.setProperty("JETTY_WEB_PORT","8881");

		System.setProperty("JETTY_WEBRES_PATH", "H:\\gitGogs\\zlkj\\home\\static-file-service");
		System.setProperty("log.config","<?xml version=\"1.0\" encoding=\"UTF-8\" ?><configuration>\t<appender name=\"stdot\" class=\"ch.qos.logback.core.ConsoleAppender\">\t\t<layout class=\"ch.qos.logback.classic.PatternLayout\">\t\t\t<pattern>%d{HH:mm:ss} [%thread] %level %logger.%M\\(%L\\):%m%n</pattern>\t\t</layout>\t</appender>\t<logger name=\"cn.zlkj.pms\" level=\"INFO\" additivity=\"false\">    <appender-ref ref=\"stdot\" />  </logger>\t<root level=\"INFO\">\t<appender-ref ref=\"stdot\" />\t</root></configuration>");

		System.setProperty("domain.contextUrl","http://127.0.0.1:8881/ierp");
		System.setProperty("tenant.code.type","config");

		System.setProperty("bos.app.special.deployalone.ids","");
		System.setProperty("mc.server.url","http://10.201.51.205:8090/mc");
		System.setProperty("mq.debug.queue.tag", "xjqtest");

		System.setProperty("dts.sync.enable", "false");
		System.setProperty("diskcache.path","D:\\diskcache");
		System.setProperty("tempfile.cachetype","disk");
		System.setProperty("redismodelcache.enablelua","false");

//		System.setProperty("ISC_TEST_PASSWORD", "Kingdee@123");
//		System.setProperty("login_default_pwd", "Kingdee@123");
		JettyServer.main(null);

		DB.setSqlLogger(new SqlLogger(){

			@Override
			public void logSQL(String s, Object... objects) {
				System.out.println("logSQL:"+s);
			}

			@Override
			public void logMessage(String s) {

			}

			@Override
			public void log(String sql,Object...obj){

			}
		});

	}

}
