[Refactor] Canonical enum naming (#7676)
* [Refactor] Refactor comments
This commit is contained in:
parent
3af4d765c2
commit
2b05ebf47e
|
|
@ -29,7 +29,7 @@ public enum ShowType {
|
||||||
TABLE(0, "table"),
|
TABLE(0, "table"),
|
||||||
TEXT(1, "text"),
|
TEXT(1, "text"),
|
||||||
ATTACHMENT(2, "attachment"),
|
ATTACHMENT(2, "attachment"),
|
||||||
TABLEATTACHMENT(3, "table attachment");
|
TABLE_ATTACHMENT(3, "table attachment");
|
||||||
|
|
||||||
private final int code;
|
private final int code;
|
||||||
private final String descp;
|
private final String descp;
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ public final class EmailAlertChannelFactory implements AlertChannelFactory {
|
||||||
.addParamsOptions(new ParamsOptions(ShowType.TABLE.getDescp(), ShowType.TABLE.getDescp(), false))
|
.addParamsOptions(new ParamsOptions(ShowType.TABLE.getDescp(), ShowType.TABLE.getDescp(), false))
|
||||||
.addParamsOptions(new ParamsOptions(ShowType.TEXT.getDescp(), ShowType.TEXT.getDescp(), false))
|
.addParamsOptions(new ParamsOptions(ShowType.TEXT.getDescp(), ShowType.TEXT.getDescp(), false))
|
||||||
.addParamsOptions(new ParamsOptions(ShowType.ATTACHMENT.getDescp(), ShowType.ATTACHMENT.getDescp(), false))
|
.addParamsOptions(new ParamsOptions(ShowType.ATTACHMENT.getDescp(), ShowType.ATTACHMENT.getDescp(), false))
|
||||||
.addParamsOptions(new ParamsOptions(ShowType.TABLEATTACHMENT.getDescp(), ShowType.TABLEATTACHMENT.getDescp(), false))
|
.addParamsOptions(new ParamsOptions(ShowType.TABLE_ATTACHMENT.getDescp(), ShowType.TABLE_ATTACHMENT.getDescp(), false))
|
||||||
.setValue(ShowType.TABLE.getDescp())
|
.setValue(ShowType.TABLE.getDescp())
|
||||||
.addValidate(Validate.newBuilder().setRequired(true).build())
|
.addValidate(Validate.newBuilder().setRequired(true).build())
|
||||||
.build();
|
.build();
|
||||||
|
|
|
||||||
|
|
@ -187,7 +187,7 @@ public final class MailSender {
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
handleException(alertResult, e);
|
handleException(alertResult, e);
|
||||||
}
|
}
|
||||||
} else if (showType.equals(ShowType.ATTACHMENT.getDescp()) || showType.equals(ShowType.TABLEATTACHMENT.getDescp())) {
|
} else if (showType.equals(ShowType.ATTACHMENT.getDescp()) || showType.equals(ShowType.TABLE_ATTACHMENT.getDescp())) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
String partContent = (showType.equals(ShowType.ATTACHMENT.getDescp())
|
String partContent = (showType.equals(ShowType.ATTACHMENT.getDescp())
|
||||||
|
|
|
||||||
|
|
@ -132,7 +132,7 @@ public class EmailAlertChannelTest {
|
||||||
emailShowTypeList.add(new ParamsOptions(ShowType.TABLE.getDescp(), ShowType.TABLE.getDescp(), false));
|
emailShowTypeList.add(new ParamsOptions(ShowType.TABLE.getDescp(), ShowType.TABLE.getDescp(), false));
|
||||||
emailShowTypeList.add(new ParamsOptions(ShowType.TEXT.getDescp(), ShowType.TEXT.getDescp(), false));
|
emailShowTypeList.add(new ParamsOptions(ShowType.TEXT.getDescp(), ShowType.TEXT.getDescp(), false));
|
||||||
emailShowTypeList.add(new ParamsOptions(ShowType.ATTACHMENT.getDescp(), ShowType.ATTACHMENT.getDescp(), false));
|
emailShowTypeList.add(new ParamsOptions(ShowType.ATTACHMENT.getDescp(), ShowType.ATTACHMENT.getDescp(), false));
|
||||||
emailShowTypeList.add(new ParamsOptions(ShowType.TABLEATTACHMENT.getDescp(), ShowType.TABLEATTACHMENT.getDescp(), false));
|
emailShowTypeList.add(new ParamsOptions(ShowType.TABLE_ATTACHMENT.getDescp(), ShowType.TABLE_ATTACHMENT.getDescp(), false));
|
||||||
RadioParam showType = RadioParam.newBuilder(AlertConstants.NAME_SHOW_TYPE, "showType")
|
RadioParam showType = RadioParam.newBuilder(AlertConstants.NAME_SHOW_TYPE, "showType")
|
||||||
.setOptions(emailShowTypeList)
|
.setOptions(emailShowTypeList)
|
||||||
.setValue(ShowType.TABLE.getDescp())
|
.setValue(ShowType.TABLE.getDescp())
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,7 @@ public class MailUtilsTest {
|
||||||
@Test
|
@Test
|
||||||
public void testTableAttachmentFile() throws Exception {
|
public void testTableAttachmentFile() throws Exception {
|
||||||
String content = list2String();
|
String content = list2String();
|
||||||
emailConfig.put(AlertConstants.NAME_SHOW_TYPE, ShowType.TABLEATTACHMENT.getDescp());
|
emailConfig.put(AlertConstants.NAME_SHOW_TYPE, ShowType.TABLE_ATTACHMENT.getDescp());
|
||||||
mailSender = new MailSender(emailConfig);
|
mailSender = new MailSender(emailConfig);
|
||||||
mailSender.sendMails("gaojing", content);
|
mailSender.sendMails("gaojing", content);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -166,7 +166,7 @@ public class ExecutorController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* check process definition and all of the son process definitions is on line.
|
* check process definition and all the son process definitions is online.
|
||||||
*
|
*
|
||||||
* @param processDefinitionCode process definition code
|
* @param processDefinitionCode process definition code
|
||||||
* @return check result code
|
* @return check result code
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue