用户消息通知
This commit is contained in:
57
doc/sql/prod_update/20260209_increase.sql
Normal file
57
doc/sql/prod_update/20260209_increase.sql
Normal file
@@ -0,0 +1,57 @@
|
||||
|
||||
DROP TABLE IF EXISTS user_notice;
|
||||
CREATE TABLE user_notice
|
||||
(
|
||||
id int8 NOT NULL PRIMARY KEY, -- 主键
|
||||
user_id int8 DEFAULT 0 NOT NULL, -- 用户id
|
||||
notice_type int4 DEFAULT 0 NOT NULL, -- 通知类型 0-系统通知 1-app通知 2-market通知
|
||||
has_read int4 DEFAULT 0 NOT NULL, -- 是否已读 0-否 1-是
|
||||
release_time timestamp(6) NULL, -- 阅读时间
|
||||
title VARCHAR(100) NULL, -- 标题
|
||||
content TEXT NULL, -- 内容
|
||||
remarks varchar(200) NULL, -- 备注
|
||||
create_user int8 NULL, -- 创建人
|
||||
create_dept int8 NULL, -- 创建部门
|
||||
create_time timestamp(6) NULL, -- 创建时间
|
||||
update_user int8 NULL, -- 修改人
|
||||
update_time timestamp(6) NULL, -- 修改时间
|
||||
status int4 NULL, -- 状态
|
||||
is_deleted int4 DEFAULT 0 NULL -- 是否已删除
|
||||
);
|
||||
|
||||
COMMENT ON TABLE user_notice IS '用户通知';
|
||||
COMMENT ON COLUMN user_notice.id IS '主键';
|
||||
COMMENT ON COLUMN user_notice.user_id IS '用户id';
|
||||
COMMENT ON COLUMN user_notice.notice_type IS '通知类型 0-系统通知 1-app通知 2-market通知';
|
||||
COMMENT ON COLUMN user_notice.has_read IS '是否已读 0-否 1-是';
|
||||
COMMENT ON COLUMN user_notice.release_time IS '阅读时间';
|
||||
COMMENT ON COLUMN user_notice.title IS '标题';
|
||||
COMMENT ON COLUMN user_notice.content IS '内容';
|
||||
COMMENT ON COLUMN user_notice.remarks IS '备注';
|
||||
COMMENT ON COLUMN user_notice.create_user IS '创建人';
|
||||
COMMENT ON COLUMN user_notice.create_dept IS '创建部门';
|
||||
COMMENT ON COLUMN user_notice.create_time IS '创建时间';
|
||||
COMMENT ON COLUMN user_notice.update_user IS '修改人';
|
||||
COMMENT ON COLUMN user_notice.update_time IS '修改时间';
|
||||
COMMENT ON COLUMN user_notice.status IS '状态';
|
||||
COMMENT ON COLUMN user_notice.is_deleted IS '是否已删除';
|
||||
|
||||
CREATE INDEX CONCURRENTLY idx_user_notice_opt ON user_notice (user_id, has_read ASC, create_time DESC, notice_type) WHERE is_deleted = 0;
|
||||
|
||||
CREATE INDEX CONCURRENTLY idx_user_notice_count ON user_notice (user_id, notice_type, has_read) WHERE is_deleted = 0;
|
||||
|
||||
alter table user_notice owner to yicha1lu;
|
||||
|
||||
---- 后台页面菜单
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2016444412729917441, 0, 'customer', '用户配置', 'menu', '/customer', 'iconfont iconicon_subordinate', 9, 1, -1, 1, '', '', 0);
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2020763647899787265, 2016444412729917441, 'userNotice', '用户通知', 'menu', '/customer/userNotice', null, 1, 1, 0, 1, null, null, 0);
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2020763647899787266, 2020763647899787265, 'userNotice_add', '新增', 'add', '/customer/userNotice/add', 'plus', 1, 2, 1, 1, null, null, 0);
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2020763647899787267, 2020763647899787265, 'userNotice_edit', '修改', 'edit', '/customer/userNotice/edit', 'form', 2, 2, 2, 1, null, null, 0);
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2020763647899787268, 2020763647899787265, 'userNotice_delete', '删除', 'delete', '/api/blade-usernotice/userNotice/remove', 'delete', 3, 2, 3, 1, null, null, 0);
|
||||
INSERT INTO blade_menu (id, parent_id, code, name, alias, path, source, sort, category, action, is_open, component, remark, is_deleted) VALUES (2020763647899787269, 2020763647899787265, 'userNotice_view', '查看', 'view', '/customer/userNotice/view', 'file-text', 4, 2, 2, 1, null, null, 0);
|
||||
|
||||
--- 后台系统参数-字典
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2020766458167353346, 0, 'app_notice_type', '-1', 'app通知类型', 28, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2020766503033823233, 2020766458167353346, 'app_notice_type', '0', '系统通知', 0, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2020766543760515074, 2020766458167353346, 'app_notice_type', '1', 'app通知', 1, '', 0, 1, 0);
|
||||
INSERT INTO blade_dict (id, parent_id, code, dict_key, dict_value, sort, remark, is_sealed, status, is_deleted) VALUES (2020766604569534466, 2020766458167353346, 'app_notice_type', '2', 'market通知', 2, '', 0, 1, 0);
|
||||
Reference in New Issue
Block a user