-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: removed some code smells from few classes
- Loading branch information
1 parent
a90fb6b
commit 5907adf
Showing
22 changed files
with
622 additions
and
319 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
...-portal/src/main/java/com/ctrip/framework/apollo/portal/component/config/EmailConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package com.ctrip.framework.apollo.portal.component.config; | ||
|
||
import com.ctrip.framework.apollo.common.config.RefreshableConfig; | ||
import com.ctrip.framework.apollo.portal.service.PortalDBPropertySource; | ||
import com.google.common.base.Strings; | ||
import org.springframework.stereotype.Component; | ||
|
||
/** | ||
* This class handled email related configs for portalConfig class | ||
*/ | ||
@Component | ||
public class EmailConfig extends RefreshableConfig { | ||
|
||
public EmailConfig(final PortalDBPropertySource portalDBPropertySource) { | ||
super(portalDBPropertySource); | ||
} | ||
|
||
public String emailSender() { | ||
String value = getValue(PortalConfigConstants.EMAIL_SENDER, ""); | ||
return Strings.isNullOrEmpty(value) ? emailConfigUser() : value; | ||
} | ||
|
||
public String emailConfigHost() { | ||
return getValue(PortalConfigConstants.EMAIL_CONFIG_HOST, ""); | ||
} | ||
|
||
public String emailConfigPassword() { | ||
return getValue(PortalConfigConstants.EMAIL_CONFIG_PASSWORD, ""); | ||
} | ||
|
||
public String emailTemplateFramework() { | ||
return getValue(PortalConfigConstants.EMAIL_TEMPLATE_FRAMEWORK, ""); | ||
} | ||
|
||
public String emailReleaseDiffModuleTemplate() { | ||
return getValue(PortalConfigConstants.EMAIL_RELEASE_MODULE_DIFF, ""); | ||
} | ||
|
||
public String emailRollbackDiffModuleTemplate() { | ||
return getValue(PortalConfigConstants.EMAIL_ROLLBACK_MODULE_DIFF, ""); | ||
} | ||
|
||
public String emailGrayRulesModuleTemplate() { | ||
return getValue(PortalConfigConstants.EMAIL_RELEASE_MODULE_RULES, ""); | ||
} | ||
|
||
public String emailConfigUser() { | ||
return getValue(PortalConfigConstants.EMAIL_CONFIG_USER, ""); | ||
} | ||
|
||
public boolean isEmailEnabled() { | ||
return getBooleanProperty(PortalConfigConstants.EMAIL_ENABLED, false); | ||
} | ||
} |
Oops, something went wrong.