Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
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
fangxinjiang
yifu-mvp
Commits
f49b1bed
Commit
f49b1bed
authored
Dec 05, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
批量办理调优
parent
1fdfdd9e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
6 deletions
+20
-6
MailController.java
...om/yifu/cloud/plus/v1/mail/controller/MailController.java
+7
-5
MailServiceImpl.java
...yifu/cloud/plus/v1/mail/service/impl/MailServiceImpl.java
+12
-0
application-dev.yml
...mail/yifu-mail-biz/src/main/resources/application-dev.yml
+1
-1
No files found.
yifu-mail/yifu-mail-biz/src/main/java/com/yifu/cloud/plus/v1/mail/controller/MailController.java
View file @
f49b1bed
...
@@ -18,8 +18,11 @@
...
@@ -18,8 +18,11 @@
package
com
.
yifu
.
cloud
.
plus
.
v1
.
mail
.
controller
;
package
com
.
yifu
.
cloud
.
plus
.
v1
.
mail
.
controller
;
import
com.yifu.cloud.plus.v1.mail.service.MailService
;
import
com.yifu.cloud.plus.v1.mail.service.MailService
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
...
@@ -41,11 +44,10 @@ public class MailController {
...
@@ -41,11 +44,10 @@ public class MailController {
* 邮件发送服务
* 邮件发送服务
* @return
* @return
*/
*/
/*
@Operation(summary = "分页查询", description = "分页查询")
@Operation
(
summary
=
"分页查询"
,
description
=
"分页查询"
)
@GetMapping("/
page
" )
@GetMapping
(
"/
sendMail
"
)
public R getTCheckMobilePage(
Page page, TCheckMobile tCheckMobile
) {
public
R
getTCheckMobilePage
()
{
return R.ok(
tCheckMobileService.page(page, Wrappers.query(tCheckMobile)
));
return
R
.
ok
(
mailService
.
sendMail
(
null
));
}
}
*/
}
}
yifu-mail/yifu-mail-biz/src/main/java/com/yifu/cloud/plus/v1/mail/service/impl/MailServiceImpl.java
View file @
f49b1bed
...
@@ -2,6 +2,9 @@ package com.yifu.cloud.plus.v1.mail.service.impl;
...
@@ -2,6 +2,9 @@ package com.yifu.cloud.plus.v1.mail.service.impl;
import
com.sun.xml.internal.ws.resources.SenderMessages
;
import
com.sun.xml.internal.ws.resources.SenderMessages
;
import
com.yifu.cloud.plus.v1.mail.service.MailService
;
import
com.yifu.cloud.plus.v1.mail.service.MailService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.mail.SimpleMailMessage
;
import
org.springframework.mail.javamail.JavaMailSender
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
/**
/**
...
@@ -11,9 +14,18 @@ import org.springframework.stereotype.Service;
...
@@ -11,9 +14,18 @@ import org.springframework.stereotype.Service;
**/
**/
@Service
(
"mailService"
)
@Service
(
"mailService"
)
public
class
MailServiceImpl
implements
MailService
{
public
class
MailServiceImpl
implements
MailService
{
@Autowired
private
JavaMailSender
mailSender
;
@Override
@Override
public
Boolean
sendMail
(
SenderMessages
messages
)
{
public
Boolean
sendMail
(
SenderMessages
messages
)
{
SimpleMailMessage
mailMessage
=
new
SimpleMailMessage
();
mailMessage
.
setFrom
(
"fangxinjiang@wanxin-holdings.com"
);
mailMessage
.
setTo
(
"fangxinjiang@wanxin-holdings.com"
);
mailMessage
.
setText
(
"你好 hello world"
);
mailMessage
.
setSubject
(
"测试Spring邮箱服务"
);
mailSender
.
send
(
mailMessage
);
System
.
out
.
println
(
"====完成发送!===="
);
return
null
;
return
null
;
}
}
}
}
yifu-mail/yifu-mail-biz/src/main/resources/application-dev.yml
View file @
f49b1bed
...
@@ -10,7 +10,7 @@ spring:
...
@@ -10,7 +10,7 @@ spring:
host
:
127.0.0.1
host
:
127.0.0.1
password
:
'
@yf_2017'
password
:
'
@yf_2017'
mail
:
mail
:
host
:
smtp.
exmail.qq
.com
host
:
smtp.
wanxin-holdings
.com
port
:
465
port
:
465
username
:
information@wanxin-holdings.com
username
:
information@wanxin-holdings.com
password
:
QmdCaQSPmCAQEddd
password
:
QmdCaQSPmCAQEddd
...
...
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