add useTLS property to mail setting (#277)
* feat: add useSSL property to mail setting * feat: update frontend resource * feat: update submodule
This commit is contained in:
parent
2592056cd7
commit
2925a57917
|
@ -1 +1 @@
|
|||
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>databasir</title><script defer="defer" type="module" src="/js/chunk-vendors.661f96f0.js"></script><script defer="defer" type="module" src="/js/app.32c0a087.js"></script><link href="/css/chunk-vendors.113af7af.css" rel="stylesheet"><link href="/css/app.6e28da6e.css" rel="stylesheet"><script defer="defer" src="/js/chunk-vendors-legacy.fc4c9525.js" nomodule></script><script defer="defer" src="/js/app-legacy.99935580.js" nomodule></script></head><body><noscript><strong>We're sorry but databasir doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
|
||||
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>databasir</title><script defer="defer" type="module" src="/js/chunk-vendors.661f96f0.js"></script><script defer="defer" type="module" src="/js/app.b6da2853.js"></script><link href="/css/chunk-vendors.113af7af.css" rel="stylesheet"><link href="/css/app.6e28da6e.css" rel="stylesheet"><script defer="defer" src="/js/chunk-vendors-legacy.fc4c9525.js" nomodule></script><script defer="defer" src="/js/app-legacy.1c6fe2cb.js" nomodule></script></head><body><noscript><strong>We're sorry but databasir doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,2 @@
|
|||
"use strict";(self["webpackChunkdatabasir"]=self["webpackChunkdatabasir"]||[]).push([[351],{54351:function(e,l,t){t.r(l),t.d(l,{default:function(){return S}});var a=t(66252);const o=(0,a.Uk)(" 系统邮箱设置 "),u=(0,a.Uk)(" : "),s=(0,a.Uk)("保存"),r=(0,a.Uk)("重置");function m(e,l,t,m,d,n){const p=(0,a.up)("box"),i=(0,a.up)("el-icon"),f=(0,a.up)("el-divider"),h=(0,a.up)("el-input"),c=(0,a.up)("el-form-item"),w=(0,a.up)("el-col"),S=(0,a.up)("el-switch"),V=(0,a.up)("el-button"),W=(0,a.up)("el-form"),_=(0,a.up)("el-card"),T=(0,a.up)("el-main"),b=(0,a.up)("el-container");return(0,a.wg)(),(0,a.j4)(b,null,{default:(0,a.w5)((()=>[(0,a.Wm)(T,null,{default:(0,a.w5)((()=>[(0,a.Wm)(_,{shadow:"hover",style:{"max-width":"600px"}},{default:(0,a.w5)((()=>[(0,a.Wm)(f,null,{default:(0,a.w5)((()=>[(0,a.Wm)(i,null,{default:(0,a.w5)((()=>[(0,a.Wm)(p)])),_:1}),o])),_:1}),(0,a.Wm)(W,{model:d.form,"label-position":"top",rules:d.formRule,ref:"formRef",style:{"max-width":"900px"}},{default:(0,a.w5)((()=>[(0,a.Wm)(c,{label:"SMTP 用户名",prop:"username"},{default:(0,a.w5)((()=>[(0,a.Wm)(h,{modelValue:d.form.username,"onUpdate:modelValue":l[0]||(l[0]=e=>d.form.username=e),placeholder:"请输入 SMTP 服务用户名"},null,8,["modelValue"])])),_:1}),(0,a.Wm)(c,{label:"SMTP 密码",prop:"password"},{default:(0,a.w5)((()=>[(0,a.Wm)(h,{modelValue:d.form.password,"onUpdate:modelValue":l[1]||(l[1]=e=>d.form.password=e),type:"password",placeholder:"请输入密码","show-password":""},null,8,["modelValue"])])),_:1}),(0,a.Wm)(c,{label:"发送邮箱",prop:"mailFrom"},{default:(0,a.w5)((()=>[(0,a.Wm)(h,{modelValue:d.form.mailFrom,"onUpdate:modelValue":l[2]||(l[2]=e=>d.form.mailFrom=e),placeholder:"请输入邮箱账号"},null,8,["modelValue"])])),_:1}),(0,a.Wm)(c,{label:"SMTP",prop:"smtpHost"},{default:(0,a.w5)((()=>[(0,a.Wm)(w,{span:12},{default:(0,a.w5)((()=>[(0,a.Wm)(h,{modelValue:d.form.smtpHost,"onUpdate:modelValue":l[3]||(l[3]=e=>d.form.smtpHost=e),placeholder:"SMTP Host"},null,8,["modelValue"])])),_:1}),(0,a.Wm)(w,{span:1,style:{"text-align":"center"}},{default:(0,a.w5)((()=>[u])),_:1}),(0,a.Wm)(w,{span:6},{default:(0,a.w5)((()=>[(0,a.Wm)(h,{modelValue:d.form.smtpPort,"onUpdate:modelValue":l[4]||(l[4]=e=>d.form.smtpPort=e),placeholder:"SMTP Port"},null,8,["modelValue"])])),_:1})])),_:1}),(0,a.Wm)(c,{label:"启用 SSL",prop:"useSSL"},{default:(0,a.w5)((()=>[(0,a.Wm)(S,{modelValue:d.form.useSSL,"onUpdate:modelValue":l[5]||(l[5]=e=>d.form.useSSL=e)},null,8,["modelValue"])])),_:1}),(0,a.Wm)(c,{label:"启用 TLS",prop:"useTls"},{default:(0,a.w5)((()=>[(0,a.Wm)(S,{modelValue:d.form.useTls,"onUpdate:modelValue":l[6]||(l[6]=e=>d.form.useTls=e)},null,8,["modelValue"])])),_:1}),(0,a.Wm)(c,{style:{"margin-top":"38px"}},{default:(0,a.w5)((()=>[(0,a.Wm)(V,{type:"primary",onClick:l[7]||(l[7]=e=>n.onSubmit("formRef"))},{default:(0,a.w5)((()=>[s])),_:1}),(0,a.Wm)(V,{type:"danger",onClick:l[8]||(l[8]=e=>n.onReset())},{default:(0,a.w5)((()=>[r])),_:1})])),_:1})])),_:1},8,["model","rules"])])),_:1})])),_:1})])),_:1})}var d=t(63872);const n="/api/v1.0/settings",p=()=>d.Z.get(n+"/sys_email"),i=e=>d.Z.post(n+"/sys_email",e),f=()=>d.Z["delete"](n+"/sys_email");var h={data(){return{form:{smtpHost:null,smtpPort:null,username:null,mailFrom:null,password:null,useSSL:!1,useTls:!1},formRule:{username:[this.requiredInputValidRule("请输入 SMTP 服务用户名")],password:[this.requiredInputValidRule("请输入 SMTP 服务密码")],smtpHost:[this.requiredInputValidRule("请输入 SMTP 地址")],smtpPort:[this.requiredInputValidRule("请输入 SMTP 端口"),{min:1,max:65535,message:"端口有效值为 1~65535",trigger:"blur"}]}}},mounted(){this.fetchSysMail()},methods:{requiredInputValidRule(e){return{required:!0,message:e,trigger:"blur"}},async fetchSysMail(){const e=await p().then((e=>e.data));e&&(this.form=e)},onSubmit(){this.$refs.formRef.validate((e=>this.form.useTls&&this.form.useSSL?(this.$message.error("不能同时启用 SSL 和 TLS"),!1):e?(i(this.form).then((e=>{e.errCode||this.$message.success("更新成功")})),!0):(this.$message.error("请完善表单相关信息!"),!1)))},onReset(){this.$confirm("确认重置系统邮件吗?删除后数据将无法恢复","警告",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{f().then((e=>{e.errCode||(this.form={},this.$message.success("重置成功"))}))}))}}},c=t(83744);const w=(0,c.Z)(h,[["render",m]]);var S=w}}]);
|
||||
//# sourceMappingURL=351.d637eba7.js.map
|
File diff suppressed because one or more lines are too long
|
@ -1,2 +0,0 @@
|
|||
"use strict";(self["webpackChunkdatabasir"]=self["webpackChunkdatabasir"]||[]).push([[968],{89968:function(e,t,n){n.r(t),n.d(t,{default:function(){return V}});var r=n(66252),u=(0,r.Uk)(" 系统邮箱设置 "),l=(0,r.Uk)(" : "),o=(0,r.Uk)("保存"),a=(0,r.Uk)("重置");function m(e,t,n,m,i,s){var f=(0,r.up)("box"),d=(0,r.up)("el-icon"),p=(0,r.up)("el-divider"),c=(0,r.up)("el-input"),w=(0,r.up)("el-form-item"),h=(0,r.up)("el-col"),S=(0,r.up)("el-switch"),V=(0,r.up)("el-button"),W=(0,r.up)("el-form"),_=(0,r.up)("el-card"),g=(0,r.up)("el-main"),b=(0,r.up)("el-container");return(0,r.wg)(),(0,r.j4)(b,null,{default:(0,r.w5)((function(){return[(0,r.Wm)(g,null,{default:(0,r.w5)((function(){return[(0,r.Wm)(_,{shadow:"hover",style:{"max-width":"600px"}},{default:(0,r.w5)((function(){return[(0,r.Wm)(p,null,{default:(0,r.w5)((function(){return[(0,r.Wm)(d,null,{default:(0,r.w5)((function(){return[(0,r.Wm)(f)]})),_:1}),u]})),_:1}),(0,r.Wm)(W,{model:i.form,"label-position":"top",rules:i.formRule,ref:"formRef",style:{"max-width":"900px"}},{default:(0,r.w5)((function(){return[(0,r.Wm)(w,{label:"SMTP 用户名",prop:"username"},{default:(0,r.w5)((function(){return[(0,r.Wm)(c,{modelValue:i.form.username,"onUpdate:modelValue":t[0]||(t[0]=function(e){return i.form.username=e}),placeholder:"请输入 SMTP 服务用户名"},null,8,["modelValue"])]})),_:1}),(0,r.Wm)(w,{label:"SMTP 密码",prop:"password"},{default:(0,r.w5)((function(){return[(0,r.Wm)(c,{modelValue:i.form.password,"onUpdate:modelValue":t[1]||(t[1]=function(e){return i.form.password=e}),type:"password",placeholder:"请输入密码","show-password":""},null,8,["modelValue"])]})),_:1}),(0,r.Wm)(w,{label:"发送邮箱",prop:"mailFrom"},{default:(0,r.w5)((function(){return[(0,r.Wm)(c,{modelValue:i.form.mailFrom,"onUpdate:modelValue":t[2]||(t[2]=function(e){return i.form.mailFrom=e}),placeholder:"请输入邮箱账号"},null,8,["modelValue"])]})),_:1}),(0,r.Wm)(w,{label:"SMTP",prop:"smtpHost"},{default:(0,r.w5)((function(){return[(0,r.Wm)(h,{span:12},{default:(0,r.w5)((function(){return[(0,r.Wm)(c,{modelValue:i.form.smtpHost,"onUpdate:modelValue":t[3]||(t[3]=function(e){return i.form.smtpHost=e}),placeholder:"SMTP Host"},null,8,["modelValue"])]})),_:1}),(0,r.Wm)(h,{span:1,style:{"text-align":"center"}},{default:(0,r.w5)((function(){return[l]})),_:1}),(0,r.Wm)(h,{span:6},{default:(0,r.w5)((function(){return[(0,r.Wm)(c,{modelValue:i.form.smtpPort,"onUpdate:modelValue":t[4]||(t[4]=function(e){return i.form.smtpPort=e}),placeholder:"SMTP Port"},null,8,["modelValue"])]})),_:1})]})),_:1}),(0,r.Wm)(w,{label:"启用 SSL",prop:"useSSL"},{default:(0,r.w5)((function(){return[(0,r.Wm)(S,{modelValue:i.form.useSSL,"onUpdate:modelValue":t[5]||(t[5]=function(e){return i.form.useSSL=e})},null,8,["modelValue"])]})),_:1}),(0,r.Wm)(w,{style:{"margin-top":"38px"}},{default:(0,r.w5)((function(){return[(0,r.Wm)(V,{type:"primary",onClick:t[6]||(t[6]=function(e){return s.onSubmit("formRef")})},{default:(0,r.w5)((function(){return[o]})),_:1}),(0,r.Wm)(V,{type:"danger",onClick:t[7]||(t[7]=function(e){return s.onReset()})},{default:(0,r.w5)((function(){return[a]})),_:1})]})),_:1})]})),_:1},8,["model","rules"])]})),_:1})]})),_:1})]})),_:1})}var i=n(48534),s=(n(35666),n(63872)),f="/api/v1.0/settings",d=function(){return s.Z.get(f+"/sys_email")},p=function(e){return s.Z.post(f+"/sys_email",e)},c=function(){return s.Z["delete"](f+"/sys_email")},w={data:function(){return{form:{smtpHost:null,smtpPort:null,username:null,mailFrom:null,password:null,useSSL:!1},formRule:{username:[this.requiredInputValidRule("请输入 SMTP 服务用户名")],password:[this.requiredInputValidRule("请输入 SMTP 服务密码")],smtpHost:[this.requiredInputValidRule("请输入 SMTP 地址")],smtpPort:[this.requiredInputValidRule("请输入 SMTP 端口"),{min:1,max:65535,message:"端口有效值为 1~65535",trigger:"blur"}]}}},mounted:function(){this.fetchSysMail()},methods:{requiredInputValidRule:function(e){return{required:!0,message:e,trigger:"blur"}},fetchSysMail:function(){var e=this;return(0,i.Z)(regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,d().then((function(e){return e.data}));case 2:n=t.sent,n&&(e.form=n);case 4:case"end":return t.stop()}}),t)})))()},onSubmit:function(){var e=this;this.$refs.formRef.validate((function(t){return t?(p(e.form).then((function(t){t.errCode||e.$message.success("更新成功")})),!0):(e.$message.error("请完善表单相关信息!"),!1)}))},onReset:function(){var e=this;this.$confirm("确认重置系统邮件吗?删除后数据将无法恢复","警告",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){c().then((function(t){t.errCode||(e.form={},e.$message.success("重置成功"))}))}))}}},h=n(83744);const S=(0,h.Z)(w,[["render",m]]);var V=S}}]);
|
||||
//# sourceMappingURL=968-legacy.60e0df48.js.map
|
File diff suppressed because one or more lines are too long
|
@ -1,2 +0,0 @@
|
|||
"use strict";(self["webpackChunkdatabasir"]=self["webpackChunkdatabasir"]||[]).push([[968],{89968:function(e,l,t){t.r(l),t.d(l,{default:function(){return S}});var a=t(66252);const o=(0,a.Uk)(" 系统邮箱设置 "),r=(0,a.Uk)(" : "),u=(0,a.Uk)("保存"),m=(0,a.Uk)("重置");function s(e,l,t,s,d,n){const p=(0,a.up)("box"),i=(0,a.up)("el-icon"),f=(0,a.up)("el-divider"),c=(0,a.up)("el-input"),h=(0,a.up)("el-form-item"),w=(0,a.up)("el-col"),S=(0,a.up)("el-switch"),V=(0,a.up)("el-button"),W=(0,a.up)("el-form"),_=(0,a.up)("el-card"),b=(0,a.up)("el-main"),g=(0,a.up)("el-container");return(0,a.wg)(),(0,a.j4)(g,null,{default:(0,a.w5)((()=>[(0,a.Wm)(b,null,{default:(0,a.w5)((()=>[(0,a.Wm)(_,{shadow:"hover",style:{"max-width":"600px"}},{default:(0,a.w5)((()=>[(0,a.Wm)(f,null,{default:(0,a.w5)((()=>[(0,a.Wm)(i,null,{default:(0,a.w5)((()=>[(0,a.Wm)(p)])),_:1}),o])),_:1}),(0,a.Wm)(W,{model:d.form,"label-position":"top",rules:d.formRule,ref:"formRef",style:{"max-width":"900px"}},{default:(0,a.w5)((()=>[(0,a.Wm)(h,{label:"SMTP 用户名",prop:"username"},{default:(0,a.w5)((()=>[(0,a.Wm)(c,{modelValue:d.form.username,"onUpdate:modelValue":l[0]||(l[0]=e=>d.form.username=e),placeholder:"请输入 SMTP 服务用户名"},null,8,["modelValue"])])),_:1}),(0,a.Wm)(h,{label:"SMTP 密码",prop:"password"},{default:(0,a.w5)((()=>[(0,a.Wm)(c,{modelValue:d.form.password,"onUpdate:modelValue":l[1]||(l[1]=e=>d.form.password=e),type:"password",placeholder:"请输入密码","show-password":""},null,8,["modelValue"])])),_:1}),(0,a.Wm)(h,{label:"发送邮箱",prop:"mailFrom"},{default:(0,a.w5)((()=>[(0,a.Wm)(c,{modelValue:d.form.mailFrom,"onUpdate:modelValue":l[2]||(l[2]=e=>d.form.mailFrom=e),placeholder:"请输入邮箱账号"},null,8,["modelValue"])])),_:1}),(0,a.Wm)(h,{label:"SMTP",prop:"smtpHost"},{default:(0,a.w5)((()=>[(0,a.Wm)(w,{span:12},{default:(0,a.w5)((()=>[(0,a.Wm)(c,{modelValue:d.form.smtpHost,"onUpdate:modelValue":l[3]||(l[3]=e=>d.form.smtpHost=e),placeholder:"SMTP Host"},null,8,["modelValue"])])),_:1}),(0,a.Wm)(w,{span:1,style:{"text-align":"center"}},{default:(0,a.w5)((()=>[r])),_:1}),(0,a.Wm)(w,{span:6},{default:(0,a.w5)((()=>[(0,a.Wm)(c,{modelValue:d.form.smtpPort,"onUpdate:modelValue":l[4]||(l[4]=e=>d.form.smtpPort=e),placeholder:"SMTP Port"},null,8,["modelValue"])])),_:1})])),_:1}),(0,a.Wm)(h,{label:"启用 SSL",prop:"useSSL"},{default:(0,a.w5)((()=>[(0,a.Wm)(S,{modelValue:d.form.useSSL,"onUpdate:modelValue":l[5]||(l[5]=e=>d.form.useSSL=e)},null,8,["modelValue"])])),_:1}),(0,a.Wm)(h,{style:{"margin-top":"38px"}},{default:(0,a.w5)((()=>[(0,a.Wm)(V,{type:"primary",onClick:l[6]||(l[6]=e=>n.onSubmit("formRef"))},{default:(0,a.w5)((()=>[u])),_:1}),(0,a.Wm)(V,{type:"danger",onClick:l[7]||(l[7]=e=>n.onReset())},{default:(0,a.w5)((()=>[m])),_:1})])),_:1})])),_:1},8,["model","rules"])])),_:1})])),_:1})])),_:1})}var d=t(63872);const n="/api/v1.0/settings",p=()=>d.Z.get(n+"/sys_email"),i=e=>d.Z.post(n+"/sys_email",e),f=()=>d.Z["delete"](n+"/sys_email");var c={data(){return{form:{smtpHost:null,smtpPort:null,username:null,mailFrom:null,password:null,useSSL:!1},formRule:{username:[this.requiredInputValidRule("请输入 SMTP 服务用户名")],password:[this.requiredInputValidRule("请输入 SMTP 服务密码")],smtpHost:[this.requiredInputValidRule("请输入 SMTP 地址")],smtpPort:[this.requiredInputValidRule("请输入 SMTP 端口"),{min:1,max:65535,message:"端口有效值为 1~65535",trigger:"blur"}]}}},mounted(){this.fetchSysMail()},methods:{requiredInputValidRule(e){return{required:!0,message:e,trigger:"blur"}},async fetchSysMail(){const e=await p().then((e=>e.data));e&&(this.form=e)},onSubmit(){this.$refs.formRef.validate((e=>e?(i(this.form).then((e=>{e.errCode||this.$message.success("更新成功")})),!0):(this.$message.error("请完善表单相关信息!"),!1)))},onReset(){this.$confirm("确认重置系统邮件吗?删除后数据将无法恢复","警告",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((()=>{f().then((e=>{e.errCode||(this.form={},this.$message.success("重置成功"))}))}))}}},h=t(83744);const w=(0,h.Z)(c,[["render",s]]);var S=w}}]);
|
||||
//# sourceMappingURL=968.b4cc67bb.js.map
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -17,5 +17,7 @@ public class SystemEmailResponse {
|
|||
|
||||
private Boolean useSSL;
|
||||
|
||||
private Boolean useTls;
|
||||
|
||||
private LocalDateTime createAt;
|
||||
}
|
||||
|
|
|
@ -26,4 +26,7 @@ public class SystemEmailUpdateRequest {
|
|||
@NotNull
|
||||
private Boolean useSSL;
|
||||
|
||||
@NotNull
|
||||
private Boolean useTls;
|
||||
|
||||
}
|
||||
|
|
|
@ -24,16 +24,17 @@ public class SystemService {
|
|||
|
||||
public Optional<SystemEmailResponse> getEmailSetting() {
|
||||
return sysMailDao.selectOptionTopOne()
|
||||
.map(mail -> {
|
||||
SystemEmailResponse response = new SystemEmailResponse();
|
||||
response.setSmtpHost(mail.getSmtpHost());
|
||||
response.setSmtpPort(mail.getSmtpPort());
|
||||
response.setUsername(mail.getUsername());
|
||||
response.setCreateAt(mail.getCreateAt());
|
||||
response.setMailFrom(mail.getMailFrom());
|
||||
response.setUseSSL(mail.getUseSsl());
|
||||
return response;
|
||||
});
|
||||
.map(mail -> {
|
||||
SystemEmailResponse response = new SystemEmailResponse();
|
||||
response.setSmtpHost(mail.getSmtpHost());
|
||||
response.setSmtpPort(mail.getSmtpPort());
|
||||
response.setUsername(mail.getUsername());
|
||||
response.setCreateAt(mail.getCreateAt());
|
||||
response.setMailFrom(mail.getMailFrom());
|
||||
response.setUseSSL(mail.getUseSsl());
|
||||
response.setUseTls(mail.getUseTls());
|
||||
return response;
|
||||
});
|
||||
}
|
||||
|
||||
public void deleteSystemEmail() {
|
||||
|
@ -50,6 +51,7 @@ public class SystemService {
|
|||
sysMail.setUsername(request.getUsername());
|
||||
sysMail.setMailFrom(request.getMailFrom());
|
||||
sysMail.setUseSsl(request.getUseSSL());
|
||||
sysMail.setUseTls(request.getUseTls());
|
||||
|
||||
Optional<Integer> idOpt = sysMailDao.selectOptionTopOne().map(SysMail::getId);
|
||||
idOpt.ifPresent(sysMail::setId);
|
||||
|
|
|
@ -13,6 +13,7 @@ import javax.mail.internet.MimeMessage;
|
|||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Properties;
|
||||
|
||||
@Component
|
||||
public class MailSender {
|
||||
|
@ -54,11 +55,19 @@ public class MailSender {
|
|||
}
|
||||
sender.setUsername(properties.getUsername());
|
||||
sender.setPassword(properties.getPassword());
|
||||
Properties props = sender.getJavaMailProperties();
|
||||
props.put("mail.smtp.auth", "true");
|
||||
|
||||
if (properties.getUseSsl()) {
|
||||
sender.setProtocol("smtps");
|
||||
props.put("mail.smtp.ssl.enable", "true");
|
||||
} else {
|
||||
sender.setProtocol("smtp");
|
||||
}
|
||||
|
||||
if (properties.getUseTls()) {
|
||||
props.put("mail.smtp.starttls.enable", "true");
|
||||
}
|
||||
sender.setDefaultEncoding(StandardCharsets.UTF_8.name());
|
||||
return sender;
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ jooq {
|
|||
forcedTypes {
|
||||
forcedType {
|
||||
name = 'BOOLEAN'
|
||||
includeExpression = 'deleted|enabled|is.*|use_ssl'
|
||||
includeExpression = 'deleted|enabled|is.*|use_ssl|use_tls'
|
||||
includeTypes = '.*'
|
||||
}
|
||||
forcedType {
|
||||
|
|
|
@ -15,7 +15,7 @@ import org.jooq.ForeignKey;
|
|||
import org.jooq.Identity;
|
||||
import org.jooq.Name;
|
||||
import org.jooq.Record;
|
||||
import org.jooq.Row9;
|
||||
import org.jooq.Row10;
|
||||
import org.jooq.Schema;
|
||||
import org.jooq.Table;
|
||||
import org.jooq.TableField;
|
||||
|
@ -92,6 +92,11 @@ public class SysMailTable extends TableImpl<SysMailRecord> {
|
|||
*/
|
||||
public final TableField<SysMailRecord, String> MAIL_FROM = createField(DSL.name("mail_from"), SQLDataType.VARCHAR(512), this, "");
|
||||
|
||||
/**
|
||||
* The column <code>databasir.sys_mail.use_tls</code>.
|
||||
*/
|
||||
public final TableField<SysMailRecord, Boolean> USE_TLS = createField(DSL.name("use_tls"), SQLDataType.BOOLEAN.nullable(false).defaultValue(DSL.inline("0", SQLDataType.BOOLEAN)), this, "");
|
||||
|
||||
private SysMailTable(Name alias, Table<SysMailRecord> aliased) {
|
||||
this(alias, aliased, null);
|
||||
}
|
||||
|
@ -167,11 +172,11 @@ public class SysMailTable extends TableImpl<SysMailRecord> {
|
|||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Row9 type methods
|
||||
// Row10 type methods
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
@Override
|
||||
public Row9<Integer, String, String, String, Integer, Boolean, LocalDateTime, LocalDateTime, String> fieldsRow() {
|
||||
return (Row9) super.fieldsRow();
|
||||
public Row10<Integer, String, String, String, Integer, Boolean, LocalDateTime, LocalDateTime, String, Boolean> fieldsRow() {
|
||||
return (Row10) super.fieldsRow();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ public class SysMail implements Serializable {
|
|||
private LocalDateTime updateAt;
|
||||
private LocalDateTime createAt;
|
||||
private String mailFrom;
|
||||
private Boolean useTls;
|
||||
|
||||
public SysMail() {}
|
||||
|
||||
|
@ -38,6 +39,7 @@ public class SysMail implements Serializable {
|
|||
this.updateAt = value.updateAt;
|
||||
this.createAt = value.createAt;
|
||||
this.mailFrom = value.mailFrom;
|
||||
this.useTls = value.useTls;
|
||||
}
|
||||
|
||||
public SysMail(
|
||||
|
@ -49,7 +51,8 @@ public class SysMail implements Serializable {
|
|||
Boolean useSsl,
|
||||
LocalDateTime updateAt,
|
||||
LocalDateTime createAt,
|
||||
String mailFrom
|
||||
String mailFrom,
|
||||
Boolean useTls
|
||||
) {
|
||||
this.id = id;
|
||||
this.username = username;
|
||||
|
@ -60,6 +63,7 @@ public class SysMail implements Serializable {
|
|||
this.updateAt = updateAt;
|
||||
this.createAt = createAt;
|
||||
this.mailFrom = mailFrom;
|
||||
this.useTls = useTls;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -188,6 +192,20 @@ public class SysMail implements Serializable {
|
|||
this.mailFrom = mailFrom;
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>databasir.sys_mail.use_tls</code>.
|
||||
*/
|
||||
public Boolean getUseTls() {
|
||||
return this.useTls;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>databasir.sys_mail.use_tls</code>.
|
||||
*/
|
||||
public void setUseTls(Boolean useTls) {
|
||||
this.useTls = useTls;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder("SysMail (");
|
||||
|
@ -201,6 +219,7 @@ public class SysMail implements Serializable {
|
|||
sb.append(", ").append(updateAt);
|
||||
sb.append(", ").append(createAt);
|
||||
sb.append(", ").append(mailFrom);
|
||||
sb.append(", ").append(useTls);
|
||||
|
||||
sb.append(")");
|
||||
return sb.toString();
|
||||
|
|
|
@ -11,8 +11,8 @@ import java.time.LocalDateTime;
|
|||
|
||||
import org.jooq.Field;
|
||||
import org.jooq.Record1;
|
||||
import org.jooq.Record9;
|
||||
import org.jooq.Row9;
|
||||
import org.jooq.Record10;
|
||||
import org.jooq.Row10;
|
||||
import org.jooq.impl.UpdatableRecordImpl;
|
||||
|
||||
|
||||
|
@ -20,7 +20,7 @@ import org.jooq.impl.UpdatableRecordImpl;
|
|||
* This class is generated by jOOQ.
|
||||
*/
|
||||
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
|
||||
public class SysMailRecord extends UpdatableRecordImpl<SysMailRecord> implements Record9<Integer, String, String, String, Integer, Boolean, LocalDateTime, LocalDateTime, String> {
|
||||
public class SysMailRecord extends UpdatableRecordImpl<SysMailRecord> implements Record10<Integer, String, String, String, Integer, Boolean, LocalDateTime, LocalDateTime, String, Boolean> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
@ -150,6 +150,20 @@ public class SysMailRecord extends UpdatableRecordImpl<SysMailRecord> implements
|
|||
return (String) get(8);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>databasir.sys_mail.use_tls</code>.
|
||||
*/
|
||||
public void setUseTls(Boolean value) {
|
||||
set(9, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>databasir.sys_mail.use_tls</code>.
|
||||
*/
|
||||
public Boolean getUseTls() {
|
||||
return (Boolean) get(9);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Primary key information
|
||||
// -------------------------------------------------------------------------
|
||||
|
@ -160,17 +174,17 @@ public class SysMailRecord extends UpdatableRecordImpl<SysMailRecord> implements
|
|||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Record9 type implementation
|
||||
// Record10 type implementation
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
@Override
|
||||
public Row9<Integer, String, String, String, Integer, Boolean, LocalDateTime, LocalDateTime, String> fieldsRow() {
|
||||
return (Row9) super.fieldsRow();
|
||||
public Row10<Integer, String, String, String, Integer, Boolean, LocalDateTime, LocalDateTime, String, Boolean> fieldsRow() {
|
||||
return (Row10) super.fieldsRow();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Row9<Integer, String, String, String, Integer, Boolean, LocalDateTime, LocalDateTime, String> valuesRow() {
|
||||
return (Row9) super.valuesRow();
|
||||
public Row10<Integer, String, String, String, Integer, Boolean, LocalDateTime, LocalDateTime, String, Boolean> valuesRow() {
|
||||
return (Row10) super.valuesRow();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -218,6 +232,11 @@ public class SysMailRecord extends UpdatableRecordImpl<SysMailRecord> implements
|
|||
return SysMailTable.SYS_MAIL.MAIL_FROM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Field<Boolean> field10() {
|
||||
return SysMailTable.SYS_MAIL.USE_TLS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer component1() {
|
||||
return getId();
|
||||
|
@ -263,6 +282,11 @@ public class SysMailRecord extends UpdatableRecordImpl<SysMailRecord> implements
|
|||
return getMailFrom();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean component10() {
|
||||
return getUseTls();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer value1() {
|
||||
return getId();
|
||||
|
@ -308,6 +332,11 @@ public class SysMailRecord extends UpdatableRecordImpl<SysMailRecord> implements
|
|||
return getMailFrom();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean value10() {
|
||||
return getUseTls();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysMailRecord value1(Integer value) {
|
||||
setId(value);
|
||||
|
@ -363,7 +392,13 @@ public class SysMailRecord extends UpdatableRecordImpl<SysMailRecord> implements
|
|||
}
|
||||
|
||||
@Override
|
||||
public SysMailRecord values(Integer value1, String value2, String value3, String value4, Integer value5, Boolean value6, LocalDateTime value7, LocalDateTime value8, String value9) {
|
||||
public SysMailRecord value10(Boolean value) {
|
||||
setUseTls(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysMailRecord values(Integer value1, String value2, String value3, String value4, Integer value5, Boolean value6, LocalDateTime value7, LocalDateTime value8, String value9, Boolean value10) {
|
||||
value1(value1);
|
||||
value2(value2);
|
||||
value3(value3);
|
||||
|
@ -373,6 +408,7 @@ public class SysMailRecord extends UpdatableRecordImpl<SysMailRecord> implements
|
|||
value7(value7);
|
||||
value8(value8);
|
||||
value9(value9);
|
||||
value10(value10);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -390,7 +426,7 @@ public class SysMailRecord extends UpdatableRecordImpl<SysMailRecord> implements
|
|||
/**
|
||||
* Create a detached, initialised SysMailRecord
|
||||
*/
|
||||
public SysMailRecord(Integer id, String username, String password, String smtpHost, Integer smtpPort, Boolean useSsl, LocalDateTime updateAt, LocalDateTime createAt, String mailFrom) {
|
||||
public SysMailRecord(Integer id, String username, String password, String smtpHost, Integer smtpPort, Boolean useSsl, LocalDateTime updateAt, LocalDateTime createAt, String mailFrom, Boolean useTls) {
|
||||
super(SysMailTable.SYS_MAIL);
|
||||
|
||||
setId(id);
|
||||
|
@ -402,6 +438,7 @@ public class SysMailRecord extends UpdatableRecordImpl<SysMailRecord> implements
|
|||
setUpdateAt(updateAt);
|
||||
setCreateAt(createAt);
|
||||
setMailFrom(mailFrom);
|
||||
setUseTls(useTls);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -420,6 +457,7 @@ public class SysMailRecord extends UpdatableRecordImpl<SysMailRecord> implements
|
|||
setUpdateAt(value.getUpdateAt());
|
||||
setCreateAt(value.getCreateAt());
|
||||
setMailFrom(value.getMailFrom());
|
||||
setUseTls(value.getUseTls());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ import org.springframework.data.domain.PageImpl;
|
|||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.domain.Sort;
|
||||
|
||||
import org.jooq.Record;
|
||||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
alter table sys_mail
|
||||
add column `use_tls` BOOLEAN NOT NULL DEFAULT FALSE;
|
|
@ -1 +1 @@
|
|||
Subproject commit 03b1d36965188e7010a55a2a661dcce6003289fe
|
||||
Subproject commit bfe9a7e7bae95229ca50a968fedf2eadc023edb1
|
|
@ -1,5 +1,5 @@
|
|||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
|
Loading…
Reference in New Issue