Commit 54ad304514ee4944be688dab7aa814167e1aa2aa
1 parent
50f7af00
邮箱账号管理 TODO意见修改
Showing
26 changed files
with
608 additions
and
561 deletions
yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/ErrorCodeConstants.java
| @@ -119,4 +119,9 @@ public interface ErrorCodeConstants { | @@ -119,4 +119,9 @@ public interface ErrorCodeConstants { | ||
| 119 | ErrorCode SOCIAL_USER_UNBIND_NOT_SELF = new ErrorCode(1002018001, "社交解绑失败,非当前用户绑定"); | 119 | ErrorCode SOCIAL_USER_UNBIND_NOT_SELF = new ErrorCode(1002018001, "社交解绑失败,非当前用户绑定"); |
| 120 | ErrorCode SOCIAL_USER_NOT_FOUND = new ErrorCode(1002018002, "社交授权失败,找不到对应的用户"); | 120 | ErrorCode SOCIAL_USER_NOT_FOUND = new ErrorCode(1002018002, "社交授权失败,找不到对应的用户"); |
| 121 | 121 | ||
| 122 | + // ========== 邮箱账号 1002019000 ========== | ||
| 123 | + ErrorCode MAIL_ACCOUNT_NOT_EXISTS = new ErrorCode(1002019000, "邮箱账号不存在"); | ||
| 124 | + ErrorCode MAIL_ACCOUNT_EXISTS = new ErrorCode(1002019000, "邮箱账号存在"); | ||
| 125 | + | ||
| 126 | + | ||
| 122 | } | 127 | } |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/MailAccountController.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.controller.admin.mail; | ||
| 2 | + | ||
| 3 | + | ||
| 4 | +import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||
| 5 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 6 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.account.MailAccountBaseVO; | ||
| 7 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.account.MailAccountCreateReqVO; | ||
| 8 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.account.MailAccountPageReqVO; | ||
| 9 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.account.MailAccountUpdateReqVO; | ||
| 10 | +import cn.iocoder.yudao.module.system.convert.mail.MailAccountConvert; | ||
| 11 | +import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailAccountDO; | ||
| 12 | +import cn.iocoder.yudao.module.system.service.mail.MailAccountService; | ||
| 13 | +import io.swagger.annotations.Api; | ||
| 14 | +import io.swagger.annotations.ApiImplicitParam; | ||
| 15 | +import io.swagger.annotations.ApiOperation; | ||
| 16 | +import org.springframework.security.access.prepost.PreAuthorize; | ||
| 17 | +import org.springframework.web.bind.annotation.*; | ||
| 18 | + | ||
| 19 | +import javax.annotation.Resource; | ||
| 20 | +import javax.validation.Valid; | ||
| 21 | +import java.util.Comparator; | ||
| 22 | +import java.util.List; | ||
| 23 | + | ||
| 24 | +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||
| 25 | + | ||
| 26 | + | ||
| 27 | +@Api(tags = "管理后台 - 邮件模板") | ||
| 28 | +@RestController | ||
| 29 | +@RequestMapping("/system/mail-account") | ||
| 30 | +public class MailAccountController { | ||
| 31 | + @Resource | ||
| 32 | + private MailAccountService mailAccountService; | ||
| 33 | + | ||
| 34 | + | ||
| 35 | + @PostMapping("/create") | ||
| 36 | + @ApiOperation("创建邮箱账号") | ||
| 37 | + @PreAuthorize("@ss.hasPermission('system:mail-account:create')") | ||
| 38 | + public CommonResult<Long> createMailAccount(@Valid @RequestBody MailAccountCreateReqVO createReqVO) { | ||
| 39 | + return success(mailAccountService.create(createReqVO)); | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | + @PutMapping("/update") | ||
| 43 | + @ApiOperation("修改邮箱账号") | ||
| 44 | + @PreAuthorize("@ss.hasPermission('system:mail-account:update')") | ||
| 45 | + public CommonResult<Boolean> updateMailAccount(@Valid @RequestBody MailAccountUpdateReqVO updateReqVO) { | ||
| 46 | + mailAccountService.update(updateReqVO); | ||
| 47 | + return success(true); | ||
| 48 | + } | ||
| 49 | + | ||
| 50 | + | ||
| 51 | + @DeleteMapping("/delete") | ||
| 52 | + @ApiOperation("删除邮箱账号") | ||
| 53 | + @PreAuthorize("@ss.hasPermission('system:mail-account:delete')") | ||
| 54 | + public CommonResult<Boolean> deleteMailAccount(@Valid @RequestBody Long id) { | ||
| 55 | + mailAccountService.delete(id); | ||
| 56 | + return success(true); | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + @GetMapping("/get") | ||
| 60 | + @ApiOperation("获得邮箱账号") | ||
| 61 | + @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) | ||
| 62 | + @PreAuthorize("@ss.hasPermission('system:mail-account:get')") | ||
| 63 | + public CommonResult<MailAccountBaseVO> getMailAccount(@RequestParam("id") Long id) { | ||
| 64 | + MailAccountDO mailAccountDO = mailAccountService.getMailAccount(id); | ||
| 65 | + return success(MailAccountConvert.INSTANCE.convert(mailAccountDO)); | ||
| 66 | + } | ||
| 67 | + | ||
| 68 | + | ||
| 69 | + @GetMapping("/page") | ||
| 70 | + @ApiOperation("获得邮箱账号分页") | ||
| 71 | + @PreAuthorize("@ss.hasPermission('system:mail-account:query')") | ||
| 72 | + public CommonResult<PageResult<MailAccountBaseVO>> getSmsChannelPage(@Valid MailAccountPageReqVO pageReqVO) { | ||
| 73 | + PageResult<MailAccountDO> pageResult = mailAccountService.getMailAccountPage(pageReqVO); | ||
| 74 | + return success(MailAccountConvert.INSTANCE.convertPage(pageResult)); | ||
| 75 | + } | ||
| 76 | + | ||
| 77 | + @GetMapping("/list-all-simple") | ||
| 78 | + @ApiOperation(value = "获得邮箱账号精简列表") | ||
| 79 | + public CommonResult<List<MailAccountBaseVO>> getSimpleSmsChannels() { | ||
| 80 | + List<MailAccountDO> list = mailAccountService.getMailAccountList(); | ||
| 81 | + // 排序后,返回给前端 | ||
| 82 | + list.sort(Comparator.comparing(MailAccountDO::getId)); | ||
| 83 | + return success(MailAccountConvert.INSTANCE.convertList02(list)); | ||
| 84 | + } | ||
| 85 | +} |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/SystemMailLogController.java renamed to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/MailLogController.java
| 1 | -package cn.iocoder.yudao.module.system.controller.admin.mail; | ||
| 2 | - | ||
| 3 | - | ||
| 4 | -import org.springframework.web.bind.annotation.RequestMapping; | ||
| 5 | - | ||
| 6 | -import org.springframework.web.bind.annotation.RestController; | ||
| 7 | - | ||
| 8 | -/** | ||
| 9 | - * <p> | ||
| 10 | - * 前端控制器 | ||
| 11 | - * </p> | ||
| 12 | - * | ||
| 13 | - * @author wangjingyi | ||
| 14 | - * @since 2022-03-21 | ||
| 15 | - */ | ||
| 16 | -@RestController | ||
| 17 | -@RequestMapping("/system-mail-log") | ||
| 18 | -public class SystemMailLogController { | ||
| 19 | - | ||
| 20 | -} | 1 | +package cn.iocoder.yudao.module.system.controller.admin.mail; |
| 2 | + | ||
| 3 | + | ||
| 4 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 5 | + | ||
| 6 | +import org.springframework.web.bind.annotation.RestController; | ||
| 7 | + | ||
| 8 | +/** | ||
| 9 | + * <p> | ||
| 10 | + * 前端控制器 | ||
| 11 | + * </p> | ||
| 12 | + * | ||
| 13 | + * @author wangjingyi | ||
| 14 | + * @since 2022-03-21 | ||
| 15 | + */ | ||
| 16 | +@RestController | ||
| 17 | +@RequestMapping("/system-mail-log") | ||
| 18 | +public class MailLogController { | ||
| 19 | + | ||
| 20 | +} |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/SystemMailTempleController.java renamed to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/MailTempleController.java
| 1 | -package cn.iocoder.yudao.module.system.controller.admin.mail; | ||
| 2 | - | ||
| 3 | - | ||
| 4 | -import org.springframework.web.bind.annotation.RequestMapping; | ||
| 5 | - | ||
| 6 | -import org.springframework.web.bind.annotation.RestController; | ||
| 7 | - | ||
| 8 | -/** | ||
| 9 | - * <p> | ||
| 10 | - * 前端控制器 | ||
| 11 | - * </p> | ||
| 12 | - * | ||
| 13 | - * @author wangjingyi | ||
| 14 | - * @since 2022-03-21 | ||
| 15 | - */ | ||
| 16 | -@RestController | ||
| 17 | -@RequestMapping("/system-mail-temple") | ||
| 18 | -public class SystemMailTempleController { | ||
| 19 | - | ||
| 20 | -} | 1 | +package cn.iocoder.yudao.module.system.controller.admin.mail; |
| 2 | + | ||
| 3 | + | ||
| 4 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 5 | + | ||
| 6 | +import org.springframework.web.bind.annotation.RestController; | ||
| 7 | + | ||
| 8 | +/** | ||
| 9 | + * <p> | ||
| 10 | + * 前端控制器 | ||
| 11 | + * </p> | ||
| 12 | + * | ||
| 13 | + * @author wangjingyi | ||
| 14 | + * @since 2022-03-21 | ||
| 15 | + */ | ||
| 16 | +@RestController | ||
| 17 | +@RequestMapping("/system-mail-temple") | ||
| 18 | +public class MailTempleController { | ||
| 19 | + | ||
| 20 | +} |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/SystemMailAccountController.java deleted
| 1 | -package cn.iocoder.yudao.module.system.controller.admin.mail; | ||
| 2 | - | ||
| 3 | - | ||
| 4 | -import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||
| 5 | -import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||
| 6 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 7 | -import cn.iocoder.yudao.module.system.controller.admin.mail.vo.account.SystemMailAccountBaseVO; | ||
| 8 | -import cn.iocoder.yudao.module.system.convert.mail.SystemMailAccountConvert; | ||
| 9 | -import cn.iocoder.yudao.module.system.dal.dataobject.mail.SystemMailAccountDO; | ||
| 10 | -import cn.iocoder.yudao.module.system.service.mail.SystemMailAccountService; | ||
| 11 | -import io.swagger.annotations.Api; | ||
| 12 | -import io.swagger.annotations.ApiImplicitParam; | ||
| 13 | -import io.swagger.annotations.ApiOperation; | ||
| 14 | -import org.springframework.security.access.prepost.PreAuthorize; | ||
| 15 | -import org.springframework.web.bind.annotation.*; | ||
| 16 | - | ||
| 17 | -import javax.annotation.Resource; | ||
| 18 | -import javax.validation.Valid; | ||
| 19 | -import java.util.Comparator; | ||
| 20 | -import java.util.List; | ||
| 21 | - | ||
| 22 | -import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||
| 23 | - | ||
| 24 | -// TODO @ジョイイ:使用 Swagger 注解,不用写这个注释啦 | ||
| 25 | -/** | ||
| 26 | - * <p> | ||
| 27 | - * 前端控制器 | ||
| 28 | - * </p> | ||
| 29 | - * | ||
| 30 | - * @author wangjingyi | ||
| 31 | - * @since 2022-03-21 | ||
| 32 | - */ | ||
| 33 | -@Api(tags = "管理后台 - 邮件模板") | ||
| 34 | -@RestController | ||
| 35 | -@RequestMapping("/system-mail-account") // TODO @ジョイイ:/system/mail-account | ||
| 36 | -public class SystemMailAccountController { | ||
| 37 | - @Resource | ||
| 38 | - private SystemMailAccountService systemMailAccountService; | ||
| 39 | - | ||
| 40 | - // TODO @ジョイイ:最好,VO 分拆下,参考下别的模块 | ||
| 41 | - | ||
| 42 | - @PostMapping("/create") | ||
| 43 | - @ApiOperation("创建邮箱账号") | ||
| 44 | - @PreAuthorize("@ss.hasPermission('system:system-mail-account:create')") | ||
| 45 | - public CommonResult<Long> createMailAccount(@Valid @RequestBody SystemMailAccountBaseVO baseVO) { | ||
| 46 | - return success(systemMailAccountService.create(baseVO)); | ||
| 47 | - } | ||
| 48 | - | ||
| 49 | - @PutMapping("/update") | ||
| 50 | - @ApiOperation("修改邮箱账号") | ||
| 51 | - @PreAuthorize("@ss.hasPermission('system:system-mail-account:update')") | ||
| 52 | - public CommonResult<Boolean> updateMailAccount(@Valid @RequestBody SystemMailAccountBaseVO baseVO) { | ||
| 53 | - systemMailAccountService.update(baseVO); | ||
| 54 | - return success(true); | ||
| 55 | - } | ||
| 56 | - | ||
| 57 | - // TODO @ジョイイ:删除,编号即可 | ||
| 58 | - | ||
| 59 | - @DeleteMapping("/delete") | ||
| 60 | - @ApiOperation("删除邮箱账号") | ||
| 61 | - @PreAuthorize("@ss.hasPermission('system:system-mail-account:delete')") | ||
| 62 | - public CommonResult<Boolean> deleteMailAccount(@Valid @RequestBody SystemMailAccountBaseVO baseVO) { | ||
| 63 | - systemMailAccountService.delete(baseVO); | ||
| 64 | - return success(true); | ||
| 65 | - } | ||
| 66 | - | ||
| 67 | - @GetMapping("/get") | ||
| 68 | - @ApiOperation("获得邮箱账号") | ||
| 69 | - @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) | ||
| 70 | - @PreAuthorize("@ss.hasPermission('system:system-mail-account:get')") | ||
| 71 | - public CommonResult<SystemMailAccountBaseVO> getMailAccount(@RequestParam("id") Long id) { | ||
| 72 | - SystemMailAccountDO systemMailAccountDO = systemMailAccountService.getMailAccount(id); | ||
| 73 | - return success(SystemMailAccountConvert.INSTANCE.convert(systemMailAccountDO)); | ||
| 74 | - } | ||
| 75 | - | ||
| 76 | - // TODO @ジョイイ:分页的查询条件 | ||
| 77 | - | ||
| 78 | - @GetMapping("/page") | ||
| 79 | - @ApiOperation("获得邮箱账号分页") | ||
| 80 | - @PreAuthorize("@ss.hasPermission('system:system-mail-account:query')") | ||
| 81 | - public CommonResult<PageResult<SystemMailAccountBaseVO>> getSmsChannelPage(@Valid PageParam pageParam) { | ||
| 82 | - PageResult<SystemMailAccountDO> pageResult = systemMailAccountService.getMailAccountPage(pageParam); | ||
| 83 | - return success(SystemMailAccountConvert.INSTANCE.convertPage(pageResult)); | ||
| 84 | - } | ||
| 85 | - | ||
| 86 | - @GetMapping("/list-all-simple") | ||
| 87 | - @ApiOperation(value = "获得邮箱账号精简列表") | ||
| 88 | - public CommonResult<List<SystemMailAccountBaseVO>> getSimpleSmsChannels() { | ||
| 89 | - List<SystemMailAccountDO> list = systemMailAccountService.getMailAccountList(); | ||
| 90 | - // 排序后,返回给前端 | ||
| 91 | - list.sort(Comparator.comparing(SystemMailAccountDO::getId)); | ||
| 92 | - return success(SystemMailAccountConvert.INSTANCE.convertList02(list)); | ||
| 93 | - } | ||
| 94 | -} |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/SystemMailAccountBaseVO.java renamed to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountBaseVO.java
| @@ -3,12 +3,10 @@ package cn.iocoder.yudao.module.system.controller.admin.mail.vo.account; | @@ -3,12 +3,10 @@ package cn.iocoder.yudao.module.system.controller.admin.mail.vo.account; | ||
| 3 | import io.swagger.annotations.ApiModelProperty; | 3 | import io.swagger.annotations.ApiModelProperty; |
| 4 | import lombok.Data; | 4 | import lombok.Data; |
| 5 | 5 | ||
| 6 | -// TODO @ジョイイ:System 去掉哈 | ||
| 7 | @Data | 6 | @Data |
| 8 | -public class SystemMailAccountBaseVO { | 7 | +public class MailAccountBaseVO { |
| 9 | 8 | ||
| 10 | - // TODO @ジョイイ:example 写的不太对,这个应该是邮箱; | ||
| 11 | - @ApiModelProperty(value = "来源" , required = true , example = "yudaoyuanma") | 9 | + @ApiModelProperty(value = "邮箱" , required = true , example = "yudaoyuanma@123.com") |
| 12 | private String from; | 10 | private String from; |
| 13 | 11 | ||
| 14 | @ApiModelProperty(value = "用户名" , required = true , example = "yudao") | 12 | @ApiModelProperty(value = "用户名" , required = true , example = "yudao") |
| @@ -23,7 +21,6 @@ public class SystemMailAccountBaseVO { | @@ -23,7 +21,6 @@ public class SystemMailAccountBaseVO { | ||
| 23 | @ApiModelProperty(value = "端口" , required = true , example = "80") | 21 | @ApiModelProperty(value = "端口" , required = true , example = "80") |
| 24 | private String port; | 22 | private String port; |
| 25 | 23 | ||
| 26 | - // TODO @ジョイイ:Boolean | ||
| 27 | @ApiModelProperty(value = "是否开启ssl" , required = true , example = "2") | 24 | @ApiModelProperty(value = "是否开启ssl" , required = true , example = "2") |
| 28 | - private Integer sslEnable; | 25 | + private Boolean sslEnable; |
| 29 | } | 26 | } |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountCreateReqVO.java
0 → 100644
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountPageReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.controller.admin.mail.vo.account; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||
| 4 | +import io.swagger.annotations.ApiModelProperty; | ||
| 5 | +import lombok.Data; | ||
| 6 | + | ||
| 7 | +@Data | ||
| 8 | +public class MailAccountPageReqVO extends PageParam { | ||
| 9 | + @ApiModelProperty(value = "邮箱" , required = true , example = "yudaoyuanma@123.com") | ||
| 10 | + private String from; | ||
| 11 | + | ||
| 12 | + @ApiModelProperty(value = "用户名" , required = true , example = "yudao") | ||
| 13 | + private String username; | ||
| 14 | + | ||
| 15 | + @ApiModelProperty(value = "密码" , required = true , example = "123456") | ||
| 16 | + private String password; | ||
| 17 | + | ||
| 18 | + @ApiModelProperty(value = "网站" , required = true , example = "www.iocoder.cn") | ||
| 19 | + private String host; | ||
| 20 | + | ||
| 21 | + @ApiModelProperty(value = "端口" , required = true , example = "80") | ||
| 22 | + private String port; | ||
| 23 | + | ||
| 24 | + @ApiModelProperty(value = "是否开启ssl" , required = true , example = "2") | ||
| 25 | + private Boolean sslEnable; | ||
| 26 | +} |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountUpdateReqVO.java
0 → 100644
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/mail/MailAccountConvert.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.convert.mail; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 4 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.account.MailAccountBaseVO; | ||
| 5 | +import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailAccountDO; | ||
| 6 | +import org.mapstruct.Mapper; | ||
| 7 | +import org.mapstruct.factory.Mappers; | ||
| 8 | + | ||
| 9 | +import java.util.List; | ||
| 10 | + | ||
| 11 | +@Mapper | ||
| 12 | +public interface MailAccountConvert { | ||
| 13 | + MailAccountConvert INSTANCE = Mappers.getMapper(MailAccountConvert.class); | ||
| 14 | + | ||
| 15 | + MailAccountDO convert (MailAccountBaseVO mailAccountBaseVO); | ||
| 16 | + | ||
| 17 | + MailAccountBaseVO convert (MailAccountDO mailAccountDO); | ||
| 18 | + | ||
| 19 | + PageResult<MailAccountBaseVO> convertPage(PageResult<MailAccountDO> pageResult); | ||
| 20 | + | ||
| 21 | + List<MailAccountBaseVO> convertList02(List<MailAccountDO> list); | ||
| 22 | +} |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/convert/mail/SystemMailAccountConvert.java deleted
| 1 | -package cn.iocoder.yudao.module.system.convert.mail; | ||
| 2 | - | ||
| 3 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 4 | -import cn.iocoder.yudao.module.system.controller.admin.mail.vo.account.SystemMailAccountBaseVO; | ||
| 5 | -import cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel.SmsChannelRespVO; | ||
| 6 | -import cn.iocoder.yudao.module.system.controller.admin.sms.vo.channel.SmsChannelSimpleRespVO; | ||
| 7 | -import cn.iocoder.yudao.module.system.dal.dataobject.mail.SystemMailAccountDO; | ||
| 8 | -import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsChannelDO; | ||
| 9 | -import org.mapstruct.Mapper; | ||
| 10 | -import org.mapstruct.factory.Mappers; | ||
| 11 | - | ||
| 12 | -import java.util.List; | ||
| 13 | - | ||
| 14 | -@Mapper | ||
| 15 | -public interface SystemMailAccountConvert { | ||
| 16 | - SystemMailAccountConvert INSTANCE = Mappers.getMapper(SystemMailAccountConvert.class); | ||
| 17 | - | ||
| 18 | - SystemMailAccountDO convert (SystemMailAccountBaseVO systemMailAccountBaseVO); | ||
| 19 | - | ||
| 20 | - SystemMailAccountBaseVO convert (SystemMailAccountDO systemMailAccountDO); | ||
| 21 | - | ||
| 22 | - PageResult<SystemMailAccountBaseVO> convertPage(PageResult<SystemMailAccountDO> pageResult); | ||
| 23 | - | ||
| 24 | - List<SystemMailAccountBaseVO> convertList02(List<SystemMailAccountDO> list); | ||
| 25 | -} |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/mail/SystemMailAccountDO.java renamed to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/mail/MailAccountDO.java
| 1 | -package cn.iocoder.yudao.module.system.dal.dataobject.mail; | ||
| 2 | - | ||
| 3 | -import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||
| 4 | -import com.baomidou.mybatisplus.annotation.IdType; | ||
| 5 | -import com.baomidou.mybatisplus.annotation.TableId; | ||
| 6 | -import com.baomidou.mybatisplus.annotation.TableField; | ||
| 7 | -import java.io.Serializable; | ||
| 8 | - | ||
| 9 | -import com.baomidou.mybatisplus.annotation.TableName; | ||
| 10 | -import io.swagger.annotations.ApiModel; | ||
| 11 | -import io.swagger.annotations.ApiModelProperty; | ||
| 12 | -import lombok.Data; | ||
| 13 | -import lombok.EqualsAndHashCode; | ||
| 14 | -import lombok.experimental.Accessors; | ||
| 15 | - | ||
| 16 | -/** | ||
| 17 | - * <p> | ||
| 18 | - * | ||
| 19 | - * </p> | ||
| 20 | - * | ||
| 21 | - * @author wangjingyi | ||
| 22 | - * @since 2022-03-21 | ||
| 23 | - */ | ||
| 24 | -@Data | ||
| 25 | -@EqualsAndHashCode(callSuper = false) | ||
| 26 | -@Accessors(chain = true) | ||
| 27 | -@ApiModel(value="SystemMailAccount对象", description="") | ||
| 28 | -@TableName(value = "system_mail_account", autoResultMap = true) | ||
| 29 | -public class SystemMailAccountDO extends BaseDO implements Serializable { | ||
| 30 | - | ||
| 31 | - private static final long serialVersionUID = 1L; | ||
| 32 | - @TableId | ||
| 33 | - private Long id; | ||
| 34 | - | ||
| 35 | - @TableField("from") | ||
| 36 | - private String from; | ||
| 37 | - | ||
| 38 | - @TableField("username") | ||
| 39 | - private String username; | ||
| 40 | - | ||
| 41 | - @TableField("password") | ||
| 42 | - private String password; | ||
| 43 | - | ||
| 44 | - @TableField("host") | ||
| 45 | - private String host; | ||
| 46 | - | ||
| 47 | - @TableField("port") | ||
| 48 | - private String port; | ||
| 49 | - | ||
| 50 | - @TableField("sslEnable") | ||
| 51 | - private Integer sslEnable; | ||
| 52 | - | ||
| 53 | - | ||
| 54 | -} | 1 | +package cn.iocoder.yudao.module.system.dal.dataobject.mail; |
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||
| 4 | +import com.baomidou.mybatisplus.annotation.IdType; | ||
| 5 | +import com.baomidou.mybatisplus.annotation.TableId; | ||
| 6 | +import com.baomidou.mybatisplus.annotation.TableField; | ||
| 7 | +import java.io.Serializable; | ||
| 8 | + | ||
| 9 | +import com.baomidou.mybatisplus.annotation.TableName; | ||
| 10 | +import io.swagger.annotations.ApiModel; | ||
| 11 | +import io.swagger.annotations.ApiModelProperty; | ||
| 12 | +import lombok.Data; | ||
| 13 | +import lombok.EqualsAndHashCode; | ||
| 14 | +import lombok.experimental.Accessors; | ||
| 15 | + | ||
| 16 | +@Data | ||
| 17 | +@EqualsAndHashCode(callSuper = true) | ||
| 18 | +@Accessors(chain = true) | ||
| 19 | +@ApiModel(value="MailAccount对象", description="") | ||
| 20 | +@TableName(value = "system_mail_account", autoResultMap = true) | ||
| 21 | +public class MailAccountDO extends BaseDO implements Serializable { | ||
| 22 | + | ||
| 23 | + private static final long serialVersionUID = 1L; | ||
| 24 | + @TableId | ||
| 25 | + private Long id; | ||
| 26 | + | ||
| 27 | + @TableField("from") | ||
| 28 | + private String from; | ||
| 29 | + | ||
| 30 | + @TableField("username") | ||
| 31 | + private String username; | ||
| 32 | + | ||
| 33 | + @TableField("password") | ||
| 34 | + private String password; | ||
| 35 | + | ||
| 36 | + @TableField("host") | ||
| 37 | + private String host; | ||
| 38 | + | ||
| 39 | + @TableField("port") | ||
| 40 | + private String port; | ||
| 41 | + | ||
| 42 | + @TableField("sslEnable") | ||
| 43 | + private Boolean sslEnable; | ||
| 44 | + | ||
| 45 | + | ||
| 46 | +} |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/mail/SystemMailLogDO.java renamed to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/mail/MailLogDO.java
| 1 | -package cn.iocoder.yudao.module.system.dal.dataobject.mail; | ||
| 2 | - | ||
| 3 | -import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||
| 4 | -import com.baomidou.mybatisplus.annotation.IdType; | ||
| 5 | -import java.sql.Timestamp; | ||
| 6 | -import com.baomidou.mybatisplus.annotation.TableId; | ||
| 7 | -import com.baomidou.mybatisplus.annotation.TableField; | ||
| 8 | -import java.io.Serializable; | ||
| 9 | -import io.swagger.annotations.ApiModel; | ||
| 10 | -import io.swagger.annotations.ApiModelProperty; | ||
| 11 | -import lombok.Data; | ||
| 12 | -import lombok.EqualsAndHashCode; | ||
| 13 | -import lombok.experimental.Accessors; | ||
| 14 | - | ||
| 15 | -/** | ||
| 16 | - * <p> | ||
| 17 | - * | ||
| 18 | - * </p> | ||
| 19 | - * | ||
| 20 | - * @author wangjingyi | ||
| 21 | - * @since 2022-03-21 | ||
| 22 | - */ | ||
| 23 | -@Data | ||
| 24 | -@EqualsAndHashCode(callSuper = false) | ||
| 25 | -@Accessors(chain = true) | ||
| 26 | -@ApiModel(value="SystemMailLog对象", description="") | ||
| 27 | -public class SystemMailLogDO extends BaseDO implements Serializable { | ||
| 28 | - | ||
| 29 | - private static final long serialVersionUID = 1L; | ||
| 30 | - @TableId | ||
| 31 | - private Long id; | ||
| 32 | - | ||
| 33 | - @TableField("account_code") | ||
| 34 | - private String accountCode; | ||
| 35 | - | ||
| 36 | - @TableField("from") | ||
| 37 | - private String from; | ||
| 38 | - | ||
| 39 | - @TableField("temple_code") | ||
| 40 | - private String templeCode; | ||
| 41 | - | ||
| 42 | - @TableField("title") | ||
| 43 | - private String title; | ||
| 44 | - | ||
| 45 | - @TableField("content") | ||
| 46 | - private String content; | ||
| 47 | - | ||
| 48 | - @TableField("to") | ||
| 49 | - private String to; | ||
| 50 | - | ||
| 51 | - @TableField("sendTime") | ||
| 52 | - private Timestamp sendTime; | ||
| 53 | - | ||
| 54 | - @TableField("sendStatus") | ||
| 55 | - private String sendStatus; | ||
| 56 | - | ||
| 57 | - @TableField("sendResult") | ||
| 58 | - private String sendResult; | ||
| 59 | - | ||
| 60 | - | ||
| 61 | -} | 1 | +package cn.iocoder.yudao.module.system.dal.dataobject.mail; |
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||
| 4 | +import com.baomidou.mybatisplus.annotation.IdType; | ||
| 5 | +import java.sql.Timestamp; | ||
| 6 | +import com.baomidou.mybatisplus.annotation.TableId; | ||
| 7 | +import com.baomidou.mybatisplus.annotation.TableField; | ||
| 8 | +import java.io.Serializable; | ||
| 9 | +import io.swagger.annotations.ApiModel; | ||
| 10 | +import io.swagger.annotations.ApiModelProperty; | ||
| 11 | +import lombok.Data; | ||
| 12 | +import lombok.EqualsAndHashCode; | ||
| 13 | +import lombok.experimental.Accessors; | ||
| 14 | + | ||
| 15 | +/** | ||
| 16 | + * <p> | ||
| 17 | + * | ||
| 18 | + * </p> | ||
| 19 | + * | ||
| 20 | + * @author wangjingyi | ||
| 21 | + * @since 2022-03-21 | ||
| 22 | + */ | ||
| 23 | +@Data | ||
| 24 | +@EqualsAndHashCode(callSuper = true) | ||
| 25 | +@Accessors(chain = true) | ||
| 26 | +@ApiModel(value="SystemMailLog对象", description="") | ||
| 27 | +public class MailLogDO extends BaseDO implements Serializable { | ||
| 28 | + | ||
| 29 | + private static final long serialVersionUID = 1L; | ||
| 30 | + @TableId | ||
| 31 | + private Long id; | ||
| 32 | + | ||
| 33 | + @TableField("account_code") | ||
| 34 | + private String accountCode; | ||
| 35 | + | ||
| 36 | + @TableField("from") | ||
| 37 | + private String from; | ||
| 38 | + | ||
| 39 | + @TableField("temple_code") | ||
| 40 | + private String templeCode; | ||
| 41 | + | ||
| 42 | + @TableField("title") | ||
| 43 | + private String title; | ||
| 44 | + | ||
| 45 | + @TableField("content") | ||
| 46 | + private String content; | ||
| 47 | + | ||
| 48 | + @TableField("to") | ||
| 49 | + private String to; | ||
| 50 | + | ||
| 51 | + @TableField("sendTime") | ||
| 52 | + private Timestamp sendTime; | ||
| 53 | + | ||
| 54 | + @TableField("sendStatus") | ||
| 55 | + private String sendStatus; | ||
| 56 | + | ||
| 57 | + @TableField("sendResult") | ||
| 58 | + private String sendResult; | ||
| 59 | + | ||
| 60 | + | ||
| 61 | +} |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/mail/SystemMailTempleDO.java renamed to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/mail/MailTempleDO.java
| 1 | -package cn.iocoder.yudao.module.system.dal.dataobject.mail; | ||
| 2 | - | ||
| 3 | -import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||
| 4 | -import com.baomidou.mybatisplus.annotation.IdType; | ||
| 5 | -import com.baomidou.mybatisplus.annotation.TableId; | ||
| 6 | -import com.baomidou.mybatisplus.annotation.TableField; | ||
| 7 | -import java.io.Serializable; | ||
| 8 | -import io.swagger.annotations.ApiModel; | ||
| 9 | -import io.swagger.annotations.ApiModelProperty; | ||
| 10 | -import lombok.Data; | ||
| 11 | -import lombok.EqualsAndHashCode; | ||
| 12 | -import lombok.experimental.Accessors; | ||
| 13 | - | ||
| 14 | -/** | ||
| 15 | - * <p> | ||
| 16 | - * | ||
| 17 | - * </p> | ||
| 18 | - * | ||
| 19 | - * @author wangjingyi | ||
| 20 | - * @since 2022-03-21 | ||
| 21 | - */ | ||
| 22 | -@Data | ||
| 23 | -@EqualsAndHashCode(callSuper = false) | ||
| 24 | -@Accessors(chain = true) | ||
| 25 | -@ApiModel(value="SystemMailTemple对象", description="") | ||
| 26 | -public class SystemMailTempleDO extends BaseDO implements Serializable { | ||
| 27 | - | ||
| 28 | - private static final long serialVersionUID = 1L; | ||
| 29 | - @TableId | ||
| 30 | - private Long id; | ||
| 31 | - | ||
| 32 | - @TableField("name") | ||
| 33 | - private String name; | ||
| 34 | - | ||
| 35 | - @TableField("code") | ||
| 36 | - private String code; | ||
| 37 | - | ||
| 38 | - @TableField("username") | ||
| 39 | - private String username; | ||
| 40 | - | ||
| 41 | - @TableField("title") | ||
| 42 | - private String title; | ||
| 43 | - | ||
| 44 | - @TableField("content") | ||
| 45 | - private String content; | ||
| 46 | - | ||
| 47 | - @TableField("status") | ||
| 48 | - private String status; | ||
| 49 | - | ||
| 50 | - @TableField("remark") | ||
| 51 | - private String remark; | ||
| 52 | - | ||
| 53 | - | ||
| 54 | -} | 1 | +package cn.iocoder.yudao.module.system.dal.dataobject.mail; |
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||
| 4 | +import com.baomidou.mybatisplus.annotation.IdType; | ||
| 5 | +import com.baomidou.mybatisplus.annotation.TableId; | ||
| 6 | +import com.baomidou.mybatisplus.annotation.TableField; | ||
| 7 | +import java.io.Serializable; | ||
| 8 | +import io.swagger.annotations.ApiModel; | ||
| 9 | +import io.swagger.annotations.ApiModelProperty; | ||
| 10 | +import lombok.Data; | ||
| 11 | +import lombok.EqualsAndHashCode; | ||
| 12 | +import lombok.experimental.Accessors; | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * <p> | ||
| 16 | + * 邮箱账号 | ||
| 17 | + * </p> | ||
| 18 | + * | ||
| 19 | + * @author wangjingyi | ||
| 20 | + * @since 2022-03-21 | ||
| 21 | + */ | ||
| 22 | +@Data | ||
| 23 | +@EqualsAndHashCode(callSuper = true) | ||
| 24 | +@Accessors(chain = true) | ||
| 25 | +@ApiModel(value="SystemMailTemple对象", description="") | ||
| 26 | +public class MailTempleDO extends BaseDO implements Serializable { | ||
| 27 | + | ||
| 28 | + private static final long serialVersionUID = 1L; | ||
| 29 | + @TableId | ||
| 30 | + private Long id; | ||
| 31 | + | ||
| 32 | + @TableField("name") | ||
| 33 | + private String name; | ||
| 34 | + | ||
| 35 | + @TableField("code") | ||
| 36 | + private String code; | ||
| 37 | + | ||
| 38 | + @TableField("username") | ||
| 39 | + private String username; | ||
| 40 | + | ||
| 41 | + @TableField("title") | ||
| 42 | + private String title; | ||
| 43 | + | ||
| 44 | + @TableField("content") | ||
| 45 | + private String content; | ||
| 46 | + | ||
| 47 | + @TableField("status") | ||
| 48 | + private String status; | ||
| 49 | + | ||
| 50 | + @TableField("remark") | ||
| 51 | + private String remark; | ||
| 52 | + | ||
| 53 | + | ||
| 54 | +} |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/mail/MailAccountMapper.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.dal.mysql.mail; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 4 | +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | ||
| 5 | +import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; | ||
| 6 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.account.MailAccountPageReqVO; | ||
| 7 | +import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailAccountDO; | ||
| 8 | +import org.apache.ibatis.annotations.Mapper; | ||
| 9 | + | ||
| 10 | +@Mapper | ||
| 11 | +public interface MailAccountMapper extends BaseMapperX<MailAccountDO> { | ||
| 12 | + | ||
| 13 | + default PageResult<MailAccountDO> selectPage(MailAccountPageReqVO pageReqVO) { | ||
| 14 | + return selectPage(pageReqVO, new QueryWrapperX<MailAccountDO>() | ||
| 15 | + .likeIfPresent("form" , pageReqVO.getFrom()) | ||
| 16 | + .likeIfPresent("host" , pageReqVO.getHost()) | ||
| 17 | + .likeIfPresent("username" , pageReqVO.getUsername()) | ||
| 18 | + .eqIfPresent("password" , pageReqVO.getPassword()) | ||
| 19 | + .eqIfPresent("port" , pageReqVO.getPort()) | ||
| 20 | + ); | ||
| 21 | + } | ||
| 22 | + | ||
| 23 | +} |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/mail/SystemMailLogMapper.java renamed to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/mail/MailLogMapper.java
| 1 | -package cn.iocoder.yudao.module.system.dal.mysql.mail; | ||
| 2 | - | ||
| 3 | -import cn.iocoder.yudao.module.system.dal.dataobject.mail.SystemMailLogDO; | ||
| 4 | -import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
| 5 | - | ||
| 6 | -/** | ||
| 7 | - * <p> | ||
| 8 | - * Mapper 接口 | ||
| 9 | - * </p> | ||
| 10 | - * | ||
| 11 | - * @author wangjingyi | ||
| 12 | - * @since 2022-03-21 | ||
| 13 | - */ | ||
| 14 | -public interface SystemMailLogMapper extends BaseMapper<SystemMailLogDO> { | ||
| 15 | - | ||
| 16 | -} | 1 | +package cn.iocoder.yudao.module.system.dal.mysql.mail; |
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailLogDO; | ||
| 4 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
| 5 | + | ||
| 6 | +/** | ||
| 7 | + * <p> | ||
| 8 | + * Mapper 接口 | ||
| 9 | + * </p> | ||
| 10 | + * | ||
| 11 | + * @author wangjingyi | ||
| 12 | + * @since 2022-03-21 | ||
| 13 | + */ | ||
| 14 | +public interface MailLogMapper extends BaseMapper<MailLogDO> { | ||
| 15 | + | ||
| 16 | +} |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/mail/SystemMailTempleMapper.java renamed to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/mail/MailTempleMapper.java
| 1 | -package cn.iocoder.yudao.module.system.dal.mysql.mail; | ||
| 2 | - | ||
| 3 | -import cn.iocoder.yudao.module.system.dal.dataobject.mail.SystemMailTempleDO; | ||
| 4 | -import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
| 5 | - | ||
| 6 | -/** | ||
| 7 | - * <p> | ||
| 8 | - * Mapper 接口 | ||
| 9 | - * </p> | ||
| 10 | - * | ||
| 11 | - * @author wangjingyi | ||
| 12 | - * @since 2022-03-21 | ||
| 13 | - */ | ||
| 14 | -public interface SystemMailTempleMapper extends BaseMapper<SystemMailTempleDO> { | ||
| 15 | - | ||
| 16 | -} | 1 | +package cn.iocoder.yudao.module.system.dal.mysql.mail; |
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailTempleDO; | ||
| 4 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||
| 5 | + | ||
| 6 | +/** | ||
| 7 | + * <p> | ||
| 8 | + * Mapper 接口 | ||
| 9 | + * </p> | ||
| 10 | + * | ||
| 11 | + * @author wangjingyi | ||
| 12 | + * @since 2022-03-21 | ||
| 13 | + */ | ||
| 14 | +public interface MailTempleMapper extends BaseMapper<MailTempleDO> { | ||
| 15 | + | ||
| 16 | +} |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/mail/SystemMailAccountMapper.java deleted
| 1 | -package cn.iocoder.yudao.module.system.dal.mysql.mail; | ||
| 2 | - | ||
| 3 | -import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||
| 4 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 5 | -import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | ||
| 6 | -import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; | ||
| 7 | -import cn.iocoder.yudao.module.system.dal.dataobject.mail.SystemMailAccountDO; | ||
| 8 | -import org.apache.ibatis.annotations.Mapper; | ||
| 9 | - | ||
| 10 | -// TODO @ジョイイ: Mapper 一般不用注释,因为用途不大 | ||
| 11 | -/** | ||
| 12 | - * <p> | ||
| 13 | - * Mapper 接口 | ||
| 14 | - * </p> | ||
| 15 | - * | ||
| 16 | - * @author wangjingyi | ||
| 17 | - * @since 2022-03-21 | ||
| 18 | - */ | ||
| 19 | -@Mapper | ||
| 20 | -public interface SystemMailAccountMapper extends BaseMapperX<SystemMailAccountDO> { | ||
| 21 | - | ||
| 22 | - default PageResult<SystemMailAccountDO> selectPage(PageParam pageParam) { | ||
| 23 | - return selectPage(pageParam, new QueryWrapperX<SystemMailAccountDO>()); | ||
| 24 | - } | ||
| 25 | - | ||
| 26 | -} |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/mail/MailAccountService.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.service.mail; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 4 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.account.MailAccountCreateReqVO; | ||
| 5 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.account.MailAccountPageReqVO; | ||
| 6 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.account.MailAccountUpdateReqVO; | ||
| 7 | +import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailAccountDO; | ||
| 8 | + | ||
| 9 | +import java.util.List; | ||
| 10 | + | ||
| 11 | + | ||
| 12 | +/** | ||
| 13 | + * <p> | ||
| 14 | + * 邮箱账号 Service 接口 | ||
| 15 | + * </p> | ||
| 16 | + * | ||
| 17 | + * @author wangjingyi | ||
| 18 | + * @since 2022-03-21 | ||
| 19 | + */ | ||
| 20 | +public interface MailAccountService { | ||
| 21 | + | ||
| 22 | + Long create(MailAccountCreateReqVO createReqVO); | ||
| 23 | + | ||
| 24 | + void update(MailAccountUpdateReqVO updateReqVO); | ||
| 25 | + | ||
| 26 | + void delete(Long id); | ||
| 27 | + | ||
| 28 | + MailAccountDO getMailAccount(Long id); | ||
| 29 | + | ||
| 30 | + PageResult<MailAccountDO> getMailAccountPage(MailAccountPageReqVO pageReqVO); | ||
| 31 | + | ||
| 32 | + List<MailAccountDO> getMailAccountList(); | ||
| 33 | +} |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/mail/SystemMailLogService.java renamed to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/mail/MailLogService.java
| 1 | -package cn.iocoder.yudao.module.system.service.mail; | ||
| 2 | - | ||
| 3 | - | ||
| 4 | -/** | ||
| 5 | - * <p> | ||
| 6 | - * 服务类 | ||
| 7 | - * </p> | ||
| 8 | - * | ||
| 9 | - * @author wangjingyi | ||
| 10 | - * @since 2022-03-21 | ||
| 11 | - */ | ||
| 12 | -public interface SystemMailLogService { | ||
| 13 | - | ||
| 14 | -} | 1 | +package cn.iocoder.yudao.module.system.service.mail; |
| 2 | + | ||
| 3 | + | ||
| 4 | +/** | ||
| 5 | + * <p> | ||
| 6 | + * 服务类 | ||
| 7 | + * </p> | ||
| 8 | + * | ||
| 9 | + * @author wangjingyi | ||
| 10 | + * @since 2022-03-21 | ||
| 11 | + */ | ||
| 12 | +public interface MailLogService { | ||
| 13 | + | ||
| 14 | +} |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/mail/SystemMailTempleService.java renamed to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/mail/MailTempleService.java
| 1 | -package cn.iocoder.yudao.module.system.service.mail; | ||
| 2 | - | ||
| 3 | -/** | ||
| 4 | - * <p> | ||
| 5 | - * 服务类 | ||
| 6 | - * </p> | ||
| 7 | - * | ||
| 8 | - * @author wangjingyi | ||
| 9 | - * @since 2022-03-21 | ||
| 10 | - */ | ||
| 11 | -public interface SystemMailTempleService { | ||
| 12 | - | ||
| 13 | -} | 1 | +package cn.iocoder.yudao.module.system.service.mail; |
| 2 | + | ||
| 3 | +/** | ||
| 4 | + * <p> | ||
| 5 | + * 服务类 | ||
| 6 | + * </p> | ||
| 7 | + * | ||
| 8 | + * @author wangjingyi | ||
| 9 | + * @since 2022-03-21 | ||
| 10 | + */ | ||
| 11 | +public interface MailTempleService { | ||
| 12 | + | ||
| 13 | +} |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/mail/SystemMailAccountService.java deleted
| 1 | -package cn.iocoder.yudao.module.system.service.mail; | ||
| 2 | - | ||
| 3 | -import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||
| 4 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 5 | -import cn.iocoder.yudao.module.system.controller.admin.mail.vo.account.SystemMailAccountBaseVO; | ||
| 6 | -import cn.iocoder.yudao.module.system.dal.dataobject.mail.SystemMailAccountDO; | ||
| 7 | - | ||
| 8 | -import java.util.List; | ||
| 9 | - | ||
| 10 | -// TODO @ジョイイ:类注释,应该是 邮箱账号 Service 接口 | ||
| 11 | - | ||
| 12 | -/** | ||
| 13 | - * <p> | ||
| 14 | - * 服务类 | ||
| 15 | - * </p> | ||
| 16 | - * | ||
| 17 | - * @author wangjingyi | ||
| 18 | - * @since 2022-03-21 | ||
| 19 | - */ | ||
| 20 | -public interface SystemMailAccountService { | ||
| 21 | - | ||
| 22 | - Long create(SystemMailAccountBaseVO baseVO); | ||
| 23 | - | ||
| 24 | - String update(SystemMailAccountBaseVO baseVO); | ||
| 25 | - | ||
| 26 | - String delete(SystemMailAccountBaseVO baseVO); | ||
| 27 | - | ||
| 28 | - SystemMailAccountDO getMailAccount(Long id); | ||
| 29 | - | ||
| 30 | - PageResult<SystemMailAccountDO> getMailAccountPage(PageParam pageParam); | ||
| 31 | - | ||
| 32 | - List<SystemMailAccountDO> getMailAccountList(); | ||
| 33 | -} |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/mail/impl/MailAccountServiceImpl.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.service.mail.impl; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 4 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.account.MailAccountCreateReqVO; | ||
| 5 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.account.MailAccountPageReqVO; | ||
| 6 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.account.MailAccountUpdateReqVO; | ||
| 7 | +import cn.iocoder.yudao.module.system.convert.mail.MailAccountConvert; | ||
| 8 | +import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailAccountDO; | ||
| 9 | +import cn.iocoder.yudao.module.system.dal.mysql.mail.MailAccountMapper; | ||
| 10 | +import cn.iocoder.yudao.module.system.service.mail.MailAccountService; | ||
| 11 | +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | ||
| 12 | +import org.springframework.stereotype.Service; | ||
| 13 | + | ||
| 14 | +import javax.annotation.Resource; | ||
| 15 | +import java.util.HashMap; | ||
| 16 | +import java.util.List; | ||
| 17 | +import java.util.Map; | ||
| 18 | + | ||
| 19 | +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | ||
| 20 | +import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.MAIL_ACCOUNT_EXISTS; | ||
| 21 | +import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.MAIL_ACCOUNT_NOT_EXISTS; | ||
| 22 | + | ||
| 23 | + | ||
| 24 | +/** | ||
| 25 | + * <p> | ||
| 26 | + * 邮箱账号 Service 实现类 | ||
| 27 | + * </p> | ||
| 28 | + * | ||
| 29 | + * @author wangjingyi | ||
| 30 | + * @since 2022-03-21 | ||
| 31 | + */ | ||
| 32 | +@Service | ||
| 33 | +public class MailAccountServiceImpl implements MailAccountService { | ||
| 34 | + | ||
| 35 | + @Resource | ||
| 36 | + private MailAccountMapper mailAccountMapper; | ||
| 37 | + | ||
| 38 | + @Override | ||
| 39 | + public Long create(MailAccountCreateReqVO createReqVO) { | ||
| 40 | + // username 要校验唯一 | ||
| 41 | + Map<String , String> map = new HashMap<>(); | ||
| 42 | + map.put("username" , createReqVO.getUsername()); | ||
| 43 | + this.validateMailAccountOnly(map); | ||
| 44 | + MailAccountDO mailAccountDO = MailAccountConvert.INSTANCE.convert(createReqVO); | ||
| 45 | + mailAccountMapper.insert(mailAccountDO); | ||
| 46 | + return mailAccountDO.getId(); | ||
| 47 | + } | ||
| 48 | + | ||
| 49 | + @Override | ||
| 50 | + public void update(MailAccountUpdateReqVO updateReqVO) { | ||
| 51 | + // username 要校验唯一 | ||
| 52 | + Map<String , String> map = new HashMap<>(); | ||
| 53 | + map.put("username" , updateReqVO.getUsername()); | ||
| 54 | + this.validateMailAccountOnly(map); | ||
| 55 | + MailAccountDO mailAccountDO = MailAccountConvert.INSTANCE.convert(updateReqVO); | ||
| 56 | + // 校验是否存在 | ||
| 57 | + this.validateMailAccountExists(mailAccountDO.getId()); | ||
| 58 | + mailAccountMapper.updateById(mailAccountDO); | ||
| 59 | + } | ||
| 60 | + | ||
| 61 | + | ||
| 62 | + @Override | ||
| 63 | + public void delete(Long id) { | ||
| 64 | + // 校验是否存在 | ||
| 65 | + this.validateMailAccountExists(id); | ||
| 66 | + mailAccountMapper.deleteById(id); | ||
| 67 | + } | ||
| 68 | + | ||
| 69 | + @Override | ||
| 70 | + public MailAccountDO getMailAccount(Long id) { | ||
| 71 | + return mailAccountMapper.selectById(id); | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + @Override | ||
| 75 | + public PageResult<MailAccountDO> getMailAccountPage(MailAccountPageReqVO pageReqVO) { | ||
| 76 | + return mailAccountMapper.selectPage(pageReqVO); | ||
| 77 | + } | ||
| 78 | + | ||
| 79 | + @Override | ||
| 80 | + public List<MailAccountDO> getMailAccountList() { | ||
| 81 | + return mailAccountMapper.selectList(); | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + private void validateMailAccountExists(Long id) { | ||
| 85 | + if (mailAccountMapper.selectById(id) == null) { | ||
| 86 | + throw exception(MAIL_ACCOUNT_NOT_EXISTS); | ||
| 87 | + } | ||
| 88 | + } | ||
| 89 | + | ||
| 90 | + private void validateMailAccountOnly(Map params){ | ||
| 91 | + QueryWrapper queryWrapper = new QueryWrapper<MailAccountDO>(); | ||
| 92 | + params.forEach((k , v)->{ | ||
| 93 | + queryWrapper.like(k , v); | ||
| 94 | + }); | ||
| 95 | + if (mailAccountMapper.selectOne(queryWrapper) != null) { | ||
| 96 | + throw exception(MAIL_ACCOUNT_EXISTS); | ||
| 97 | + } | ||
| 98 | + } | ||
| 99 | +} |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/mail/impl/SystemMailLogServiceImpl.java renamed to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/mail/impl/MailLogServiceImpl.java
| 1 | -package cn.iocoder.yudao.module.system.service.mail.impl; | ||
| 2 | - | ||
| 3 | - | ||
| 4 | -import cn.iocoder.yudao.module.system.service.mail.SystemMailLogService; | ||
| 5 | -import org.springframework.stereotype.Service; | ||
| 6 | - | ||
| 7 | -/** | ||
| 8 | - * <p> | ||
| 9 | - * 服务实现类 | ||
| 10 | - * </p> | ||
| 11 | - * | ||
| 12 | - * @author wangjingyi | ||
| 13 | - * @since 2022-03-21 | ||
| 14 | - */ | ||
| 15 | -@Service | ||
| 16 | -public class SystemMailLogServiceImpl implements SystemMailLogService { | ||
| 17 | - | ||
| 18 | -} | 1 | +package cn.iocoder.yudao.module.system.service.mail.impl; |
| 2 | + | ||
| 3 | + | ||
| 4 | +import cn.iocoder.yudao.module.system.service.mail.MailLogService; | ||
| 5 | +import org.springframework.stereotype.Service; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * <p> | ||
| 9 | + * 服务实现类 | ||
| 10 | + * </p> | ||
| 11 | + * | ||
| 12 | + * @author wangjingyi | ||
| 13 | + * @since 2022-03-21 | ||
| 14 | + */ | ||
| 15 | +@Service | ||
| 16 | +public class MailLogServiceImpl implements MailLogService { | ||
| 17 | + | ||
| 18 | +} |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/mail/impl/SystemMailTempleServiceImpl.java renamed to yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/mail/impl/MailTempleServiceImpl.java
| 1 | -package cn.iocoder.yudao.module.system.service.mail.impl; | ||
| 2 | - | ||
| 3 | - | ||
| 4 | -import cn.iocoder.yudao.module.system.service.mail.SystemMailTempleService; | ||
| 5 | -import org.springframework.stereotype.Service; | ||
| 6 | - | ||
| 7 | -/** | ||
| 8 | - * <p> | ||
| 9 | - * 服务实现类 | ||
| 10 | - * </p> | ||
| 11 | - * | ||
| 12 | - * @author wangjingyi | ||
| 13 | - * @since 2022-03-21 | ||
| 14 | - */ | ||
| 15 | -@Service | ||
| 16 | -public class SystemMailTempleServiceImpl implements SystemMailTempleService { | ||
| 17 | - | ||
| 18 | -} | 1 | +package cn.iocoder.yudao.module.system.service.mail.impl; |
| 2 | + | ||
| 3 | + | ||
| 4 | +import cn.iocoder.yudao.module.system.service.mail.MailTempleService; | ||
| 5 | +import org.springframework.stereotype.Service; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * <p> | ||
| 9 | + * 服务实现类 | ||
| 10 | + * </p> | ||
| 11 | + * | ||
| 12 | + * @author wangjingyi | ||
| 13 | + * @since 2022-03-21 | ||
| 14 | + */ | ||
| 15 | +@Service | ||
| 16 | +public class MailTempleServiceImpl implements MailTempleService { | ||
| 17 | + | ||
| 18 | +} |
yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/mail/impl/SystemMailAccountServiceImpl.java deleted
| 1 | -package cn.iocoder.yudao.module.system.service.mail.impl; | ||
| 2 | - | ||
| 3 | -import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||
| 4 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 5 | -import cn.iocoder.yudao.module.system.controller.admin.mail.vo.account.SystemMailAccountBaseVO; | ||
| 6 | -import cn.iocoder.yudao.module.system.convert.mail.SystemMailAccountConvert; | ||
| 7 | -import cn.iocoder.yudao.module.system.dal.dataobject.mail.SystemMailAccountDO; | ||
| 8 | -import cn.iocoder.yudao.module.system.dal.mysql.mail.SystemMailAccountMapper; | ||
| 9 | -import cn.iocoder.yudao.module.system.service.mail.SystemMailAccountService; | ||
| 10 | -import org.springframework.stereotype.Service; | ||
| 11 | - | ||
| 12 | -import javax.annotation.Resource; | ||
| 13 | -import java.util.List; | ||
| 14 | - | ||
| 15 | -// TODO @ジョイイ:类注释,应该是 邮箱账号 Service 实现类 | ||
| 16 | - | ||
| 17 | -/** | ||
| 18 | - * <p> | ||
| 19 | - * 服务实现类 | ||
| 20 | - * </p> | ||
| 21 | - * | ||
| 22 | - * @author wangjingyi | ||
| 23 | - * @since 2022-03-21 | ||
| 24 | - */ | ||
| 25 | -@Service | ||
| 26 | -public class SystemMailAccountServiceImpl implements SystemMailAccountService { | ||
| 27 | - // TODO @ジョイイ: private | ||
| 28 | - @Resource | ||
| 29 | - SystemMailAccountMapper systemMailAccountMapper; // TODO @ジョイイ: 变量,和方法要空一行 | ||
| 30 | - @Override | ||
| 31 | - public Long create(SystemMailAccountBaseVO baseVO) { | ||
| 32 | - // TODO @ジョイイ: username 要校验唯一 | ||
| 33 | - SystemMailAccountDO systemMailAccountDO = SystemMailAccountConvert.INSTANCE.convert(baseVO); | ||
| 34 | - systemMailAccountMapper.insert(systemMailAccountDO); | ||
| 35 | - return systemMailAccountDO.getId(); | ||
| 36 | - } | ||
| 37 | - | ||
| 38 | - // TODO @ジョイイ: 不用返回值,void 即可 | ||
| 39 | - @Override | ||
| 40 | - public String update(SystemMailAccountBaseVO baseVO) { | ||
| 41 | - // TODO @ジョイイ: username 要校验唯一 | ||
| 42 | - // TODO @ジョイイ: 校验是否存在 | ||
| 43 | - SystemMailAccountDO systemMailAccountDO = SystemMailAccountConvert.INSTANCE.convert(baseVO); | ||
| 44 | - systemMailAccountMapper.updateById(systemMailAccountDO); | ||
| 45 | - return null; | ||
| 46 | - } | ||
| 47 | - | ||
| 48 | - // TODO @ジョイイ: 不用返回值,void 即可 | ||
| 49 | - | ||
| 50 | - @Override | ||
| 51 | - public String delete(SystemMailAccountBaseVO baseVO) { | ||
| 52 | - // TODO @ジョイイ: 校验是否存在 | ||
| 53 | - SystemMailAccountDO systemMailAccountDO = SystemMailAccountConvert.INSTANCE.convert(baseVO); | ||
| 54 | - systemMailAccountMapper.deleteById(systemMailAccountDO); | ||
| 55 | - return null; | ||
| 56 | - } | ||
| 57 | - | ||
| 58 | - @Override | ||
| 59 | - public SystemMailAccountDO getMailAccount(Long id) { | ||
| 60 | - return systemMailAccountMapper.selectById(id); | ||
| 61 | - } | ||
| 62 | - | ||
| 63 | - @Override | ||
| 64 | - public PageResult<SystemMailAccountDO> getMailAccountPage(PageParam pageParam) { | ||
| 65 | - return systemMailAccountMapper.selectPage(pageParam); | ||
| 66 | - } | ||
| 67 | - | ||
| 68 | - @Override | ||
| 69 | - public List<SystemMailAccountDO> getMailAccountList() { | ||
| 70 | - return systemMailAccountMapper.selectList(); | ||
| 71 | - } | ||
| 72 | - | ||
| 73 | -} |