【完善】代码生成对 DM 达梦数据的兼容性

【优化】新增 sslEnable 字段,支持 outlook 邮箱
pull/102/MERGE
YunaiV 2024-04-24 09:35:51 +08:00
parent ca93a858fd
commit ddafd44114
11 changed files with 19 additions and 9 deletions

View File

@ -54,7 +54,6 @@ public class CodegenBuilderTest extends BaseMockitoUnitTest {
when(metaInfo.getJdbcType()).thenReturn(JdbcType.BIGINT); when(metaInfo.getJdbcType()).thenReturn(JdbcType.BIGINT);
when(tableField.getComment()).thenReturn("编号"); when(tableField.getComment()).thenReturn("编号");
when(tableField.isKeyFlag()).thenReturn(true); when(tableField.isKeyFlag()).thenReturn(true);
when(tableField.isKeyIdentityFlag()).thenReturn(true);
IColumnType columnType = mock(IColumnType.class); IColumnType columnType = mock(IColumnType.class);
when(tableField.getColumnType()).thenReturn(columnType); when(tableField.getColumnType()).thenReturn(columnType);
when(columnType.getType()).thenReturn("Long"); when(columnType.getType()).thenReturn("Long");

View File

@ -196,7 +196,6 @@ CREATE TABLE IF NOT EXISTS "infra_codegen_column" (
"column_comment" varchar(500) NOT NULL, "column_comment" varchar(500) NOT NULL,
"nullable" tinyint not null, "nullable" tinyint not null,
"primary_key" tinyint not null, "primary_key" tinyint not null,
"auto_increment" varchar(5) not null,
"ordinal_position" int not null, "ordinal_position" int not null,
"java_type" varchar(32) NOT NULL, "java_type" varchar(32) NOT NULL,
"java_field" varchar(64) NOT NULL, "java_field" varchar(64) NOT NULL,

View File

@ -30,6 +30,9 @@ public class MailAccountRespVO {
@Schema(description = "是否开启 ssl", requiredMode = Schema.RequiredMode.REQUIRED, example = "true") @Schema(description = "是否开启 ssl", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
private Boolean sslEnable; private Boolean sslEnable;
@Schema(description = "是否开启 starttls", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
private Boolean starttlsEnable;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime createTime; private LocalDateTime createTime;

View File

@ -1,10 +1,9 @@
package cn.iocoder.yudao.module.system.controller.admin.mail.vo.account; package cn.iocoder.yudao.module.system.controller.admin.mail.vo.account;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import jakarta.validation.constraints.Email; import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import lombok.Data;
@Schema(description = "管理后台 - 邮箱账号创建/修改 Request VO") @Schema(description = "管理后台 - 邮箱账号创建/修改 Request VO")
@Data @Data
@ -38,4 +37,8 @@ public class MailAccountSaveReqVO {
@NotNull(message = "是否开启 ssl 必填") @NotNull(message = "是否开启 ssl 必填")
private Boolean sslEnable; private Boolean sslEnable;
@Schema(description = "是否开启 starttls", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
@NotNull(message = "是否开启 starttls 必填")
private Boolean starttlsEnable;
} }

View File

@ -49,5 +49,9 @@ public class MailAccountDO extends BaseDO {
* SSL * SSL
*/ */
private Boolean sslEnable; private Boolean sslEnable;
/**
* STARTTLS
*/
private Boolean starttlsEnable;
} }

View File

@ -120,7 +120,8 @@ public class MailSendServiceImpl implements MailSendService {
String from = StrUtil.isNotEmpty(nickname) ? nickname + " <" + account.getMail() + ">" : account.getMail(); String from = StrUtil.isNotEmpty(nickname) ? nickname + " <" + account.getMail() + ">" : account.getMail();
return new MailAccount().setFrom(from).setAuth(true) return new MailAccount().setFrom(from).setAuth(true)
.setUser(account.getUsername()).setPass(account.getPassword().toCharArray()) .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 @VisibleForTesting

View File

@ -520,6 +520,7 @@ CREATE TABLE IF NOT EXISTS "system_mail_account" (
"host" varchar NOT NULL, "host" varchar NOT NULL,
"port" int NOT NULL, "port" int NOT NULL,
"ssl_enable" bit NOT NULL, "ssl_enable" bit NOT NULL,
"starttls_enable" bit NOT NULL,
"creator" varchar DEFAULT '', "creator" varchar DEFAULT '',
"create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updater" varchar DEFAULT '', "updater" varchar DEFAULT '',