From ddafd441140417dc23a5b7e190b5cc9185fd3bdd Mon Sep 17 00:00:00 2001 From: YunaiV Date: Wed, 24 Apr 2024 09:35:51 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=AE=8C=E5=96=84=E3=80=91=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E7=94=9F=E6=88=90=E5=AF=B9=20DM=20=E8=BE=BE=E6=A2=A6?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=9A=84=E5=85=BC=E5=AE=B9=E6=80=A7=20?= =?UTF-8?q?=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91=E6=96=B0=E5=A2=9E=20sslEna?= =?UTF-8?q?ble=20=E5=AD=97=E6=AE=B5=EF=BC=8C=E6=94=AF=E6=8C=81=20outlook?= =?UTF-8?q?=20=E9=82=AE=E7=AE=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../infra/service/codegen/inner/CodegenBuilderTest.java | 1 - .../src/test/resources/codegen/table/category.json | 2 +- .../src/test/resources/codegen/table/contact.json | 2 +- .../src/test/resources/codegen/table/student.json | 2 +- .../src/test/resources/codegen/table/teacher.json | 2 +- .../src/test/resources/sql/create_tables.sql | 1 - .../admin/mail/vo/account/MailAccountRespVO.java | 3 +++ .../admin/mail/vo/account/MailAccountSaveReqVO.java | 7 +++++-- .../module/system/dal/dataobject/mail/MailAccountDO.java | 4 ++++ .../module/system/service/mail/MailSendServiceImpl.java | 3 ++- .../src/test/resources/sql/create_tables.sql | 1 + 11 files changed, 19 insertions(+), 9 deletions(-) diff --git a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/codegen/inner/CodegenBuilderTest.java b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/codegen/inner/CodegenBuilderTest.java index ce283ec51..7a26ea9cc 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/codegen/inner/CodegenBuilderTest.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/codegen/inner/CodegenBuilderTest.java @@ -54,7 +54,6 @@ public class CodegenBuilderTest extends BaseMockitoUnitTest { when(metaInfo.getJdbcType()).thenReturn(JdbcType.BIGINT); when(tableField.getComment()).thenReturn("编号"); when(tableField.isKeyFlag()).thenReturn(true); - when(tableField.isKeyIdentityFlag()).thenReturn(true); IColumnType columnType = mock(IColumnType.class); when(tableField.getColumnType()).thenReturn(columnType); when(columnType.getType()).thenReturn("Long"); diff --git a/yudao-module-infra/yudao-module-infra-biz/src/test/resources/codegen/table/category.json b/yudao-module-infra/yudao-module-infra-biz/src/test/resources/codegen/table/category.json index ea58fc3f3..033c048a5 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/test/resources/codegen/table/category.json +++ b/yudao-module-infra/yudao-module-infra-biz/src/test/resources/codegen/table/category.json @@ -49,4 +49,4 @@ "updateOperation" : true, "listOperationResult" : true } ] -} +} \ No newline at end of file diff --git a/yudao-module-infra/yudao-module-infra-biz/src/test/resources/codegen/table/contact.json b/yudao-module-infra/yudao-module-infra-biz/src/test/resources/codegen/table/contact.json index 1ce00a90e..74f92cd1d 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/test/resources/codegen/table/contact.json +++ b/yudao-module-infra/yudao-module-infra-biz/src/test/resources/codegen/table/contact.json @@ -140,4 +140,4 @@ "listOperationResult" : true, "htmlType" : "datetime" } ] -} +} \ No newline at end of file diff --git a/yudao-module-infra/yudao-module-infra-biz/src/test/resources/codegen/table/student.json b/yudao-module-infra/yudao-module-infra-biz/src/test/resources/codegen/table/student.json index 29cb071eb..efe8af4a2 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/test/resources/codegen/table/student.json +++ b/yudao-module-infra/yudao-module-infra-biz/src/test/resources/codegen/table/student.json @@ -131,4 +131,4 @@ "listOperationResult" : true, "htmlType" : "datetime" } ] -} +} \ No newline at end of file diff --git a/yudao-module-infra/yudao-module-infra-biz/src/test/resources/codegen/table/teacher.json b/yudao-module-infra/yudao-module-infra-biz/src/test/resources/codegen/table/teacher.json index 2fcb475a1..4d93518eb 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/test/resources/codegen/table/teacher.json +++ b/yudao-module-infra/yudao-module-infra-biz/src/test/resources/codegen/table/teacher.json @@ -140,4 +140,4 @@ "listOperationResult" : true, "htmlType" : "datetime" } ] -} +} \ No newline at end of file diff --git a/yudao-module-infra/yudao-module-infra-biz/src/test/resources/sql/create_tables.sql b/yudao-module-infra/yudao-module-infra-biz/src/test/resources/sql/create_tables.sql index d4ca2b80e..d4b19c926 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/test/resources/sql/create_tables.sql +++ b/yudao-module-infra/yudao-module-infra-biz/src/test/resources/sql/create_tables.sql @@ -196,7 +196,6 @@ CREATE TABLE IF NOT EXISTS "infra_codegen_column" ( "column_comment" varchar(500) NOT NULL, "nullable" tinyint not null, "primary_key" tinyint not null, - "auto_increment" varchar(5) not null, "ordinal_position" int not null, "java_type" varchar(32) NOT NULL, "java_field" varchar(64) NOT NULL, diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountRespVO.java index c1dc376df..15232b218 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountRespVO.java @@ -30,6 +30,9 @@ public class MailAccountRespVO { @Schema(description = "是否开启 ssl", requiredMode = Schema.RequiredMode.REQUIRED, example = "true") private Boolean sslEnable; + @Schema(description = "是否开启 starttls", requiredMode = Schema.RequiredMode.REQUIRED, example = "true") + private Boolean starttlsEnable; + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) private LocalDateTime createTime; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountSaveReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountSaveReqVO.java index f7c84a561..d99d42f61 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountSaveReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountSaveReqVO.java @@ -1,10 +1,9 @@ package cn.iocoder.yudao.module.system.controller.admin.mail.vo.account; import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - import jakarta.validation.constraints.Email; import jakarta.validation.constraints.NotNull; +import lombok.Data; @Schema(description = "管理后台 - 邮箱账号创建/修改 Request VO") @Data @@ -38,4 +37,8 @@ public class MailAccountSaveReqVO { @NotNull(message = "是否开启 ssl 必填") private Boolean sslEnable; + @Schema(description = "是否开启 starttls", requiredMode = Schema.RequiredMode.REQUIRED, example = "true") + @NotNull(message = "是否开启 starttls 必填") + private Boolean starttlsEnable; + } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/mail/MailAccountDO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/mail/MailAccountDO.java index 275fc8570..0f9588616 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/mail/MailAccountDO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/mail/MailAccountDO.java @@ -49,5 +49,9 @@ public class MailAccountDO extends BaseDO { * 是否开启 SSL */ private Boolean sslEnable; + /** + * 是否开启 STARTTLS + */ + private Boolean starttlsEnable; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/mail/MailSendServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/mail/MailSendServiceImpl.java index 178a64aec..306b05c04 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/mail/MailSendServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/mail/MailSendServiceImpl.java @@ -120,7 +120,8 @@ public class MailSendServiceImpl implements MailSendService { String from = StrUtil.isNotEmpty(nickname) ? nickname + " <" + account.getMail() + ">" : account.getMail(); return new MailAccount().setFrom(from).setAuth(true) .setUser(account.getUsername()).setPass(account.getPassword().toCharArray()) - .setHost(account.getHost()).setPort(account.getPort()).setSslEnable(account.getSslEnable()); + .setHost(account.getHost()).setPort(account.getPort()) + .setSslEnable(account.getSslEnable()).setStarttlsEnable(account.getStarttlsEnable()); } @VisibleForTesting diff --git a/yudao-module-system/yudao-module-system-biz/src/test/resources/sql/create_tables.sql b/yudao-module-system/yudao-module-system-biz/src/test/resources/sql/create_tables.sql index 8f1ac5e0a..087540a6e 100644 --- a/yudao-module-system/yudao-module-system-biz/src/test/resources/sql/create_tables.sql +++ b/yudao-module-system/yudao-module-system-biz/src/test/resources/sql/create_tables.sql @@ -520,6 +520,7 @@ CREATE TABLE IF NOT EXISTS "system_mail_account" ( "host" varchar NOT NULL, "port" int NOT NULL, "ssl_enable" bit NOT NULL, + "starttls_enable" bit NOT NULL, "creator" varchar DEFAULT '', "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, "updater" varchar DEFAULT '',