diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/Notification.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/Notification.java index 700d54f1a4..f0b984a4b3 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/Notification.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/Notification.java @@ -1,81 +1,90 @@ package io.metersphere.project.domain; -import io.metersphere.validation.groups.*; +import io.metersphere.validation.groups.Created; +import io.metersphere.validation.groups.Updated; import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.*; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.Size; +import lombok.Data; + import java.io.Serializable; import java.util.ArrayList; import java.util.Arrays; -import lombok.Data; @Data public class Notification implements Serializable { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{notification.id.not_blank}", groups = {Updated.class}) private Long id; - @Schema(description = "通知类型", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "通知类型", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{notification.type.not_blank}", groups = {Created.class}) @Size(min = 1, max = 30, message = "{notification.type.length_range}", groups = {Created.class, Updated.class}) private String type; - @Schema(description = "接收人", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "接收人", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{notification.receiver.not_blank}", groups = {Created.class}) @Size(min = 1, max = 50, message = "{notification.receiver.length_range}", groups = {Created.class, Updated.class}) private String receiver; - @Schema(description = "标题", requiredMode = Schema.RequiredMode.REQUIRED) - @NotBlank(message = "{notification.title.not_blank}", groups = {Created.class}) - @Size(min = 1, max = 255, message = "{notification.title.length_range}", groups = {Created.class, Updated.class}) - private String title; + @Schema(description = "标题", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{notification.subject.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 255, message = "{notification.subject.length_range}", groups = {Created.class, Updated.class}) + private String subject; - @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{notification.status.not_blank}", groups = {Created.class}) @Size(min = 1, max = 30, message = "{notification.status.length_range}", groups = {Created.class, Updated.class}) private String status; - @Schema(description = "创建时间") + @Schema(description = "创建时间") private Long createTime; - @Schema(description = "操作人", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "操作人", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{notification.operator.not_blank}", groups = {Created.class}) @Size(min = 1, max = 50, message = "{notification.operator.length_range}", groups = {Created.class, Updated.class}) private String operator; - @Schema(description = "操作", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "操作", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{notification.operation.not_blank}", groups = {Created.class}) @Size(min = 1, max = 50, message = "{notification.operation.length_range}", groups = {Created.class, Updated.class}) private String operation; - @Schema(description = "资源ID", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "资源ID", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{notification.resource_id.not_blank}", groups = {Created.class}) @Size(min = 1, max = 50, message = "{notification.resource_id.length_range}", groups = {Created.class, Updated.class}) private String resourceId; - @Schema(description = "资源类型", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "资源类型", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{notification.resource_type.not_blank}", groups = {Created.class}) @Size(min = 1, max = 50, message = "{notification.resource_type.length_range}", groups = {Created.class, Updated.class}) private String resourceType; - @Schema(description = "资源名称", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "资源名称", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{notification.resource_name.not_blank}", groups = {Created.class}) @Size(min = 1, max = 255, message = "{notification.resource_name.length_range}", groups = {Created.class, Updated.class}) private String resourceName; + @Schema(description = "通知内容", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{notification.content.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 65535, message = "{notification.content.length_range}", groups = {Created.class, Updated.class}) + private String content; + private static final long serialVersionUID = 1L; public enum Column { id("id", "id", "BIGINT", false), type("type", "type", "VARCHAR", true), receiver("receiver", "receiver", "VARCHAR", false), - title("title", "title", "VARCHAR", false), + subject("subject", "subject", "VARCHAR", false), status("status", "status", "VARCHAR", true), createTime("create_time", "createTime", "BIGINT", false), operator("operator", "operator", "VARCHAR", true), operation("operation", "operation", "VARCHAR", true), resourceId("resource_id", "resourceId", "VARCHAR", false), resourceType("resource_type", "resourceType", "VARCHAR", false), - resourceName("resource_name", "resourceName", "VARCHAR", false); + resourceName("resource_name", "resourceName", "VARCHAR", false), + content("content", "content", "LONGVARCHAR", false); private static final String BEGINNING_DELIMITER = "`"; diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/NotificationExample.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/NotificationExample.java index 770765a98d..b8b86d823a 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/NotificationExample.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/NotificationExample.java @@ -304,73 +304,73 @@ public class NotificationExample { return (Criteria) this; } - public Criteria andTitleIsNull() { - addCriterion("title is null"); + public Criteria andSubjectIsNull() { + addCriterion("subject is null"); return (Criteria) this; } - public Criteria andTitleIsNotNull() { - addCriterion("title is not null"); + public Criteria andSubjectIsNotNull() { + addCriterion("subject is not null"); return (Criteria) this; } - public Criteria andTitleEqualTo(String value) { - addCriterion("title =", value, "title"); + public Criteria andSubjectEqualTo(String value) { + addCriterion("subject =", value, "subject"); return (Criteria) this; } - public Criteria andTitleNotEqualTo(String value) { - addCriterion("title <>", value, "title"); + public Criteria andSubjectNotEqualTo(String value) { + addCriterion("subject <>", value, "subject"); return (Criteria) this; } - public Criteria andTitleGreaterThan(String value) { - addCriterion("title >", value, "title"); + public Criteria andSubjectGreaterThan(String value) { + addCriterion("subject >", value, "subject"); return (Criteria) this; } - public Criteria andTitleGreaterThanOrEqualTo(String value) { - addCriterion("title >=", value, "title"); + public Criteria andSubjectGreaterThanOrEqualTo(String value) { + addCriterion("subject >=", value, "subject"); return (Criteria) this; } - public Criteria andTitleLessThan(String value) { - addCriterion("title <", value, "title"); + public Criteria andSubjectLessThan(String value) { + addCriterion("subject <", value, "subject"); return (Criteria) this; } - public Criteria andTitleLessThanOrEqualTo(String value) { - addCriterion("title <=", value, "title"); + public Criteria andSubjectLessThanOrEqualTo(String value) { + addCriterion("subject <=", value, "subject"); return (Criteria) this; } - public Criteria andTitleLike(String value) { - addCriterion("title like", value, "title"); + public Criteria andSubjectLike(String value) { + addCriterion("subject like", value, "subject"); return (Criteria) this; } - public Criteria andTitleNotLike(String value) { - addCriterion("title not like", value, "title"); + public Criteria andSubjectNotLike(String value) { + addCriterion("subject not like", value, "subject"); return (Criteria) this; } - public Criteria andTitleIn(List values) { - addCriterion("title in", values, "title"); + public Criteria andSubjectIn(List values) { + addCriterion("subject in", values, "subject"); return (Criteria) this; } - public Criteria andTitleNotIn(List values) { - addCriterion("title not in", values, "title"); + public Criteria andSubjectNotIn(List values) { + addCriterion("subject not in", values, "subject"); return (Criteria) this; } - public Criteria andTitleBetween(String value1, String value2) { - addCriterion("title between", value1, value2, "title"); + public Criteria andSubjectBetween(String value1, String value2) { + addCriterion("subject between", value1, value2, "subject"); return (Criteria) this; } - public Criteria andTitleNotBetween(String value1, String value2) { - addCriterion("title not between", value1, value2, "title"); + public Criteria andSubjectNotBetween(String value1, String value2) { + addCriterion("subject not between", value1, value2, "subject"); return (Criteria) this; } diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/NotificationMapper.java b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/NotificationMapper.java index 00d057a244..eabbc67e25 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/NotificationMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/NotificationMapper.java @@ -16,16 +16,22 @@ public interface NotificationMapper { int insertSelective(Notification record); + List selectByExampleWithBLOBs(NotificationExample example); + List selectByExample(NotificationExample example); Notification selectByPrimaryKey(Long id); int updateByExampleSelective(@Param("record") Notification record, @Param("example") NotificationExample example); + int updateByExampleWithBLOBs(@Param("record") Notification record, @Param("example") NotificationExample example); + int updateByExample(@Param("record") Notification record, @Param("example") NotificationExample example); int updateByPrimaryKeySelective(Notification record); + int updateByPrimaryKeyWithBLOBs(Notification record); + int updateByPrimaryKey(Notification record); int batchInsert(@Param("list") List list); diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/NotificationMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/NotificationMapper.xml index a02626b072..ff7ad77cdc 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/NotificationMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/NotificationMapper.xml @@ -5,7 +5,7 @@ - + @@ -14,6 +14,9 @@ + + + @@ -73,9 +76,28 @@ - id, `type`, receiver, title, `status`, create_time, `operator`, `operation`, resource_id, + id, `type`, receiver, subject, `status`, create_time, `operator`, `operation`, resource_id, resource_type, resource_name + + content + + - select + , + from notification where id = #{id,jdbcType=BIGINT} @@ -108,13 +132,15 @@ insert into notification (id, `type`, receiver, - title, `status`, create_time, + subject, `status`, create_time, `operator`, `operation`, resource_id, - resource_type, resource_name) + resource_type, resource_name, content + ) values (#{id,jdbcType=BIGINT}, #{type,jdbcType=VARCHAR}, #{receiver,jdbcType=VARCHAR}, - #{title,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, + #{subject,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{operator,jdbcType=VARCHAR}, #{operation,jdbcType=VARCHAR}, #{resourceId,jdbcType=VARCHAR}, - #{resourceType,jdbcType=VARCHAR}, #{resourceName,jdbcType=VARCHAR}) + #{resourceType,jdbcType=VARCHAR}, #{resourceName,jdbcType=VARCHAR}, #{content,jdbcType=LONGVARCHAR} + ) insert into notification @@ -128,8 +154,8 @@ receiver, - - title, + + subject, `status`, @@ -152,6 +178,9 @@ resource_name, + + content, + @@ -163,8 +192,8 @@ #{receiver,jdbcType=VARCHAR}, - - #{title,jdbcType=VARCHAR}, + + #{subject,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, @@ -187,6 +216,9 @@ #{resourceName,jdbcType=VARCHAR}, + + #{content,jdbcType=LONGVARCHAR}, +