mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-10-31 10:18:42 +08:00 
			
		
		
		
	code review 邮件账号模块
This commit is contained in:
		| @@ -5,16 +5,9 @@ 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; | ||||
| @@ -23,12 +16,12 @@ 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; | ||||
|  | ||||
| // TODO @ジョイイ:使用 Swagger 注解,不用写这个注释啦 | ||||
| /** | ||||
|  * <p> | ||||
|  *  前端控制器 | ||||
| @@ -39,11 +32,13 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||||
|  */ | ||||
| @Api(tags = "管理后台 - 邮件模板") | ||||
| @RestController | ||||
| @RequestMapping("/system-mail-account") | ||||
| @RequestMapping("/system-mail-account") // TODO @ジョイイ:/system/mail-account | ||||
| public class SystemMailAccountController { | ||||
|     @Resource | ||||
|     private SystemMailAccountService systemMailAccountService; | ||||
|  | ||||
|     // TODO @ジョイイ:最好,VO 分拆下,参考下别的模块 | ||||
|  | ||||
|     @PostMapping("/create") | ||||
|     @ApiOperation("创建邮箱账号") | ||||
|     @PreAuthorize("@ss.hasPermission('system:system-mail-account:create')") | ||||
| @@ -59,6 +54,8 @@ public class SystemMailAccountController { | ||||
|         return success(true); | ||||
|     } | ||||
|  | ||||
|     // TODO @ジョイイ:删除,编号即可 | ||||
|  | ||||
|     @DeleteMapping("/delete") | ||||
|     @ApiOperation("删除邮箱账号") | ||||
|     @PreAuthorize("@ss.hasPermission('system:system-mail-account:delete')") | ||||
| @@ -76,6 +73,8 @@ public class SystemMailAccountController { | ||||
|         return success(SystemMailAccountConvert.INSTANCE.convert(systemMailAccountDO)); | ||||
|     } | ||||
|  | ||||
|     // TODO @ジョイイ:分页的查询条件 | ||||
|  | ||||
|     @GetMapping("/page") | ||||
|     @ApiOperation("获得邮箱账号分页") | ||||
|     @PreAuthorize("@ss.hasPermission('system:system-mail-account:query')") | ||||
|   | ||||
| @@ -1,11 +1,13 @@ | ||||
| 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; | ||||
|  | ||||
| // TODO @ジョイイ:System 去掉哈 | ||||
| @Data | ||||
| public class SystemMailAccountBaseVO { | ||||
|  | ||||
|     // TODO @ジョイイ:example 写的不太对,这个应该是邮箱; | ||||
|     @ApiModelProperty(value = "来源" , required = true , example = "yudaoyuanma") | ||||
|     private String from; | ||||
|  | ||||
| @@ -21,6 +23,7 @@ public class SystemMailAccountBaseVO { | ||||
|     @ApiModelProperty(value = "端口" , required = true , example = "80") | ||||
|     private String port; | ||||
|  | ||||
|     // TODO @ジョイイ:Boolean | ||||
|     @ApiModelProperty(value = "是否开启ssl" , required = true , example = "2") | ||||
|     private Integer sslEnable; | ||||
| } | ||||
|   | ||||
| @@ -4,12 +4,10 @@ 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; | ||||
|  | ||||
|  | ||||
| // TODO @ジョイイ: Mapper 一般不用注释,因为用途不大 | ||||
| /** | ||||
|  * <p> | ||||
|  *  Mapper 接口 | ||||
|   | ||||
| @@ -7,6 +7,8 @@ import cn.iocoder.yudao.module.system.dal.dataobject.mail.SystemMailAccountDO; | ||||
|  | ||||
| import java.util.List; | ||||
|  | ||||
| // TODO @ジョイイ:类注释,应该是 邮箱账号 Service 接口 | ||||
|  | ||||
| /** | ||||
|  * <p> | ||||
|  *  服务类 | ||||
|   | ||||
| @@ -12,6 +12,8 @@ import org.springframework.stereotype.Service; | ||||
| import javax.annotation.Resource; | ||||
| import java.util.List; | ||||
|  | ||||
| // TODO @ジョイイ:类注释,应该是 邮箱账号 Service 实现类 | ||||
|  | ||||
| /** | ||||
|  * <p> | ||||
|  *  服务实现类 | ||||
| @@ -22,24 +24,32 @@ import java.util.List; | ||||
|  */ | ||||
| @Service | ||||
| public class SystemMailAccountServiceImpl  implements SystemMailAccountService { | ||||
|     // TODO @ジョイイ: private | ||||
|     @Resource | ||||
|     SystemMailAccountMapper systemMailAccountMapper; | ||||
|     SystemMailAccountMapper systemMailAccountMapper;  // TODO @ジョイイ: 变量,和方法要空一行 | ||||
|     @Override | ||||
|     public Long create(SystemMailAccountBaseVO baseVO) { | ||||
|         // TODO @ジョイイ: username 要校验唯一 | ||||
|         SystemMailAccountDO systemMailAccountDO = SystemMailAccountConvert.INSTANCE.convert(baseVO); | ||||
|         systemMailAccountMapper.insert(systemMailAccountDO); | ||||
|         return systemMailAccountDO.getId(); | ||||
|     } | ||||
|  | ||||
|     // TODO @ジョイイ: 不用返回值,void 即可 | ||||
|     @Override | ||||
|     public String update(SystemMailAccountBaseVO baseVO) { | ||||
|         // TODO @ジョイイ: username 要校验唯一 | ||||
|         // TODO @ジョイイ: 校验是否存在 | ||||
|         SystemMailAccountDO systemMailAccountDO = SystemMailAccountConvert.INSTANCE.convert(baseVO); | ||||
|         systemMailAccountMapper.updateById(systemMailAccountDO); | ||||
|         return null; | ||||
|     } | ||||
|  | ||||
|     // TODO @ジョイイ: 不用返回值,void 即可 | ||||
|  | ||||
|     @Override | ||||
|     public String delete(SystemMailAccountBaseVO baseVO) { | ||||
|         // TODO @ジョイイ: 校验是否存在 | ||||
|         SystemMailAccountDO systemMailAccountDO = SystemMailAccountConvert.INSTANCE.convert(baseVO); | ||||
|         systemMailAccountMapper.deleteById(systemMailAccountDO); | ||||
|         return null; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 YunaiV
					YunaiV