【完善】代码生成对 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(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");

View File

@ -49,4 +49,4 @@
"updateOperation" : true,
"listOperationResult" : true
} ]
}
}

View File

@ -140,4 +140,4 @@
"listOperationResult" : true,
"htmlType" : "datetime"
} ]
}
}

View File

@ -131,4 +131,4 @@
"listOperationResult" : true,
"htmlType" : "datetime"
} ]
}
}

View File

@ -140,4 +140,4 @@
"listOperationResult" : true,
"htmlType" : "datetime"
} ]
}
}

View File

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

View File

@ -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;

View File

@ -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;
}

View File

@ -49,5 +49,9 @@ public class MailAccountDO extends BaseDO {
* SSL
*/
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();
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

View File

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