Add EmailProperties

pull/137/head
johnniang 2019-03-27 14:15:25 +08:00
parent 1d26aad03e
commit 58287e3ff3
2 changed files with 47 additions and 2 deletions

View File

@ -0,0 +1,41 @@
package cc.ryanc.halo.model.enums;
/**
* Email properties.
*
* @author johnniang
* @date 3/27/19
*/
public enum EmailProperties implements PropertyEnum {
SMTP_HOST("email_smtp_host", String.class),
SMTP_USERNAME("email_smtp_username", String.class),
SMTP_PASSWORD("email_smtp_password", String.class),
FROM_NAME("email_from_name", String.class),
ENABLED("email_enabled", Boolean.class),
COMMENT_REPLY_NOTICE_ENABLED("email_comment_reply_notice_enabled", Boolean.class),
NEW_COMMENT_NOTICE_ENABLED("email_new_comment_notice_enabled", Boolean.class),
COMMENT_PASS_NOTICE_ENABLED("email_comment_pass_notice_enabled", Boolean.class);
private final String value;
private final Class<?> type;
EmailProperties(String value, Class<?> type) {
if (!PropertyEnum.isSupportedType(type)) {
throw new IllegalArgumentException("Unsupported blog property type: " + type);
}
this.value = value;
this.type = type;
}
@Override
public Class<?> getType() {
return null;
}
@Override
public String getValue() {
return null;
}}

View File

@ -20,6 +20,10 @@ public enum UpYunProperties implements PropertyEnum {
private Class<?> type;
UpYunProperties(String value, Class<?> type) {
if (!PropertyEnum.isSupportedType(type)) {
throw new IllegalArgumentException("Unsupported blog property type: " + type);
}
this.value = value;
this.type = type;
}
@ -27,11 +31,11 @@ public enum UpYunProperties implements PropertyEnum {
@Override
public Class<?> getType() {
return null;
return type;
}
@Override
public String getValue() {
return null;
return value;
}
}