Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-cloud
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
data-hook
gic-cloud
Commits
f305de11
Commit
f305de11
authored
Apr 27, 2023
by
fudahua
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix-2023-04' into 'developer'
feat: 删除文件 See merge request
!102
parents
39dd3ad1
71eb3f70
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletions
+18
-1
DingWarningUtil.java
...java/com/gic/cloud/data/hook/service/DingWarningUtil.java
+18
-1
No files found.
gic-cloud-data-hook-service/src/main/java/com/gic/cloud/data/hook/service/DingWarningUtil.java
View file @
f305de11
...
...
@@ -5,9 +5,16 @@ import com.ctrip.framework.apollo.ConfigService;
import
com.gic.commons.util.DingtalkMessageUtil
;
import
com.gic.commons.util.TraceIdUtil
;
import
com.gic.dubbo.entity.ProviderLocalTag
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.stream.Collectors
;
public
class
DingWarningUtil
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
DingWarningUtil
.
class
);
private
static
final
String
dingdingurl
=
"https://oapi.dingtalk.com/robot/send?access_token=1d6a0756fcfe5f215e3ed37d7e60960635d0009f71b476f3b402e7671fc2a8ca"
;
...
...
@@ -16,11 +23,21 @@ public class DingWarningUtil {
public
static
void
sendCountWarning
(
String
msg
)
{
Config
appConfig
=
ConfigService
.
getAppConfig
();
String
url
=
appConfig
.
getProperty
(
"ding.url"
,
dingdingurl
);
String
mobile
=
appConfig
.
getProperty
(
"ding.mobile"
,
null
);
ProviderLocalTag
localTag
=
ProviderLocalTag
.
tag
.
get
();
String
traceId
=
localTag
.
traceId
;
try
{
msg
=
msg
+
": "
+
traceId
;
DingtalkMessageUtil
.
sendAlertMessage
(
msg
,
url
);
List
<
String
>
mobiles
=
new
ArrayList
<>();
if
(
StringUtils
.
isNotBlank
(
mobile
))
{
String
[]
split
=
mobile
.
split
(
","
);
mobiles
=
Arrays
.
stream
(
split
).
collect
(
Collectors
.
toList
());
}
if
(
CollectionUtils
.
isEmpty
(
mobiles
))
{
DingtalkMessageUtil
.
sendAlertMessage
(
msg
,
url
);
}
else
{
DingtalkMessageUtil
.
sendAlertMessage
(
msg
,
url
,
mobiles
);
}
}
catch
(
Exception
e
)
{
logger
.
info
(
"异常:{}"
,
e
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment