diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/SystemMailAccountController.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/SystemMailAccountController.java new file mode 100644 index 000000000..d6ba85dcd --- /dev/null +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/SystemMailAccountController.java @@ -0,0 +1,95 @@ +package cn.iocoder.yudao.module.system.controller.admin.mail; + + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.account.SystemMailAccountBaseVO; +import cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel.SmsChannelCreateReqVO; +import cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel.SmsChannelPageReqVO; +import cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel.SmsChannelRespVO; +import cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel.SmsChannelSimpleRespVO; +import cn.iocoder.yudao.module.system.convert.mail.SystemMailAccountConvert; +import cn.iocoder.yudao.module.system.convert.sms.SmsChannelConvert; +import cn.iocoder.yudao.module.system.dal.dataobject.mail.SystemMailAccountDO; +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsChannelDO; +import cn.iocoder.yudao.module.system.service.mail.SystemMailAccountService; +import cn.iocoder.yudao.module.system.service.sms.SmsChannelService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; + +import java.util.Comparator; +import java.util.List; + +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +/** + *
+ * 前端控制器 + *
+ * + * @author wangjingyi + * @since 2022-03-21 + */ +@Api(tags = "管理后台 - 邮件模板") +@RestController +@RequestMapping("/system-mail-account") +public class SystemMailAccountController { + @Resource + private SystemMailAccountService systemMailAccountService; + + @PostMapping("/create") + @ApiOperation("创建邮箱账号") + @PreAuthorize("@ss.hasPermission('system:system-mail-account:create')") + public CommonResult+ * 前端控制器 + *
+ * + * @author wangjingyi + * @since 2022-03-21 + */ +@RestController +@RequestMapping("/system-mail-log") +public class SystemMailLogController { + +} diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/SystemMailTempleController.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/SystemMailTempleController.java new file mode 100644 index 000000000..7b76958d1 --- /dev/null +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/SystemMailTempleController.java @@ -0,0 +1,20 @@ +package cn.iocoder.yudao.module.system.controller.admin.mail; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; + +/** + *+ * 前端控制器 + *
+ * + * @author wangjingyi + * @since 2022-03-21 + */ +@RestController +@RequestMapping("/system-mail-temple") +public class SystemMailTempleController { + +} diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/SystemMailAccountBaseVO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/SystemMailAccountBaseVO.java new file mode 100644 index 000000000..4f74da0c8 --- /dev/null +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/SystemMailAccountBaseVO.java @@ -0,0 +1,26 @@ +package cn.iocoder.yudao.module.system.controller.admin.mail.vo.account; + +import com.baomidou.mybatisplus.annotation.TableField; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +public class SystemMailAccountBaseVO { + @ApiModelProperty(value = "来源" , required = true , example = "yudaoyuanma") + private String from; + + @ApiModelProperty(value = "用户名" , required = true , example = "yudao") + private String username; + + @ApiModelProperty(value = "密码" , required = true , example = "123456") + private String password; + + @ApiModelProperty(value = "网站" , required = true , example = "www.iocoder.cn") + private String host; + + @ApiModelProperty(value = "端口" , required = true , example = "80") + private String port; + + @ApiModelProperty(value = "是否开启ssl" , required = true , example = "2") + private Integer sslEnable; +} diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/mail/SystemMailAccountConvert.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/mail/SystemMailAccountConvert.java new file mode 100644 index 000000000..465bff31f --- /dev/null +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/mail/SystemMailAccountConvert.java @@ -0,0 +1,25 @@ +package cn.iocoder.yudao.module.system.convert.mail; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.account.SystemMailAccountBaseVO; +import cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel.SmsChannelRespVO; +import cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel.SmsChannelSimpleRespVO; +import cn.iocoder.yudao.module.system.dal.dataobject.mail.SystemMailAccountDO; +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsChannelDO; +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; + +import java.util.List; + +@Mapper +public interface SystemMailAccountConvert { + SystemMailAccountConvert INSTANCE = Mappers.getMapper(SystemMailAccountConvert.class); + + SystemMailAccountDO convert (SystemMailAccountBaseVO systemMailAccountBaseVO); + + SystemMailAccountBaseVO convert (SystemMailAccountDO systemMailAccountDO); + + PageResult+ * + *
+ * + * @author wangjingyi + * @since 2022-03-21 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value="SystemMailAccount对象", description="") +@TableName(value = "system_mail_account", autoResultMap = true) +public class SystemMailAccountDO extends BaseDO implements Serializable { + + private static final long serialVersionUID = 1L; + @TableId + private Long id; + + @TableField("from") + private String from; + + @TableField("username") + private String username; + + @TableField("password") + private String password; + + @TableField("host") + private String host; + + @TableField("port") + private String port; + + @TableField("sslEnable") + private Integer sslEnable; + + +} diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/mail/SystemMailLogDO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/mail/SystemMailLogDO.java new file mode 100644 index 000000000..b909e0c37 --- /dev/null +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/mail/SystemMailLogDO.java @@ -0,0 +1,61 @@ +package cn.iocoder.yudao.module.system.dal.dataobject.mail; + +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; +import com.baomidou.mybatisplus.annotation.IdType; +import java.sql.Timestamp; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *+ * + *
+ * + * @author wangjingyi + * @since 2022-03-21 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value="SystemMailLog对象", description="") +public class SystemMailLogDO extends BaseDO implements Serializable { + + private static final long serialVersionUID = 1L; + @TableId + private Long id; + + @TableField("account_code") + private String accountCode; + + @TableField("from") + private String from; + + @TableField("temple_code") + private String templeCode; + + @TableField("title") + private String title; + + @TableField("content") + private String content; + + @TableField("to") + private String to; + + @TableField("sendTime") + private Timestamp sendTime; + + @TableField("sendStatus") + private String sendStatus; + + @TableField("sendResult") + private String sendResult; + + +} diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/mail/SystemMailTempleDO.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/mail/SystemMailTempleDO.java new file mode 100644 index 000000000..3a13d1b4b --- /dev/null +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/mail/SystemMailTempleDO.java @@ -0,0 +1,54 @@ +package cn.iocoder.yudao.module.system.dal.dataobject.mail; + +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableField; +import java.io.Serializable; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + *+ * + *
+ * + * @author wangjingyi + * @since 2022-03-21 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value="SystemMailTemple对象", description="") +public class SystemMailTempleDO extends BaseDO implements Serializable { + + private static final long serialVersionUID = 1L; + @TableId + private Long id; + + @TableField("name") + private String name; + + @TableField("code") + private String code; + + @TableField("username") + private String username; + + @TableField("title") + private String title; + + @TableField("content") + private String content; + + @TableField("status") + private String status; + + @TableField("remark") + private String remark; + + +} diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/mail/SystemMailAccountMapper.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/mail/SystemMailAccountMapper.java new file mode 100644 index 000000000..576c23bdd --- /dev/null +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/mail/SystemMailAccountMapper.java @@ -0,0 +1,28 @@ +package cn.iocoder.yudao.module.system.dal.mysql.mail; + +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; +import cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel.SmsChannelPageReqVO; +import cn.iocoder.yudao.module.system.dal.dataobject.mail.SystemMailAccountDO; +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsChannelDO; +import org.apache.ibatis.annotations.Mapper; + + +/** + *+ * Mapper 接口 + *
+ * + * @author wangjingyi + * @since 2022-03-21 + */ +@Mapper +public interface SystemMailAccountMapper extends BaseMapperX+ * Mapper 接口 + *
+ * + * @author wangjingyi + * @since 2022-03-21 + */ +public interface SystemMailLogMapper extends BaseMapper+ * Mapper 接口 + *
+ * + * @author wangjingyi + * @since 2022-03-21 + */ +public interface SystemMailTempleMapper extends BaseMapper+ * 服务类 + *
+ * + * @author wangjingyi + * @since 2022-03-21 + */ +public interface SystemMailAccountService { + + Long create(SystemMailAccountBaseVO baseVO); + + String update(SystemMailAccountBaseVO baseVO); + + String delete(SystemMailAccountBaseVO baseVO); + + SystemMailAccountDO getMailAccount(Long id); + + PageResult+ * 服务类 + *
+ * + * @author wangjingyi + * @since 2022-03-21 + */ +public interface SystemMailLogService { + +} diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/mail/SystemMailTempleService.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/mail/SystemMailTempleService.java new file mode 100644 index 000000000..507b64b9a --- /dev/null +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/mail/SystemMailTempleService.java @@ -0,0 +1,13 @@ +package cn.iocoder.yudao.module.system.service.mail; + +/** + *+ * 服务类 + *
+ * + * @author wangjingyi + * @since 2022-03-21 + */ +public interface SystemMailTempleService { + +} diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/mail/impl/SystemMailAccountServiceImpl.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/mail/impl/SystemMailAccountServiceImpl.java new file mode 100644 index 000000000..b50ca35b5 --- /dev/null +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/mail/impl/SystemMailAccountServiceImpl.java @@ -0,0 +1,63 @@ +package cn.iocoder.yudao.module.system.service.mail.impl; + +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.account.SystemMailAccountBaseVO; +import cn.iocoder.yudao.module.system.convert.mail.SystemMailAccountConvert; +import cn.iocoder.yudao.module.system.dal.dataobject.mail.SystemMailAccountDO; +import cn.iocoder.yudao.module.system.dal.mysql.mail.SystemMailAccountMapper; +import cn.iocoder.yudao.module.system.service.mail.SystemMailAccountService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +/** + *+ * 服务实现类 + *
+ * + * @author wangjingyi + * @since 2022-03-21 + */ +@Service +public class SystemMailAccountServiceImpl implements SystemMailAccountService { + @Resource + SystemMailAccountMapper systemMailAccountMapper; + @Override + public Long create(SystemMailAccountBaseVO baseVO) { + SystemMailAccountDO systemMailAccountDO = SystemMailAccountConvert.INSTANCE.convert(baseVO); + systemMailAccountMapper.insert(systemMailAccountDO); + return systemMailAccountDO.getId(); + } + + @Override + public String update(SystemMailAccountBaseVO baseVO) { + SystemMailAccountDO systemMailAccountDO = SystemMailAccountConvert.INSTANCE.convert(baseVO); + systemMailAccountMapper.updateById(systemMailAccountDO); + return null; + } + + @Override + public String delete(SystemMailAccountBaseVO baseVO) { + SystemMailAccountDO systemMailAccountDO = SystemMailAccountConvert.INSTANCE.convert(baseVO); + systemMailAccountMapper.deleteById(systemMailAccountDO); + return null; + } + + @Override + public SystemMailAccountDO getMailAccount(Long id) { + return systemMailAccountMapper.selectById(id); + } + + @Override + public PageResult+ * 服务实现类 + *
+ * + * @author wangjingyi + * @since 2022-03-21 + */ +@Service +public class SystemMailLogServiceImpl implements SystemMailLogService { + +} diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/mail/impl/SystemMailTempleServiceImpl.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/mail/impl/SystemMailTempleServiceImpl.java new file mode 100644 index 000000000..e59cb01ba --- /dev/null +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/mail/impl/SystemMailTempleServiceImpl.java @@ -0,0 +1,18 @@ +package cn.iocoder.yudao.module.system.service.mail.impl; + + +import cn.iocoder.yudao.module.system.service.mail.SystemMailTempleService; +import org.springframework.stereotype.Service; + +/** + *+ * 服务实现类 + *
+ * + * @author wangjingyi + * @since 2022-03-21 + */ +@Service +public class SystemMailTempleServiceImpl implements SystemMailTempleService { + +}