
create table t_mini_app_user(
    id bigint primary key auto_increment comment '编号',
    nick_name varchar(255) comment '昵称',
    avatar varchar(255) comment '头像',
    open_id varchar(255) comment '用户唯一标识',
    sex varchar(255) comment '性别',
    mini_app_id bigint comment '归属小程序id',
    remark varchar(255) comment '备注',
    create_time datetime comment '创建时间',
    update_time datetime comment '更新时间'
)engine Innodb default charset utf8mb4 comment '小程序用户';

create table t_mini_app(
    id bigint primary key auto_increment comment '编号',
    name varchar(255) comment '小程序名称',
    appid varchar(255) comment '小程序appid',
    secret varchar(255) comment '小程序密钥',
    token varchar(255) comment '令牌',
    aes_key varchar(255) comment '消息加密密钥',
    msg_data_format varchar(255) comment '数据格式 JSON/XML',
    theme_color varchar(255) default '#3c96f3' comment '主题色',
    remark varchar(255) comment '备注',
    create_time datetime comment '创建时间',
    update_time datetime comment '更新时间'
)engine Innodb default charset utf8mb4 comment '小程序信息';

alter table t_mini_app_user add unique index idx_open_id_mini_app_id (open_id, mini_app_id);

insert into sys_menu (menu_id,menu_name,parent_id,order_num,path,component,query,route_name,is_frame,is_cache,menu_type,visible,status,perms,icon,create_by,create_time,update_by,remark) values (2000,'小程序管理',0,0,'miniapp',NULL, NULL, '', 1, 0, 'M', '0', '0', NULL, 'wechat', 'admin', sysdate(), '', '');
insert into sys_menu (menu_id,menu_name,parent_id,order_num,path,component,query,route_name,is_frame,is_cache,menu_type,visible,status,perms,icon,create_by,create_time,update_by,remark) values (2001,'小程序信息',2000,1,'miniapp','basics/miniapp/index', NULL, '', 1, 0, 'C', '0', '0', 'basics:miniapp:list', 'form', 'admin', sysdate(), 'admin', '小程序信息菜单');
insert into sys_menu (menu_id,menu_name,parent_id,order_num,path,component,query,route_name,is_frame,is_cache,menu_type,visible,status,perms,icon,create_by,create_time,update_by,remark) values (2002,'小程序信息查询',2001,1,'#','', NULL, '', 1, 0, 'F', '0', '0', 'basics:miniapp:query', '#', 'admin', sysdate(), '', '');
insert into sys_menu (menu_id,menu_name,parent_id,order_num,path,component,query,route_name,is_frame,is_cache,menu_type,visible,status,perms,icon,create_by,create_time,update_by,remark) values (2003,'小程序信息新增',2001,2,'#','', NULL, '', 1, 0, 'F', '0', '0', 'basics:miniapp:add', '#', 'admin', sysdate(), '', '');
insert into sys_menu (menu_id,menu_name,parent_id,order_num,path,component,query,route_name,is_frame,is_cache,menu_type,visible,status,perms,icon,create_by,create_time,update_by,remark) values (2004,'小程序信息修改',2001,3,'#','', NULL, '', 1, 0, 'F', '0', '0', 'basics:miniapp:edit', '#', 'admin', sysdate(), '', '');
insert into sys_menu (menu_id,menu_name,parent_id,order_num,path,component,query,route_name,is_frame,is_cache,menu_type,visible,status,perms,icon,create_by,create_time,update_by,remark) values (2005,'小程序信息删除',2001,4,'#','', NULL, '', 1, 0, 'F', '0', '0', 'basics:miniapp:remove', '#', 'admin', sysdate(), '', '');
insert into sys_menu (menu_id,menu_name,parent_id,order_num,path,component,query,route_name,is_frame,is_cache,menu_type,visible,status,perms,icon,create_by,create_time,update_by,remark) values (2006,'小程序信息导出',2001,5,'#','', NULL, '', 1, 0, 'F', '0', '0', 'basics:miniapp:export', '#', 'admin', sysdate(), '', '');
insert into sys_menu (menu_id,menu_name,parent_id,order_num,path,component,query,route_name,is_frame,is_cache,menu_type,visible,status,perms,icon,create_by,create_time,update_by,remark) values (2007,'小程序用户',2000,1,'miniappUser','basics/miniappUser/index', NULL, '', 1, 0, 'C', '0', '0', 'basics:miniappUser:list', 'people', 'admin', sysdate(), 'admin', '小程序用户菜单');
insert into sys_menu (menu_id,menu_name,parent_id,order_num,path,component,query,route_name,is_frame,is_cache,menu_type,visible,status,perms,icon,create_by,create_time,update_by,remark) values (2008,'小程序用户查询',2007,1,'#','', NULL, '', 1, 0, 'F', '0', '0', 'basics:miniappUser:query', '#', 'admin', sysdate(), '', '');
insert into sys_menu (menu_id,menu_name,parent_id,order_num,path,component,query,route_name,is_frame,is_cache,menu_type,visible,status,perms,icon,create_by,create_time,update_by,remark) values (2009,'小程序用户新增',2007,2,'#','', NULL, '', 1, 0, 'F', '0', '0', 'basics:miniappUser:add', '#', 'admin', sysdate(), '', '');
insert into sys_menu (menu_id,menu_name,parent_id,order_num,path,component,query,route_name,is_frame,is_cache,menu_type,visible,status,perms,icon,create_by,create_time,update_by,remark) values (2010,'小程序用户修改',2007,3,'#','', NULL, '', 1, 0, 'F', '0', '0', 'basics:miniappUser:edit', '#', 'admin', sysdate(), '', '');
insert into sys_menu (menu_id,menu_name,parent_id,order_num,path,component,query,route_name,is_frame,is_cache,menu_type,visible,status,perms,icon,create_by,create_time,update_by,remark) values (2011,'小程序用户删除',2007,4,'#','', NULL, '', 1, 0, 'F', '0', '0', 'basics:miniappUser:remove', '#', 'admin', sysdate(), '', '');
insert into sys_menu (menu_id,menu_name,parent_id,order_num,path,component,query,route_name,is_frame,is_cache,menu_type,visible,status,perms,icon,create_by,create_time,update_by,remark) values (2012,'小程序用户导出',2007,5, '', '', NULL, '', 1, 0, 'F', '0', '0', 'basics:miniappUser:export', '#', 'admin', sysdate(), '', '');
