Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yanxuan-qc-change-system
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
胡园园
yanxuan-qc-change-system
Commits
32bd30ef
Commit
32bd30ef
authored
Dec 15, 2022
by
穆龙飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify:修改邮件发送逻辑
parent
813e3c2c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
UasClientServiceImpl.java
.../integration/email/service/impl/UasClientServiceImpl.java
+7
-3
EmailRpcService.java
...anxuan/change/integration/flow/email/EmailRpcService.java
+2
-4
No files found.
yanxuan-qc-change-system-integration/src/main/java/com/netease/mail/yanxuan/change/integration/email/service/impl/UasClientServiceImpl.java
View file @
32bd30ef
...
@@ -4,12 +4,14 @@ import com.alibaba.fastjson.JSON;
...
@@ -4,12 +4,14 @@ import com.alibaba.fastjson.JSON;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.netease.mail.yanxuan.change.integration.email.service.UasClientService
;
import
com.netease.mail.yanxuan.change.integration.email.service.UasClientService
;
import
com.netease.mail.yanxuan.change.integration.flow.email.EmailRpcService
;
import
com.netease.mail.yanxuan.change.integration.flow.email.EmailRpcService
;
import
com.netease.mail.yanxuan.change.integration.rpc.EncodeUtil
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
java.io.File
;
import
java.io.File
;
import
java.util.Collection
;
import
java.util.Collection
;
import
java.util.HashMap
;
import
java.util.HashMap
;
...
@@ -35,12 +37,14 @@ public class UasClientServiceImpl implements UasClientService {
...
@@ -35,12 +37,14 @@ public class UasClientServiceImpl implements UasClientService {
if
(!
CollectionUtils
.
isEmpty
(
ccList
))
{
if
(!
CollectionUtils
.
isEmpty
(
ccList
))
{
params
.
put
(
"cc"
,
StringUtils
.
join
(
ccList
,
","
));
params
.
put
(
"cc"
,
StringUtils
.
join
(
ccList
,
","
));
}
}
logger
.
info
(
JSONObject
.
toJSONString
(
"邮箱接口入参 subject={},content={},toList={},ccList={}"
),
subject
,
content
,
StringUtils
.
join
(
toList
,
","
),
params
.
get
(
"cc"
));
logger
.
info
(
JSONObject
.
toJSONString
(
"邮箱接口入参 subject={},content={},toList={},ccList={}"
),
subject
,
content
,
StringUtils
.
join
(
toList
,
","
),
params
.
get
(
"cc"
));
String
res
=
service
.
sendEmail
(
subject
,
content
,
StringUtils
.
join
(
toList
,
","
),
params
.
get
(
"cc"
));
String
appendStr
=
"subject="
+
subject
+
"&to="
+
StringUtils
.
join
(
toList
,
","
)
+
"&cc="
+
params
.
get
(
"cc"
)
+
"&content="
+
content
;
String
encode
=
EncodeUtil
.
encode
(
appendStr
);
String
res
=
service
.
sendEmail
(
encode
);
this
.
logger
.
info
(
"[op:sendEmail] res={} "
,
res
);
this
.
logger
.
info
(
"[op:sendEmail] res={} "
,
res
);
JSONObject
jsonObject
=
JSON
.
parseObject
(
res
);
JSONObject
jsonObject
=
JSON
.
parseObject
(
res
);
if
(
jsonObject
.
getInteger
(
"code"
)
!=
200
)
{
if
(
jsonObject
.
getInteger
(
"code"
)
!=
200
)
{
this
.
logger
.
error
(
"SendEmail"
,
(
String
)
null
,
"send email failed, subject={},toList={},ccList={}"
,
new
Object
[]{
subject
,
JSON
.
toJSONString
(
toList
),
JSON
.
toJSONString
(
ccList
)});
this
.
logger
.
error
(
"SendEmail"
,
null
,
"send email failed, subject={},toList={},ccList={}"
,
new
Object
[]{
subject
,
JSON
.
toJSONString
(
toList
),
JSON
.
toJSONString
(
ccList
)});
}
}
}
}
}
}
...
...
yanxuan-qc-change-system-integration/src/main/java/com/netease/mail/yanxuan/change/integration/flow/email/EmailRpcService.java
View file @
32bd30ef
...
@@ -3,6 +3,7 @@ package com.netease.mail.yanxuan.change.integration.flow.email;
...
@@ -3,6 +3,7 @@ package com.netease.mail.yanxuan.change.integration.flow.email;
import
com.netease.yanxuan.missa.client.annotation.MissaClient
;
import
com.netease.yanxuan.missa.client.annotation.MissaClient
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -19,9 +20,6 @@ public interface EmailRpcService {
...
@@ -19,9 +20,6 @@ public interface EmailRpcService {
@PostMapping
(
"/push/email/qc"
)
@PostMapping
(
"/push/email/qc"
)
String
sendEmail
(
@RequestParam
(
name
=
"subject"
)
String
subject
,
String
sendEmail
(
@RequestBody
String
str
);
@RequestParam
(
name
=
"content"
)
String
content
,
@RequestParam
(
name
=
"to"
)
String
to
,
@RequestParam
(
name
=
"cc"
,
required
=
false
)
String
cc
);
}
}
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