Commit 79a0de08 by huluobin

bug fix

parent c34f9e97
...@@ -7,6 +7,7 @@ import org.springframework.core.io.FileSystemResource; ...@@ -7,6 +7,7 @@ import org.springframework.core.io.FileSystemResource;
import org.springframework.mail.SimpleMailMessage; import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender; import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.mail.javamail.MimeMessageHelper; import org.springframework.mail.javamail.MimeMessageHelper;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -31,6 +32,8 @@ public class MailServiceImpl implements MailService { ...@@ -31,6 +32,8 @@ public class MailServiceImpl implements MailService {
* @param subject * @param subject
* @param content * @param content
*/ */
@Override
@Async
public void sendSimpleMail(String to, String subject, String content) { public void sendSimpleMail(String to, String subject, String content) {
SimpleMailMessage message = new SimpleMailMessage(); SimpleMailMessage message = new SimpleMailMessage();
message.setFrom(from); message.setFrom(from);
...@@ -53,6 +56,8 @@ public class MailServiceImpl implements MailService { ...@@ -53,6 +56,8 @@ public class MailServiceImpl implements MailService {
* @param subject * @param subject
* @param content * @param content
*/ */
@Override
@Async
public void sendHtmlMail(String to, String subject, String content) { public void sendHtmlMail(String to, String subject, String content) {
MimeMessage message = sender.createMimeMessage(); MimeMessage message = sender.createMimeMessage();
...@@ -79,6 +84,8 @@ public class MailServiceImpl implements MailService { ...@@ -79,6 +84,8 @@ public class MailServiceImpl implements MailService {
* @param content * @param content
* @param filePath * @param filePath
*/ */
@Override
@Async
public void sendAttachmentsMail(String to, String subject, String content, String filePath) { public void sendAttachmentsMail(String to, String subject, String content, String filePath) {
MimeMessage message = sender.createMimeMessage(); MimeMessage message = sender.createMimeMessage();
...@@ -110,6 +117,8 @@ public class MailServiceImpl implements MailService { ...@@ -110,6 +117,8 @@ public class MailServiceImpl implements MailService {
* @param rscPath 静态资源路径和文件名 * @param rscPath 静态资源路径和文件名
* @param rscId 静态资源id * @param rscId 静态资源id
*/ */
@Override
@Async
public void sendInlineResourceMail(String to, String subject, String content, String rscPath, String rscId) { public void sendInlineResourceMail(String to, String subject, String content, String rscPath, String rscId) {
MimeMessage message = sender.createMimeMessage(); MimeMessage message = sender.createMimeMessage();
......
...@@ -58,13 +58,13 @@ spring: ...@@ -58,13 +58,13 @@ spring:
host: smtp.qq.com host: smtp.qq.com
username: robbendev@qq.com username: robbendev@qq.com
password: hccmfwhgcrnccagh password: hccmfwhgcrnccagh
properties: # properties:
mail: # mail:
smtp: # smtp:
auth: true # auth: true
starttls: # starttls:
enable: true # enable: true
required: true # required: true
#项目属性 #项目属性
gogirl: gogirl:
......
...@@ -59,13 +59,13 @@ spring: ...@@ -59,13 +59,13 @@ spring:
host: smtp.qq.com host: smtp.qq.com
username: robbendev@qq.com username: robbendev@qq.com
password: hccmfwhgcrnccagh password: hccmfwhgcrnccagh
properties: # properties:
mail: # mail:
smtp: # smtp:
auth: true # auth: true
starttls: # starttls:
enable: true # enable: true
required: true # required: true
#项目属性 #项目属性
gogirl: gogirl:
...@@ -93,6 +93,7 @@ gogirl: ...@@ -93,6 +93,7 @@ gogirl:
test-paper-time: 1 test-paper-time: 1
#后台后端接口访问地址 #后台后端接口访问地址
admin-backend-url: http://test.admin.begogirls.com:7712/api/ReportTable/GetTechnicianPage admin-backend-url: http://test.admin.begogirls.com:7712/api/ReportTable/GetTechnicianPage
admin-backend-achievements-url: http://test.admin.begogirls.com:7712/api/salary/AchievementsPersonaResultPageApi admin-backend-achievements-url: http://test.admin.begogirls.com:7712/api/salary/AchievementsPersonaResultPageApi
wx: wx:
......
...@@ -44,13 +44,13 @@ spring: ...@@ -44,13 +44,13 @@ spring:
host: smtp.qq.com host: smtp.qq.com
username: robbendev@qq.com username: robbendev@qq.com
password: hccmfwhgcrnccagh password: hccmfwhgcrnccagh
properties: # properties:
mail: # mail:
smtp: # smtp:
auth: true # auth: true
starttls: # starttls:
enable: true # enable: true
required: true # required: true
#redis配置 #redis配置
redis: redis:
host: 127.0.0.1 host: 127.0.0.1
......
...@@ -58,13 +58,13 @@ spring: ...@@ -58,13 +58,13 @@ spring:
host: smtp.qq.com host: smtp.qq.com
username: robbendev@qq.com username: robbendev@qq.com
password: hccmfwhgcrnccagh password: hccmfwhgcrnccagh
properties: # properties:
mail: # mail:
smtp: # smtp:
auth: true # auth: true
starttls: # starttls:
enable: true # enable: true
required: true # required: true
#项目属性 #项目属性
gogirl: gogirl:
......
...@@ -26,7 +26,6 @@ import com.gogirl.domain.user.customer.CustomerBalanceRecord; ...@@ -26,7 +26,6 @@ import com.gogirl.domain.user.customer.CustomerBalanceRecord;
import com.gogirl.domain.xcx.GogirlToken; import com.gogirl.domain.xcx.GogirlToken;
import com.gogirl.domain.xcx.TimeNode; import com.gogirl.domain.xcx.TimeNode;
import com.gogirl.domain.xcx.WeekConfig; import com.gogirl.domain.xcx.WeekConfig;
import com.gogirl.infrastructure.common.exception.RRException;
import com.gogirl.infrastructure.common.util.JsonUtilByFsJson; import com.gogirl.infrastructure.common.util.JsonUtilByFsJson;
import com.gogirl.infrastructure.mapper.market.coupon.CouponCustomerRelevanceMapper; import com.gogirl.infrastructure.mapper.market.coupon.CouponCustomerRelevanceMapper;
import com.gogirl.infrastructure.mapper.market.discount.DiscountConfigMapper; import com.gogirl.infrastructure.mapper.market.discount.DiscountConfigMapper;
...@@ -45,11 +44,13 @@ import com.gogirl.infrastructure.mapper.user.customer.CustomerBalanceRecordMappe ...@@ -45,11 +44,13 @@ import com.gogirl.infrastructure.mapper.user.customer.CustomerBalanceRecordMappe
import com.gogirl.infrastructure.mapper.user.customer.CustomerMapper; import com.gogirl.infrastructure.mapper.user.customer.CustomerMapper;
import com.gogirl.infrastructure.mapper.xcx.TimeNodeMapper; import com.gogirl.infrastructure.mapper.xcx.TimeNodeMapper;
import com.gogirl.infrastructure.mapper.xcx.WeekConfigMapper; import com.gogirl.infrastructure.mapper.xcx.WeekConfigMapper;
import com.gogirl.infrastructure.service.mail.MailService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.assertj.core.util.Lists; import org.assertj.core.util.Lists;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.context.junit4.SpringRunner;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -64,6 +65,7 @@ import java.util.stream.Collectors; ...@@ -64,6 +65,7 @@ import java.util.stream.Collectors;
@RunWith(SpringRunner.class) @RunWith(SpringRunner.class)
@SpringBootTest @SpringBootTest
@Slf4j @Slf4j
@EnableAsync
public class Test { public class Test {
@Resource @Resource
...@@ -471,4 +473,12 @@ public class Test { ...@@ -471,4 +473,12 @@ public class Test {
customerBalanceRecordMapper.insert(customerBalanceRecord); customerBalanceRecordMapper.insert(customerBalanceRecord);
} }
} }
@Resource
MailService mailService;
@org.junit.Test
public void testMail() {
mailService.sendSimpleMail("robbendev@qq.com","pre","test");
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment