|
@@ -1,10 +1,13 @@
|
|
|
package com.llisoft.sms.controller.feign;
|
|
|
|
|
|
+import java.util.Objects;
|
|
|
+
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import com.llisoft.common.vo.MailSendVo;
|
|
|
import com.llisoft.sms.service.MailService;
|
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
@@ -21,8 +24,13 @@ public class FeignMailController {
|
|
|
|
|
|
@ApiOperation(value="发送邮件")
|
|
|
@PostMapping("/send")
|
|
|
- public void send(String subject, String text) {
|
|
|
- mailService.sendMail(subject, text);
|
|
|
+ public void send(MailSendVo mailSendVo) {
|
|
|
+ String[] emails = mailSendVo.getEmails();
|
|
|
+ if (Objects.isNull(emails) || emails.length<=0) { // 发送到默认系统管理员
|
|
|
+ mailService.sendMail(mailSendVo.getSubject(), mailSendVo.getText());
|
|
|
+ }else {
|
|
|
+ mailService.sendMail(mailSendVo.getSubject(), mailSendVo.getText(), emails);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|