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
bcbd853a
Commit
bcbd853a
authored
Dec 15, 2022
by
穆龙飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify:修改邮件发送逻辑
parent
32bd30ef
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
UasClientServiceImpl.java
.../integration/email/service/impl/UasClientServiceImpl.java
+12
-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 @
bcbd853a
...
...
@@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSON;
import
com.alibaba.fastjson.JSONObject
;
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.rpc.EncodeUtil
;
import
com.
sun.deploy.net.URLEncoder
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -13,6 +13,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.util.CollectionUtils
;
import
java.io.File
;
import
java.io.UnsupportedEncodingException
;
import
java.util.Collection
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
@@ -38,9 +39,16 @@ public class UasClientServiceImpl implements UasClientService {
params
.
put
(
"cc"
,
StringUtils
.
join
(
ccList
,
","
));
}
logger
.
info
(
JSONObject
.
toJSONString
(
"邮箱接口入参 subject={},content={},toList={},ccList={}"
),
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
);
String
appendStr
=
null
;
try
{
appendStr
=
"subject="
+
URLEncoder
.
encode
(
subject
,
"UTF-8"
)
+
"&to="
+
URLEncoder
.
encode
(
StringUtils
.
join
(
toList
,
","
),
"UTF-8"
)
+
"&cc="
+
URLEncoder
.
encode
(
params
.
get
(
"cc"
),
"UTF-8"
)
+
"&content="
+
URLEncoder
.
encode
(
content
,
"UTF-8"
);
}
catch
(
UnsupportedEncodingException
e
)
{
e
.
printStackTrace
();
}
String
res
=
service
.
sendEmail
(
appendStr
);
this
.
logger
.
info
(
"[op:sendEmail] res={} "
,
res
);
JSONObject
jsonObject
=
JSON
.
parseObject
(
res
);
if
(
jsonObject
.
getInteger
(
"code"
)
!=
200
)
{
...
...
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