增加构建通知

This commit is contained in:
dengqichen 2025-11-13 13:27:04 +08:00
parent 49c65b6886
commit 41c7a88542
5 changed files with 65 additions and 27 deletions

View File

@ -34,16 +34,31 @@ public class TeamEnvironmentNotificationConfigDTO extends BaseDTO {
*/
private Boolean deployNotificationEnabled;
/**
* 部署通知模板ID
*/
private Long deployNotificationTemplateId;
/**
* 是否启用构建通知
*/
private Boolean buildNotificationEnabled;
/**
* 构建通知模板ID
*/
private Long buildNotificationTemplateId;
/**
* 构建失败时是否发送日志文件到企业微信
*/
private Boolean buildFailureFileEnabled;
/**
* 构建失败通知模板ID
*/
private Long buildFailureNotificationTemplateId;
// ===== 扩展字段非数据库字段 =====
/**

View File

@ -25,18 +25,36 @@ public class UserTeamEnvironmentNotificationConfigDTO {
@Schema(description = "是否启用部署通知")
private Boolean deployNotificationEnabled;
/**
* 部署通知模板ID
*/
@Schema(description = "部署通知模板ID")
private Long deployNotificationTemplateId;
/**
* 是否启用构建通知
*/
@Schema(description = "是否启用构建通知")
private Boolean buildNotificationEnabled;
/**
* 构建通知模板ID
*/
@Schema(description = "构建通知模板ID")
private Long buildNotificationTemplateId;
/**
* 构建失败时是否发送日志文件到企业微信
*/
@Schema(description = "构建失败时是否发送日志文件到企业微信")
private Boolean buildFailureFileEnabled;
/**
* 构建失败通知模板ID
*/
@Schema(description = "构建失败通知模板ID")
private Long buildFailureNotificationTemplateId;
// ===== 扩展字段非数据库字段 =====
/**

View File

@ -13,14 +13,14 @@ import java.util.List;
/**
* 团队环境配置实体
*
*
* <p>定义团队对特定环境的配置
* <ul>
* <li>审批配置是否需要审批审批人列表</li>
* <li>通知配置通知渠道是否启用</li>
* <li>安全策略代码审查要求</li>
* </ul>
*
*
* <p>数据迁移说明
* 本表由 deploy_team_config 重构而来将原来的 JSON 数组结构展开为标准表结构
* <pre>
@ -39,7 +39,7 @@ import java.util.List;
public class TeamEnvironmentConfig extends Entity<Long> {
// ===== 关联关系 =====
/**
* 团队ID
*/
@ -53,7 +53,7 @@ public class TeamEnvironmentConfig extends Entity<Long> {
private Long environmentId;
// ===== 审批配置 =====
/**
* 是否需要审批
* <p>对应原 TeamConfig.environmentApprovalRequired[i]
@ -70,23 +70,7 @@ public class TeamEnvironmentConfig extends Entity<Long> {
@Column(name = "approver_user_ids", columnDefinition = "JSON")
private List<Long> approverUserIds;
// ===== 通知配置 =====
/**
* 通知渠道ID
* <p>关联 sys_notification_channel
*/
@Column(name = "notification_channel_id")
private Long notificationChannelId;
/**
* 是否启用部署通知
*/
@Column(name = "notification_enabled", nullable = false, columnDefinition = "BOOLEAN DEFAULT TRUE")
private Boolean notificationEnabled = true;
// ===== 安全策略 =====
/**
* 是否要求代码审查通过才能部署
*/
@ -94,7 +78,7 @@ public class TeamEnvironmentConfig extends Entity<Long> {
private Boolean requireCodeReview = false;
// ===== 备注 =====
/**
* 备注信息
*/

View File

@ -51,15 +51,33 @@ public class TeamEnvironmentNotificationConfig extends Entity<Long> {
@Column(name = "deploy_notification_enabled", nullable = false, columnDefinition = "BIT DEFAULT 1")
private Boolean deployNotificationEnabled = true;
/**
* 部署通知模板ID关联sys_notification_template
*/
@Column(name = "deploy_notification_template_id")
private Long deployNotificationTemplateId;
/**
* 是否启用构建通知
*/
@Column(name = "build_notification_enabled", nullable = false)
private Boolean buildNotificationEnabled = false;
/**
* 构建通知模板ID关联sys_notification_template
*/
@Column(name = "build_notification_template_id")
private Long buildNotificationTemplateId;
/**
* 构建失败时是否发送日志文件到企业微信
*/
@Column(name = "build_failure_file_enabled", nullable = false)
private Boolean buildFailureFileEnabled = false;
/**
* 构建失败通知模板ID关联sys_notification_template
*/
@Column(name = "build_failure_notification_template_id")
private Long buildFailureNotificationTemplateId;
}

View File

@ -869,13 +869,16 @@ CREATE TABLE deploy_team_environment_notification_config
version INT NOT NULL DEFAULT 1 COMMENT '版本号',
deleted BIT NOT NULL DEFAULT 0 COMMENT '是否删除',
team_id BIGINT NOT NULL COMMENT '团队ID',
environment_id BIGINT NOT NULL COMMENT '环境ID',
team_id BIGINT NOT NULL COMMENT '团队ID',
environment_id BIGINT NOT NULL COMMENT '环境ID',
notification_channel_id BIGINT NULL COMMENT '通知渠道ID关联sys_notification_channel',
deploy_notification_enabled BIT NOT NULL DEFAULT 1 COMMENT '是否启用部署通知',
build_notification_enabled BIT NOT NULL DEFAULT 0 COMMENT '是否启用构建通知',
build_failure_log_enabled BIT NOT NULL DEFAULT 0 COMMENT '构建失败时是否附加错误日志到通知0不附加1附加',
notification_channel_id BIGINT NULL COMMENT '通知渠道ID关联sys_notification_channel',
deploy_notification_enabled BIT NOT NULL DEFAULT 1 COMMENT '是否启用部署通知',
deploy_notification_template_id BIGINT NULL COMMENT '部署通知模板ID关联sys_notification_template',
build_notification_enabled BIT NOT NULL DEFAULT 0 COMMENT '是否启用构建通知',
build_notification_template_id BIGINT NULL COMMENT '构建通知模板ID关联sys_notification_template',
build_failure_log_enabled BIT NOT NULL DEFAULT 0 COMMENT '构建失败时是否附加错误日志到通知0不附加1附加',
build_failure_notification_template_id BIGINT NULL COMMENT '构建失败通知模板ID关联sys_notification_template',
UNIQUE INDEX uk_team_env (team_id, environment_id),
INDEX idx_team (team_id),