邮件发送功能
This commit is contained in:
parent
082c209c87
commit
1a120cd07c
@ -1,13 +1,18 @@
|
|||||||
package cn.iocoder.yudao.module.system.controller.admin.mail.vo.send;
|
package cn.iocoder.yudao.module.system.controller.admin.mail.vo.send;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ApiModel("管理后台 - 邮件发送 Req VO")
|
||||||
@Data
|
@Data
|
||||||
public class MailSendVO { // TODO @wangjingyi:1)参数校验;2)ReqVO
|
public class MailReqVO { // TODO @wangjingyi:1)参数校验;2)ReqVO
|
||||||
|
|
||||||
@ApiModelProperty(value = "邮箱" , required = true , example = "yudaoyuanma@123.com")
|
@ApiModelProperty(value = "邮箱" , required = true , example = "yudaoyuanma@123.com")
|
||||||
|
@NotNull(message = "邮箱账号不能为空")
|
||||||
private String from;
|
private String from;
|
||||||
|
|
||||||
@ApiModelProperty(value = "标题" , example = "标题")
|
@ApiModelProperty(value = "标题" , example = "标题")
|
||||||
@ -16,7 +21,12 @@ public class MailSendVO { // TODO @wangjingyi:1)参数校验;2)ReqVO
|
|||||||
@ApiModelProperty(value = "内容" , example = "内容")
|
@ApiModelProperty(value = "内容" , example = "内容")
|
||||||
private String content;
|
private String content;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "邮箱模版id" , example = "1024")
|
||||||
|
@NotNull(message = "邮箱模版id不能为空")
|
||||||
|
private Integer templateId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "收件人" , required = true , example = "yudaoyuanma@123.com")
|
@ApiModelProperty(value = "收件人" , required = true , example = "yudaoyuanma@123.com")
|
||||||
|
@NotNull(message = "收件人不能为空")
|
||||||
private List<String> tos;
|
private List<String> tos;
|
||||||
|
|
||||||
@ApiModelProperty(value = "附件" , example = "附件编码")
|
@ApiModelProperty(value = "附件" , example = "附件编码")
|
@ -7,7 +7,9 @@ import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailAccountDO;
|
|||||||
import org.mapstruct.Mapper;
|
import org.mapstruct.Mapper;
|
||||||
import org.mapstruct.factory.Mappers;
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface MailAccountConvert {
|
public interface MailAccountConvert {
|
||||||
@ -31,4 +33,13 @@ public interface MailAccountConvert {
|
|||||||
.setPass(mailAccountDO.getPassword())
|
.setPass(mailAccountDO.getPassword())
|
||||||
.setSslEnable(mailAccountDO.getSslEnable());
|
.setSslEnable(mailAccountDO.getSslEnable());
|
||||||
};
|
};
|
||||||
|
|
||||||
|
default Map<String, String> convertToMap(MailAccountDO mailAccountDO , String content) {
|
||||||
|
Map<String , String> map = new HashMap<>();
|
||||||
|
map.put("from" , mailAccountDO.getFrom());
|
||||||
|
map.put("username" , mailAccountDO.getUsername());
|
||||||
|
map.put("content" , content);
|
||||||
|
return map;
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user