Skip to content

Commit

Permalink
[Fix] fix dingtalk at user Params (#16379)
Browse files Browse the repository at this point in the history
  • Loading branch information
xxzuo committed Aug 12, 2024
1 parent 70d6d01 commit f9db865
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public List<PluginParams> params() {
.setRequired(false)
.build())
.build();
InputParam atUserIdsParam = InputParam
InputParam atDingtalkIdsParam = InputParam
.newBuilder(DingTalkParamsConstants.NAME_DING_TALK_AT_USERIDS,
DingTalkParamsConstants.DING_TALK_AT_USERIDS)
.addValidate(Validate.newBuilder()
Expand Down Expand Up @@ -141,7 +141,7 @@ public List<PluginParams> params() {
.setType("password")
.build();

return Arrays.asList(webHookParam, keywordParam, secretParam, msgTypeParam, atMobilesParam, atUserIdsParam,
return Arrays.asList(webHookParam, keywordParam, secretParam, msgTypeParam, atMobilesParam, atDingtalkIdsParam,
isAtAll, isEnableProxy, proxyParam, portParam, userParam, passwordParam);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public final class DingTalkParamsConstants {
static final String DING_TALK_AT_MOBILES = "$t('atMobiles')";
static final String NAME_DING_TALK_AT_MOBILES = "AtMobiles";

static final String DING_TALK_AT_USERIDS = "$t('atUserIds')";
static final String NAME_DING_TALK_AT_USERIDS = "AtUserIds";
static final String DING_TALK_AT_USERIDS = "$t('atDingtalkIds')";
static final String NAME_DING_TALK_AT_USERIDS = "AtDingtalkIds";

static final String DING_TALK_AT_ALL = "$t('isAtAll')";
static final String NAME_DING_TALK_AT_ALL = "IsAtAll";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public final class DingTalkSender {
private String msgType;

private final String atMobiles;
private final String atUserIds;
private final String atDingtalkIds;
private final Boolean atAll;

private final Boolean enableProxy;
Expand All @@ -87,7 +87,7 @@ public final class DingTalkSender {
msgType = config.get(DingTalkParamsConstants.NAME_DING_TALK_MSG_TYPE);

atMobiles = config.get(DingTalkParamsConstants.NAME_DING_TALK_AT_MOBILES);
atUserIds = config.get(DingTalkParamsConstants.NAME_DING_TALK_AT_USERIDS);
atDingtalkIds = config.get(DingTalkParamsConstants.NAME_DING_TALK_AT_USERIDS);
atAll = Boolean.valueOf(config.get(DingTalkParamsConstants.NAME_DING_TALK_AT_ALL));

enableProxy = Boolean.valueOf(config.get(DingTalkParamsConstants.NAME_DING_TALK_PROXY_ENABLE));
Expand Down Expand Up @@ -271,8 +271,8 @@ private void generateMarkdownMsg(String title, String content, Map<String, Objec
builder.append(" ");
});
}
if (org.apache.commons.lang3.StringUtils.isNotBlank(atUserIds)) {
Arrays.stream(atUserIds.split(",")).forEach(value -> {
if (org.apache.commons.lang3.StringUtils.isNotBlank(atDingtalkIds)) {
Arrays.stream(atDingtalkIds.split(",")).forEach(value -> {
builder.append("@");
builder.append(value);
builder.append(" ");
Expand All @@ -297,12 +297,12 @@ private void setMsgAt(Map<String, Object> items) {
org.apache.commons.lang3.StringUtils.isNotBlank(atMobiles) ? atMobiles.split(",")
: new String[0];
String[] atUserArray =
org.apache.commons.lang3.StringUtils.isNotBlank(atUserIds) ? atUserIds.split(",")
org.apache.commons.lang3.StringUtils.isNotBlank(atDingtalkIds) ? atDingtalkIds.split(",")
: new String[0];
boolean isAtAll = Objects.isNull(atAll) ? false : atAll;

at.put("atMobiles", atMobileArray);
at.put("atUserIds", atUserArray);
at.put("atDingtalkIds", atUserArray);
at.put("isAtAll", isAtAll);

items.put("at", at);
Expand Down
2 changes: 1 addition & 1 deletion dolphinscheduler-ui/src/locales/en_US/security.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ export default {
AtSomeoneInRoom: 'At Someone In Room',
Destination: 'Destination',
AtMobiles: 'At User Mobiles',
AtUserIds: 'At User Ids',
AtDingtalkIds: 'At User Ids',
MsgType: 'Msg Type',
// eslint-disable-next-line quotes
IsAtAll: "{'@'}All",
Expand Down
2 changes: 1 addition & 1 deletion dolphinscheduler-ui/src/locales/zh_CN/security.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ export default {
// eslint-disable-next-line quotes
AtMobiles: "被{'@'}人的手机号",
// eslint-disable-next-line quotes
AtUserIds: "被{'@'}人的用户ID",
AtDingtalkIds: "被{'@'}人的用户ID",
MsgType: '消息类型',
// eslint-disable-next-line quotes
IsAtAll: "{'@'}所有人",
Expand Down

0 comments on commit f9db865

Please sign in to comment.