package auto;

import com.fastchar.core.FastEngine;
import com.fastchar.extjs.FastExtConfig;
import com.fastchar.extjs.core.FastExtLayerType;
import com.fastchar.interfaces.IFastWeb;
import com.fastchar.database.info.FastDatabaseInfo;

public class ${webClassName} implements IFastWeb {

    @Override
    public void onInit(FastEngine engine) throws Exception {

        //系统数据源配置
        engine.getDatabases()
                .add(new FastDatabaseInfo()
                        .setHost(engine.getProperties().getString("dbHost"))
                        .setUser(engine.getProperties().getString("dbUser"))
                        .setPassword(engine.getProperties().getString("dbPassword"))
                        .setType("mysql")
                        .setCache(false)
                        .setName(engine.getProperties().getString("dbName")));
        
        //系统常量配置
        engine.getConstant()
                .setDebug(engine.getProperties().getBoolean("debug", true))
                .setLogInterceptorUseTotal(true)
                .setAnsi(${idea})
                .setLogSql(engine.getProperties().getBoolean("sql", true))
                .setCrossDomain(engine.getProperties().getBoolean("cross", true));
                

        //ExtJs配置
        engine.getConfig(FastExtConfig.class)
                .setLayerType(FastExtLayerType.None)
                .setMergeAppJs(engine.getProperties().getBoolean("merge", false))
                .setCompressAppJs(true);

    }

    @Override
    public void onDestroy(FastEngine engine) throws Exception {

    }


}