package com.ruoyi.project.common.controller;

import com.ruoyi.common.utils.email.BaseEmailEntity;
import com.ruoyi.common.utils.email.EmailUtil;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/common/email")
public class EmailController {

    @Resource
    private EmailUtil emailUtil;

    @ApiOperation(value = "测试发送邮件")
    @PostMapping("/testSendEmail")
    public void testSendEmail(@RequestBody BaseEmailEntity baseEmailEntity) {
        emailUtil.sendMail(baseEmailEntity, true);
    }
    @ApiOperation(value = "测试发送邮件")
    @PostMapping("/testSendSimpleMail")
    public void testSendSimpleEmail(@RequestBody BaseEmailEntity baseEmailEntity) {
        emailUtil.sendSimpleMail(baseEmailEntity);
    }
}
