diff --git a/common/src/main/java/cn/org/gitlink/notification/common/constant/NotificationSystemConstant.java b/common/src/main/java/cn/org/gitlink/notification/common/constant/NotificationSystemConstant.java index 58d6c40..1424d54 100644 --- a/common/src/main/java/cn/org/gitlink/notification/common/constant/NotificationSystemConstant.java +++ b/common/src/main/java/cn/org/gitlink/notification/common/constant/NotificationSystemConstant.java @@ -13,10 +13,12 @@ public class NotificationSystemConstant { //平台编码 public static final String PLATFORM_CODE_GITLINK = "gitlink"; //gitlink平台 public static final String PLATFORM_CODE_HEHUI = "hehui"; //hehui平台 + public static final String PLATFORM_CODE_OSREDM = "osredm"; //红山开源平台 public static final Map PLATFORM_CODE_MAP = new HashMap() { { put("gitlink", PLATFORM_CODE_GITLINK); put("hehui", PLATFORM_CODE_HEHUI); + put("osredm", PLATFORM_CODE_OSREDM); } }; diff --git a/db/osredm-gns-notification.sql b/db/osredm-gns-notification.sql new file mode 100644 index 0000000..582c756 --- /dev/null +++ b/db/osredm-gns-notification.sql @@ -0,0 +1,27 @@ + +USE gitlink_notification; + +-- 2022-02-14 新增红山平台 +INSERT INTO gns_platform_info(platform_code,platform_name,created_at,is_delete) VALUES('osredm','红山平台',NOW(),-1); + +DROP TABLE IF EXISTS `osredm_sys_notification`; +CREATE TABLE `osredm_sys_notification` ( + `id` INT NOT NULL AUTO_INCREMENT, + `sender` INT(11) NOT NULL COMMENT '发送者id', + `receiver` INT(11) NOT NULL COMMENT '接受者id', + `content` TEXT NOT NULL COMMENT '消息内容:富文本', + `notification_url` VARCHAR(2000) DEFAULT NULL COMMENT '消息跳转链接', + `created_at` DATETIME NOT NULL DEFAULT NOW() COMMENT '创建时间', + `status` TINYINT(4) NOT NULL DEFAULT 1 COMMENT '已读状态: 1未读,2已读', + `is_delete` TINYINT(1) NOT NULL DEFAULT '-1' COMMENT '是否删除: -1未删除,1已删除', + PRIMARY KEY (`id`), + KEY `index_on_receiver_and_status` (`receiver`,`status`), + KEY `index_on_status` (`status`) +) ENGINE=INNODB DEFAULT CHARSET=utf8mb3; + +-- 2021-09-10 区分系统消息类型 +ALTER TABLE osredm_sys_notification ADD COLUMN (`type` TINYINT(4) NOT NULL DEFAULT 1 COMMENT '消息类型: 1系统消息,2@我'); + +-- 2021-09-10 新增 source 字段区分消息来源、新增 extra 字段保存额外信息 +ALTER TABLE osredm_sys_notification ADD source varchar(250) NULL COMMENT '消息来源'; +ALTER TABLE osredm_sys_notification ADD extra TEXT NULL COMMENT '额外信息(备用字段)'; \ No newline at end of file diff --git a/middleware/end_docker_compose.sh b/middleware/end_docker_compose.sh old mode 100755 new mode 100644 diff --git a/middleware/services.yml b/middleware/services.yml index bb1bb8f..3ed5fd8 100644 --- a/middleware/services.yml +++ b/middleware/services.yml @@ -16,6 +16,7 @@ services: - ${SQL_SCRIPT_PATH}/gns-notification.sql:/docker-entrypoint-initdb.d/0001.sql - ${SQL_SCRIPT_PATH}/hehui-gns-notification.sql:/docker-entrypoint-initdb.d/0002.sql - ${SQL_SCRIPT_PATH}/gns-email.sql:/docker-entrypoint-initdb.d/0003.sql + - ${SQL_SCRIPT_PATH}/osredm-gns-notification.sql:/docker-entrypoint-initdb.d/0004.sql command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci ports: - ${MYSQL_LOCAL_PORT}:3306 diff --git a/middleware/start_docker_compose.sh b/middleware/start_docker_compose.sh old mode 100755 new mode 100644