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 '',