forked from DataLinkDC/dinky
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
1,174 additions
and
33 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
22 changes: 22 additions & 0 deletions
22
...src/main/java/org/dinky/data/model/alert/instance/parser/AbstractAlertInstanceConfig.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,22 @@ | ||
/* | ||
* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
package org.dinky.data.model.alert.instance.parser; | ||
|
||
public class AbstractAlertInstanceConfig {} |
128 changes: 128 additions & 0 deletions
128
.../src/main/java/org/dinky/data/model/alert/instance/parser/types/DingTalkConfigParser.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,128 @@ | ||
/* | ||
* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
package org.dinky.data.model.alert.instance.parser.types; | ||
|
||
import org.dinky.data.model.alert.instance.parser.AbstractAlertInstanceConfig; | ||
|
||
import java.io.Serializable; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
import io.swagger.annotations.ApiModel; | ||
import io.swagger.annotations.ApiModelProperty; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
/** | ||
* the full config is: | ||
* <p> | ||
* {"webhook":"https:///111","keyword":"111","secret":"1111","isEnableProxy":true,"isAtAll":false,"proxy":"1121","port":2121,"user":"2121","password":"2121","atMobiles":"2121"} | ||
*/ | ||
@Data | ||
@NoArgsConstructor | ||
@ApiModel(value = "DingTalkConfigParser", description = "DingTalk Config Parser") | ||
public class DingTalkConfigParser extends AbstractAlertInstanceConfig implements Serializable { | ||
private static final long serialVersionUID = 1L; | ||
|
||
@ApiModelProperty( | ||
value = "webhook url", | ||
required = true, | ||
dataType = "String", | ||
example = "https://oapi.dingtalk.com/robot/send?access_token=xxx") | ||
@JsonProperty("webhook") | ||
private String webhook; | ||
|
||
@ApiModelProperty(value = "keyword", required = true, dataType = "String", example = "111") | ||
@JsonProperty("keyword") | ||
private String keyword; | ||
|
||
@ApiModelProperty(value = "secret", required = true, dataType = "String", example = "1111") | ||
@JsonProperty("secret") | ||
private String secret; | ||
|
||
@ApiModelProperty(value = "isEnableProxy", required = true, dataType = "Boolean", example = "true") | ||
@JsonProperty("isEnableProxy") | ||
private boolean isEnableProxy; | ||
|
||
@ApiModelProperty(value = "isAtAll", required = true, dataType = "Boolean", example = "false") | ||
@JsonProperty("isAtAll") | ||
private boolean isAtAll; | ||
|
||
@ApiModelProperty(value = "atMobiles", required = true, dataType = "String", example = "2121") | ||
@JsonProperty("atMobiles") | ||
private String atMobiles; | ||
|
||
@ApiModelProperty(value = "proxy ip / host", required = true, dataType = "String", example = "1121") | ||
@JsonProperty("proxy") | ||
private String proxy; | ||
|
||
@ApiModelProperty(value = "proxy port", required = true, dataType = "Integer", example = "2121") | ||
@JsonProperty("port") | ||
private int port; | ||
|
||
@ApiModelProperty(value = "proxy user", required = true, dataType = "String", example = "2121") | ||
@JsonProperty("user") | ||
private String user; | ||
|
||
@ApiModelProperty(value = "proxy password", required = true, dataType = "String", example = "2121") | ||
@JsonProperty("password") | ||
private String password; | ||
|
||
@JsonCreator | ||
public DingTalkConfigParser( | ||
@JsonProperty("webhook") String webhook, | ||
@JsonProperty("keyword") String keyword, | ||
@JsonProperty("secret") String secret, | ||
@JsonProperty("isEnableProxy") boolean isEnableProxy, | ||
@JsonProperty("isAtAll") boolean isAtAll, | ||
@JsonProperty("atMobiles") String atMobiles, | ||
@JsonProperty("proxy") String proxy, | ||
@JsonProperty("port") int port, | ||
@JsonProperty("user") String user, | ||
@JsonProperty("password") String password) { | ||
this.webhook = webhook; | ||
this.keyword = keyword; | ||
this.secret = secret; | ||
this.isEnableProxy = isEnableProxy; | ||
this.isAtAll = isAtAll; | ||
this.atMobiles = atMobiles; | ||
this.proxy = proxy; | ||
this.port = port; | ||
this.user = user; | ||
this.password = password; | ||
} | ||
|
||
@JsonCreator | ||
public DingTalkConfigParser( | ||
@JsonProperty("webhook") String webhook, | ||
@JsonProperty("keyword") String keyword, | ||
@JsonProperty("secret") String secret, | ||
@JsonProperty("isEnableProxy") boolean isEnableProxy, | ||
@JsonProperty("isAtAll") boolean isAtAll, | ||
@JsonProperty("atMobiles") String atMobiles) { | ||
this.webhook = webhook; | ||
this.keyword = keyword; | ||
this.secret = secret; | ||
this.isEnableProxy = isEnableProxy; | ||
this.isAtAll = isAtAll; | ||
this.atMobiles = atMobiles; | ||
} | ||
} |
106 changes: 106 additions & 0 deletions
106
...min/src/main/java/org/dinky/data/model/alert/instance/parser/types/EmailConfigParser.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,106 @@ | ||
/* | ||
* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
package org.dinky.data.model.alert.instance.parser.types; | ||
|
||
import org.dinky.data.model.alert.instance.parser.AbstractAlertInstanceConfig; | ||
|
||
import java.io.Serializable; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
import io.swagger.annotations.ApiModel; | ||
import io.swagger.annotations.ApiModelProperty; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
/** | ||
* the full config is: | ||
* <p> | ||
* {"serverHost":"121","serverPort":1212,"sender":"212121","receivers":"2121","receiverCcs":"2121","enableSmtpAuth":true,"starttlsEnable":true,"sslEnable":true,"User":"212","Password":"121","smtpSslTrust":"2121"} | ||
*/ | ||
@Data | ||
@NoArgsConstructor | ||
@ApiModel(value = "EmailConfigParser", description = "Email Config Parser") | ||
public class EmailConfigParser extends AbstractAlertInstanceConfig implements Serializable { | ||
private static final long serialVersionUID = 1L; | ||
|
||
@ApiModelProperty(value = "server Host", required = true, dataType = "String", example = "121") | ||
private String serverHost; | ||
|
||
@ApiModelProperty(value = "server Port", required = true, dataType = "Integer", example = "1212") | ||
private Integer serverPort; | ||
|
||
@ApiModelProperty(value = "sender", required = true, dataType = "String", example = "212121") | ||
private String sender; | ||
|
||
@ApiModelProperty(value = "receivers", required = true, dataType = "String", example = "2121") | ||
private String receivers; | ||
|
||
@ApiModelProperty(value = "receiver Ccs", required = true, dataType = "String", example = "2121") | ||
private String receiverCcs; | ||
|
||
@ApiModelProperty(value = "enable Smtp Auth", required = true, dataType = "Boolean", example = "true") | ||
private boolean enableSmtpAuth; | ||
|
||
@ApiModelProperty(value = "starttls Enable", required = true, dataType = "Boolean", example = "true") | ||
private boolean starttlsEnable; | ||
|
||
@ApiModelProperty(value = "ssl Enable", required = true, dataType = "Boolean", example = "true") | ||
private boolean sslEnable; | ||
|
||
@ApiModelProperty(value = "User", required = true, dataType = "String", example = "212") | ||
@JsonProperty("User") | ||
private String user; | ||
|
||
@ApiModelProperty(value = "Password", required = true, dataType = "String", example = "121") | ||
@JsonProperty("Password") | ||
private String password; | ||
|
||
@ApiModelProperty(value = "smtp Ssl Trust", required = true, dataType = "String", example = "2121") | ||
@JsonProperty("smtpSslTrust") | ||
private String smtpSslTrust; | ||
|
||
@JsonCreator | ||
public EmailConfigParser( | ||
@JsonProperty("serverHost") String serverHost, | ||
@JsonProperty("serverPort") Integer serverPort, | ||
@JsonProperty("sender") String sender, | ||
@JsonProperty("receivers") String receivers, | ||
@JsonProperty("receiverCcs") String receiverCcs, | ||
@JsonProperty("enableSmtpAuth") boolean enableSmtpAuth, | ||
@JsonProperty("starttlsEnable") boolean starttlsEnable, | ||
@JsonProperty("sslEnable") boolean sslEnable, | ||
@JsonProperty("User") String user, | ||
@JsonProperty("Password") String password, | ||
@JsonProperty("smtpSslTrust") String smtpSslTrust) { | ||
this.serverHost = serverHost; | ||
this.serverPort = serverPort; | ||
this.sender = sender; | ||
this.receivers = receivers; | ||
this.receiverCcs = receiverCcs; | ||
this.enableSmtpAuth = enableSmtpAuth; | ||
this.starttlsEnable = starttlsEnable; | ||
this.sslEnable = sslEnable; | ||
this.user = user; | ||
this.password = password; | ||
this.smtpSslTrust = smtpSslTrust; | ||
} | ||
} |
Oops, something went wrong.