From 0c87fd5c90bb26fbcd057ba41b1c67a2c389c8ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?A=E2=99=82=E5=9C=A3=E7=BF=94?= Date: Tue, 8 May 2018 17:16:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/ibase4j/model/SysEmailConfig.java | 20 +++++++++++++++---- .../service/impl/SysEmailServiceImpl.java | 1 + .../ibase4j/web/SysEmailConfigController.java | 9 ++++++--- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/iBase4J-SYS-Facade/src/main/java/org/ibase4j/model/SysEmailConfig.java b/iBase4J-SYS-Facade/src/main/java/org/ibase4j/model/SysEmailConfig.java index 5768939f..7ac0950d 100644 --- a/iBase4J-SYS-Facade/src/main/java/org/ibase4j/model/SysEmailConfig.java +++ b/iBase4J-SYS-Facade/src/main/java/org/ibase4j/model/SysEmailConfig.java @@ -20,22 +20,26 @@ public class SysEmailConfig extends BaseModel { /** * SMTP服务器 */ - @TableField(value="smtp_host") + @TableField(value = "smtp_host") private String smtpHost; + /** SMTP服务器端口 + */ + @TableField(value = "smtp_port") + private String smtpPort; /** * 名称 */ - @TableField(value="sender_name") + @TableField(value = "sender_name") private String senderName; /** * 发邮件邮箱账号 */ - @TableField(value="sender_account") + @TableField(value = "sender_account") private String senderAccount; /** * 发邮件邮箱密码 */ - @TableField(value="sender_password") + @TableField(value = "sender_password") private String senderPassword; /** * 发送邮箱鉴权 @@ -51,6 +55,14 @@ public void setSmtpHost(String smtpHost) { this.smtpHost = smtpHost; } + public String getSmtpPort() { + return smtpPort; + } + + public void setSmtpPort(String smtpPort) { + this.smtpPort = smtpPort; + } + public String getSenderName() { return senderName; } diff --git a/iBase4J-SYS-Service/src/main/java/org/ibase4j/service/impl/SysEmailServiceImpl.java b/iBase4J-SYS-Service/src/main/java/org/ibase4j/service/impl/SysEmailServiceImpl.java index 44a0cfa7..245009e5 100644 --- a/iBase4J-SYS-Service/src/main/java/org/ibase4j/service/impl/SysEmailServiceImpl.java +++ b/iBase4J-SYS-Service/src/main/java/org/ibase4j/service/impl/SysEmailServiceImpl.java @@ -40,6 +40,7 @@ public void sendEmail(SysEmail record) { } else { SysEmailConfig emailConfig = emailConfigs.get(0); email.setHost(emailConfig.getSmtpHost()); + email.setPort(emailConfig.getSmtpPort()); email.setName(emailConfig.getSenderName()); email.setFrom(emailConfig.getSenderName() + "," + emailConfig.getSenderAccount()); email.setPassword(emailConfig.getSenderPassword()); diff --git a/iBase4J-SYS-Web/src/main/java/org/ibase4j/web/SysEmailConfigController.java b/iBase4J-SYS-Web/src/main/java/org/ibase4j/web/SysEmailConfigController.java index c8c9287d..9619ba06 100644 --- a/iBase4J-SYS-Web/src/main/java/org/ibase4j/web/SysEmailConfigController.java +++ b/iBase4J-SYS-Web/src/main/java/org/ibase4j/web/SysEmailConfigController.java @@ -19,7 +19,7 @@ /** * 邮件配置管理控制类 - * + * * @author ShenHuaJie * @version 2016年5月20日 下午3:13:31 */ @@ -27,6 +27,7 @@ @Api(value = "邮件配置管理", description = "邮件配置管理") @RequestMapping(value = "emailConfig") public class SysEmailConfigController extends BaseController { + @Override @ApiOperation(value = "查询邮件配置") @RequiresPermissions("sys.email.config.read") @RequestMapping(value = "/read/list", method = RequestMethod.PUT) @@ -41,6 +42,7 @@ public Object get(ModelMap modelMap, @RequestBody SysEmailConfig param) { return super.get(modelMap, param); } + @Override @ApiOperation(value = "修改邮件配置") @RequiresPermissions("sys.email.config.update") @RequestMapping(method = RequestMethod.POST) @@ -48,14 +50,15 @@ public Object update(ModelMap modelMap, @RequestBody SysEmailConfig param) { if (param.getId() != null) { SysEmailConfig result = service.queryById(param.getId()); if (param.getSenderPassword() != null && !param.getSenderPassword().equals(result.getSenderPassword())) { - param.setSenderPassword(SecurityUtil.encryptMd5(param.getSenderPassword())); + param.setSenderPassword(SecurityUtil.encryptDes(param.getSenderPassword())); } } else if (DataUtil.isNotEmpty(param.getSenderPassword())) { - param.setSenderPassword(SecurityUtil.encryptMd5(param.getSenderPassword())); + param.setSenderPassword(SecurityUtil.encryptDes(param.getSenderPassword())); } return super.update(modelMap, param); } + @Override @ApiOperation(value = "删除邮件配置") @RequiresPermissions("sys.email.config.delete") @RequestMapping(method = RequestMethod.DELETE)