|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.dev33.satoken.annotation.SaIgnore; |
|
|
import cn.dev33.satoken.annotation.SaIgnore; |
|
|
import com.ruoyi.system.service.ZsEmailService; |
|
|
import com.ruoyi.system.service.ZsEmailService; |
|
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.web.bind.annotation.GetMapping; |
|
|
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.RequestParam; |
|
|
import org.springframework.web.bind.annotation.RequestParam; |
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
|
|
|
|
|
|
|
|
@Slf4j |
|
|
@RestController |
|
|
@RestController |
|
|
@RequestMapping("/system/zsEmail") |
|
|
@RequestMapping("/system/zsEmail") |
|
|
public class ZsEmailController { |
|
|
public class ZsEmailController { |
|
|
|
|
|
|
|
|
*/ |
|
|
*/ |
|
|
@SaIgnore |
|
|
@SaIgnore |
|
|
@GetMapping("/sendEmailWeb") |
|
|
@GetMapping("/sendEmailWeb") |
|
|
public void sendEmailWeb(@RequestParam("receiveEmail") String receiveEmail, |
|
|
|
|
|
|
|
|
public boolean sendEmailWeb(@RequestParam("receiveEmail") String receiveEmail, |
|
|
@RequestParam("title")String title, |
|
|
@RequestParam("title")String title, |
|
|
@RequestParam("context")String context) { |
|
|
@RequestParam("context")String context) { |
|
|
//发送邮件 |
|
|
//发送邮件 |
|
|
emailService.sendEmail(receiveEmail,title,context); |
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
return emailService.sendEmail(receiveEmail,title,context); |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
log.error("邮件发送接口失败!",e); |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |