@Override
    public void newConfig(ConfNewItemForm confNewForm, DisConfigTypeEnum disConfigTypeEnum) {

        Config config = new Config();

        config.setAppId(confNewForm.getAppId());
        config.setEnvId(confNewForm.getEnvId());
        config.setName(confNewForm.getKey());
        config.setType(disConfigTypeEnum.getType());
        config.setVersion(confNewForm.getVersion());
        config.setValue(CodeUtils.utf8ToUnicode(confNewForm.getValue()));
        config.setStatus(Constants.STATUS_NORMAL);

        // 时间
        String curTime = DateUtils.format(new Date(), DataFormatConstants.COMMON_TIME_FORMAT);
        config.setCreateTime(curTime);
        config.setUpdateTime(curTime);

        configDao.create(config);
        configHistoryMgr.createOne(config.getId(), "", config.getValue());

        // 发送邮件通知
        //
        String toEmails = appMgr.getEmails(config.getAppId());
        if (applicationPropertyConfig.isEmailMonitorOn() == true) {
            logMailBean.sendHtmlEmail(toEmails, " config new", getNewValue(confNewForm.getValue(), config.toString(),
                    getConfigUrlHtml(config)));
        }
    }
@ Override public void newConfig ( ConfNewItemForm confNewForm , DisConfigTypeEnum disConfigTypeEnum ) { Config config = new Config ( ) ; config . setAppId ( confNewForm . getAppId ( ) ) ; config . setEnvId ( confNewForm . getEnvId ( ) ) ; config . setName ( confNewForm . getKey ( ) ) ; config . setType ( disConfigTypeEnum . getType ( ) ) ; config . setVersion ( confNewForm . getVersion ( ) ) ; config . setValue ( CodeUtils . utf8ToUnicode ( confNewForm . getValue ( ) ) ) ; config . setStatus ( Constants . STATUS_NORMAL ) ; String curTime = DateUtils . format ( new Date ( ) , DataFormatConstants . COMMON_TIME_FORMAT ) ; config . setCreateTime ( curTime ) ; config . setUpdateTime ( curTime ) ; configDao . create ( config ) ; configHistoryMgr . createOne ( config . getId ( ) , "" , config . getValue ( ) ) ; String toEmails = appMgr . getEmails ( config . getAppId ( ) ) ; if ( applicationPropertyConfig . isEmailMonitorOn ( ) == true ) { logMailBean . sendHtmlEmail ( toEmails , " config new" , getNewValue ( confNewForm . getValue ( ) , config . toString ( ) , getConfigUrlHtml ( config ) ) ) ; } }
新建配置