-
Notifications
You must be signed in to change notification settings - Fork 505
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
1 parent
c7ed2c4
commit ba032dd
Showing
32 changed files
with
1,155 additions
and
530 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
35 changes: 35 additions & 0 deletions
35
...on/common-notify/src/main/kotlin/com/tencent/devops/common/notify/pojo/VoiceNotifyPost.kt
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,35 @@ | ||
package com.tencent.devops.common.notify.pojo | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty | ||
|
||
/** | ||
* 语音消息 | ||
*/ | ||
class VoiceNotifyPost : BaseNotifyPost() { | ||
@JsonProperty("Receiver") | ||
var receiver = "" | ||
|
||
@JsonProperty("TaskName") | ||
var taskName = "" | ||
|
||
@JsonProperty("Content") | ||
var content = "" | ||
|
||
@JsonProperty("TransferReceiver") | ||
var transferReceiver = "" | ||
|
||
@JsonProperty("Interval") | ||
var interval = 0 | ||
|
||
@JsonProperty("RecallTimes") | ||
var recallTimes = 0 | ||
|
||
@JsonProperty("TextNotify.EnableWorkwxNotify") | ||
var workwxNotifyEnabled = false | ||
|
||
@JsonProperty("TextNotify.NotifyTitle") | ||
var workwxNotifyTitle = "" | ||
|
||
@JsonProperty("TextNotify.NotifyContent") | ||
var workwxNotifyContent = "" | ||
} |
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
77 changes: 77 additions & 0 deletions
77
.../ci/core/notify/api-notify/src/main/kotlin/com/tencent/devops/notify/pojo/VoiceMessage.kt
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,77 @@ | ||
package com.tencent.devops.notify.pojo | ||
|
||
import com.tencent.devops.common.notify.pojo.VoiceNotifyPost | ||
import io.swagger.annotations.ApiModel | ||
import io.swagger.annotations.ApiModelProperty | ||
|
||
@ApiModel("语音信息") | ||
open class VoiceMessage : BaseMessage() { | ||
@ApiModelProperty("接收人(英文ID),支持多个") | ||
var receivers = mutableSetOf<String>() | ||
|
||
@ApiModelProperty("任务名称,不超过200字符") | ||
var taskName = "" | ||
|
||
@ApiModelProperty("呼叫内容,建议只传简短的文字内容,详细信息通过企业微信提醒方式发送") | ||
var content = "" | ||
|
||
@ApiModelProperty("转接责任人(英文ID),单人") | ||
var transferReceiver = "" | ||
|
||
@ApiModelProperty("重呼间隔(秒),默认为0") | ||
var interval = 0 | ||
|
||
@ApiModelProperty("最大重呼次数,默认为0") | ||
var recallTime = 0 | ||
|
||
@ApiModelProperty("企业微信提醒") | ||
var textNotify = TextNotify.DEFAULT | ||
|
||
@ApiModel("语音信息--企业微信提醒") | ||
data class TextNotify( | ||
@ApiModelProperty("是否开启企业微信提醒") | ||
val enabled: Boolean = false, | ||
@ApiModelProperty("提醒Title") | ||
val title: String = "", | ||
@ApiModelProperty("提醒内容") | ||
val content: String = "" | ||
) { | ||
companion object { | ||
val DEFAULT = TextNotify(false, "", "") | ||
} | ||
} | ||
|
||
fun addAllReceivers(receiverSet: Set<String>) { | ||
receivers.addAll(receiverSet) | ||
} | ||
|
||
fun clearReceivers() { | ||
receivers.clear() | ||
} | ||
|
||
@Throws(IllegalArgumentException::class) | ||
fun asPost(): VoiceNotifyPost { | ||
checkParams() | ||
val post = VoiceNotifyPost() | ||
post.receiver = this.receivers.joinToString(",") | ||
post.taskName = this.taskName | ||
post.content = this.content | ||
post.transferReceiver = this.transferReceiver | ||
post.interval = this.interval | ||
post.recallTimes = this.recallTime | ||
post.workwxNotifyEnabled = this.textNotify.enabled | ||
post.workwxNotifyTitle = this.textNotify.title | ||
post.workwxNotifyContent = this.textNotify.content | ||
|
||
return post | ||
} | ||
|
||
private fun checkParams() { | ||
if (receivers.isEmpty()) { | ||
throw IllegalArgumentException("receiver can`t not empty") | ||
} | ||
if (taskName.length > 200) { | ||
throw IllegalArgumentException("the length of task name can`t be greater then 200") | ||
} | ||
} | ||
} |
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
14 changes: 14 additions & 0 deletions
14
...pi-notify/src/main/kotlin/com/tencent/devops/notify/pojo/messageTemplate/VoiceTemplate.kt
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,14 @@ | ||
package com.tencent.devops.notify.pojo.messageTemplate | ||
|
||
import io.swagger.annotations.ApiModel | ||
import io.swagger.annotations.ApiModelProperty | ||
|
||
@ApiModel("语音模板信息") | ||
data class VoiceTemplate( | ||
@ApiModelProperty("模板ID", required = true) | ||
val id: String, | ||
@ApiModelProperty("任务名称", required = false) | ||
var taskName: String, | ||
@ApiModelProperty("内容", required = true) | ||
var content: String | ||
) |
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
35 changes: 35 additions & 0 deletions
35
...fy/biz-notify/src/main/kotlin/com/tencent/devops/notify/blueking/sdk/pojo/SendVoiceReq.kt
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,35 @@ | ||
package com.tencent.devops.notify.blueking.sdk.pojo | ||
|
||
import io.swagger.annotations.ApiModel | ||
import io.swagger.annotations.ApiModelProperty | ||
|
||
@ApiModel("发送语音请求参数") | ||
data class SendVoiceReq( | ||
@ApiModelProperty("自动语音读字信息") | ||
var auto_read_message: String, | ||
@ApiModelProperty( | ||
"待通知的用户列表,自动语音通知列表,若user_list_information、receiver__username同时存在," + | ||
"以user_list_information为准" | ||
) | ||
var user_list_information: Collection<String>? = null, | ||
@ApiModelProperty( | ||
"待通知的用户列表,包含用户名,用户需在蓝鲸平台注册,多个以逗号分隔," + | ||
"若user_list_information、receiver__username同时存在,以user_list_information为准" | ||
) | ||
var receiver__username: String? = null, | ||
|
||
override var bk_app_code: String? = "", | ||
override var bk_app_secret: String? = "", | ||
override var bk_token: String? = "", | ||
override var bk_username: String? = "" | ||
) : ApiReq( | ||
bk_app_code, bk_app_secret, bk_token, bk_username | ||
) { | ||
@ApiModel("用户信息") | ||
data class UserListInformation( | ||
@ApiModelProperty("被通知人") | ||
var username: String, | ||
@ApiModelProperty("被通知人手机号") | ||
var mobile_phone: String? = null | ||
) | ||
} |
51 changes: 0 additions & 51 deletions
51
...notify/src/main/kotlin/com/tencent/devops/notify/blueking/service/inner/OrgServiceImpl.kt
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.