From fe8d987527bbf5c6559a5baf88315bb40d8f38be Mon Sep 17 00:00:00 2001 From: cuijiawang Date: Wed, 24 Sep 2025 16:41:06 +0800 Subject: [PATCH 1/2] del --- agileboot-system/sql/agileboot-20230814.sql | 362 --------------- agileboot-system/sql/agileboot_20221007.sql | 428 ------------------ agileboot-system/sql/combine.sh | 24 - .../main/java/com/agileboot/api/system/ststem | 0 4 files changed, 814 deletions(-) delete mode 100644 agileboot-system/sql/agileboot-20230814.sql delete mode 100644 agileboot-system/sql/agileboot_20221007.sql delete mode 100644 agileboot-system/sql/combine.sh delete mode 100644 agileboot-system/wol-api/src/main/java/com/agileboot/api/system/ststem diff --git a/agileboot-system/sql/agileboot-20230814.sql b/agileboot-system/sql/agileboot-20230814.sql deleted file mode 100644 index 2b6e222..0000000 --- a/agileboot-system/sql/agileboot-20230814.sql +++ /dev/null @@ -1,362 +0,0 @@ -create table sys_config -( - config_id int auto_increment comment '参数主键' - primary key, - config_name varchar(128) default '' not null comment '配置名称', - config_key varchar(128) default '' not null comment '配置键名', - config_options varchar(1024) default '' not null comment '可选的选项', - config_value varchar(256) default '' not null comment '配置值', - is_allow_change tinyint(1) not null comment '是否允许修改', - creator_id bigint null comment '创建者ID', - updater_id bigint null comment '更新者ID', - update_time datetime null comment '更新时间', - create_time datetime null comment '创建时间', - remark varchar(128) null comment '备注', - deleted tinyint(1) default 0 not null comment '逻辑删除', - constraint config_key_uniq_idx - unique (config_key) -) - comment '参数配置表'; - -INSERT INTO sys_config (config_id, config_name, config_key, config_options, config_value, is_allow_change, creator_id, updater_id, update_time, create_time, remark, deleted) VALUES (1, '主框架页-默认皮肤样式名称', 'sys.index.skinName', '["skin-blue","skin-green","skin-purple","skin-red","skin-yellow"]', 'skin-blue', 1, null, null, '2022-08-28 22:12:19', '2022-05-21 08:30:55', '蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow', 0); -INSERT INTO sys_config (config_id, config_name, config_key, config_options, config_value, is_allow_change, creator_id, updater_id, update_time, create_time, remark, deleted) VALUES (2, '用户管理-账号初始密码', 'sys.user.initPassword', '', '123456', 1, null, 1, '2023-07-20 14:42:08', '2022-05-21 08:30:55', '初始化密码 123456', 0); -INSERT INTO sys_config (config_id, config_name, config_key, config_options, config_value, is_allow_change, creator_id, updater_id, update_time, create_time, remark, deleted) VALUES (3, '主框架页-侧边栏主题', 'sys.index.sideTheme', '["theme-dark","theme-light"]', 'theme-dark', 1, null, null, '2022-08-28 22:12:15', '2022-08-20 08:30:55', '深色主题theme-dark,浅色主题theme-light', 0); -INSERT INTO sys_config (config_id, config_name, config_key, config_options, config_value, is_allow_change, creator_id, updater_id, update_time, create_time, remark, deleted) VALUES (4, '账号自助-验证码开关', 'sys.account.captchaOnOff', '["true","false"]', 'false', 0, null, 1, '2023-07-20 14:39:36', '2022-05-21 08:30:55', '是否开启验证码功能(true开启,false关闭)', 0); -INSERT INTO sys_config (config_id, config_name, config_key, config_options, config_value, is_allow_change, creator_id, updater_id, update_time, create_time, remark, deleted) VALUES (5, '账号自助-是否开启用户注册功能', 'sys.account.registerUser', '["true","false"]', 'true', 0, null, 1, '2022-10-05 22:18:57', '2022-05-21 08:30:55', '是否开启注册用户功能(true开启,false关闭)', 0); - -create table sys_dept -( - dept_id bigint auto_increment comment '部门id' - primary key, - parent_id bigint default 0 not null comment '父部门id', - ancestors text not null comment '祖级列表', - dept_name varchar(64) default '' not null comment '部门名称', - order_num int default 0 not null comment '显示顺序', - leader_id bigint null, - leader_name varchar(64) null comment '负责人', - phone varchar(16) null comment '联系电话', - email varchar(128) null comment '邮箱', - status smallint default 0 not null comment '部门状态(0停用 1启用)', - creator_id bigint null comment '创建者ID', - create_time datetime null comment '创建时间', - updater_id bigint null comment '更新者ID', - update_time datetime null comment '更新时间', - deleted tinyint(1) default 0 not null comment '逻辑删除' -) - comment '部门表'; - -INSERT INTO sys_dept (dept_id, parent_id, ancestors, dept_name, order_num, leader_id, leader_name, phone, email, status, creator_id, create_time, updater_id, update_time, deleted) VALUES (1, 0, '0', 'AgileBoot科技', 0, null, 'valarchie', '15888888888', 'valarchie@163.com', 1, null, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_dept (dept_id, parent_id, ancestors, dept_name, order_num, leader_id, leader_name, phone, email, status, creator_id, create_time, updater_id, update_time, deleted) VALUES (2, 1, '0,1', '深圳总公司', 1, null, 'valarchie', '15888888888', 'valarchie@163.com', 1, null, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_dept (dept_id, parent_id, ancestors, dept_name, order_num, leader_id, leader_name, phone, email, status, creator_id, create_time, updater_id, update_time, deleted) VALUES (3, 1, '0,1', '长沙分公司', 2, null, 'valarchie', '15888888888', 'valarchie@163.com', 1, null, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_dept (dept_id, parent_id, ancestors, dept_name, order_num, leader_id, leader_name, phone, email, status, creator_id, create_time, updater_id, update_time, deleted) VALUES (4, 2, '0,1,2', '研发部门', 1, null, 'valarchie', '15888888888', 'valarchie@163.com', 1, null, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_dept (dept_id, parent_id, ancestors, dept_name, order_num, leader_id, leader_name, phone, email, status, creator_id, create_time, updater_id, update_time, deleted) VALUES (5, 2, '0,1,2', '市场部门', 2, null, 'valarchie', '15888888888', 'valarchie@163.com', 0, null, '2022-05-21 08:30:54', 1, '2023-07-20 22:46:41', 0); -INSERT INTO sys_dept (dept_id, parent_id, ancestors, dept_name, order_num, leader_id, leader_name, phone, email, status, creator_id, create_time, updater_id, update_time, deleted) VALUES (6, 2, '0,1,2', '测试部门', 3, null, 'valarchie', '15888888888', 'valarchie@163.com', 1, null, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_dept (dept_id, parent_id, ancestors, dept_name, order_num, leader_id, leader_name, phone, email, status, creator_id, create_time, updater_id, update_time, deleted) VALUES (7, 2, '0,1,2', '财务部门', 4, null, 'valarchie', '15888888888', 'valarchie@163.com', 1, null, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_dept (dept_id, parent_id, ancestors, dept_name, order_num, leader_id, leader_name, phone, email, status, creator_id, create_time, updater_id, update_time, deleted) VALUES (8, 2, '0,1,2', '运维部门', 5, null, 'valarchie', '15888888888', 'valarchie@163.com', 1, null, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_dept (dept_id, parent_id, ancestors, dept_name, order_num, leader_id, leader_name, phone, email, status, creator_id, create_time, updater_id, update_time, deleted) VALUES (9, 3, '0,1,3', '市场部!', 1, null, 'valarchie!!', '15888188888', 'valarc1hie@163.com', 0, null, '2022-05-21 08:30:54', 1, '2023-07-20 22:33:31', 0); -INSERT INTO sys_dept (dept_id, parent_id, ancestors, dept_name, order_num, leader_id, leader_name, phone, email, status, creator_id, create_time, updater_id, update_time, deleted) VALUES (10, 3, '0,1,3', '财务部门', 2, null, 'valarchie', '15888888888', 'valarchie@163.com', 0, null, '2022-05-21 08:30:54', null, null, 0); - -create table sys_login_info -( - info_id bigint auto_increment comment '访问ID' - primary key, - username varchar(50) default '' not null comment '用户账号', - ip_address varchar(128) default '' not null comment '登录IP地址', - login_location varchar(255) default '' not null comment '登录地点', - browser varchar(50) default '' not null comment '浏览器类型', - operation_system varchar(50) default '' not null comment '操作系统', - status smallint default 0 not null comment '登录状态(1成功 0失败)', - msg varchar(255) default '' not null comment '提示消息', - login_time datetime null comment '访问时间', - deleted tinyint(1) default 0 not null comment '逻辑删除' -) - comment '系统访问记录'; - -INSERT INTO sys_login_info (info_id, username, ip_address, login_location, browser, operation_system, status, msg, login_time, deleted) VALUES (415, 'admin', '127.0.0.1', '内网IP', 'Chrome 11', 'Mac OS X', 1, '登录成功', '2023-06-29 22:49:37', 0); -INSERT INTO sys_login_info (info_id, username, ip_address, login_location, browser, operation_system, status, msg, login_time, deleted) VALUES (416, 'admin', '127.0.0.1', '内网IP', 'Chrome 11', 'Mac OS X', 1, '登录成功', '2023-07-02 22:12:30', 0); -INSERT INTO sys_login_info (info_id, username, ip_address, login_location, browser, operation_system, status, msg, login_time, deleted) VALUES (417, 'admin', '127.0.0.1', '内网IP', 'Chrome 11', 'Mac OS X', 0, '验证码过期', '2023-07-02 22:16:06', 0); - -create table sys_menu -( - menu_id bigint auto_increment comment '菜单ID' - primary key, - menu_name varchar(64) not null comment '菜单名称', - menu_type smallint default 0 not null comment '菜单的类型(1为普通菜单2为目录3为内嵌iFrame4为外链跳转)', - router_name varchar(255) default '' not null comment '路由名称(需保持和前端对应的vue文件中的name保持一致defineOptions方法中设置的name)', - parent_id bigint default 0 not null comment '父菜单ID', - path varchar(255) null comment '组件路径(对应前端项目view文件夹中的路径)', - is_button tinyint(1) default 0 not null comment '是否按钮', - permission varchar(128) null comment '权限标识', - meta_info varchar(1024) default '{}' not null comment '路由元信息(前端根据这个信息进行逻辑处理)', - status smallint default 0 not null comment '菜单状态(1启用 0停用)', - remark varchar(256) default '' null comment '备注', - creator_id bigint null comment '创建者ID', - create_time datetime null comment '创建时间', - updater_id bigint null comment '更新者ID', - update_time datetime null comment '更新时间', - deleted tinyint(1) default 0 not null comment '逻辑删除' -) - comment '菜单权限表'; - -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (1, '系统管理', 2, '', 0, '/system', 0, '', '{"title":"系统管理","icon":"ep:management","showParent":true,"rank":1}', 1, '系统管理目录', 0, '2022-05-21 08:30:54', 1, '2023-08-14 23:08:50', 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (2, '系统监控', 2, '', 0, '/monitor', 0, '', '{"title":"系统监控","icon":"ep:monitor","showParent":true,"rank":3}', 1, '系统监控目录', 0, '2022-05-21 08:30:54', 1, '2023-08-14 23:09:15', 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (3, '系统工具', 2, '', 0, '/tool', 0, '', '{"title":"系统工具","icon":"ep:tools","showParent":true,"rank":2}', 1, '系统工具目录', 0, '2022-05-21 08:30:54', 1, '2023-08-14 23:09:03', 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (4, 'AgileBoot官网', 3, 'AgileBootguanwangIframeRouter', 0, '/AgileBootguanwangIframeLink', 0, '', '{"title":"AgileBoot官网","icon":"ep:link","showParent":true,"frameSrc":"https://element-plus.org/zh-CN/","rank":8}', 1, 'Agileboot官网地址', 0, '2022-05-21 08:30:54', 1, '2023-08-14 23:09:40', 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (5, '用户管理', 1, 'SystemUser', 1, '/system/user/index', 0, 'system:user:list', '{"title":"用户管理","icon":"ep:user-filled","showParent":true}', 1, '用户管理菜单', 0, '2022-05-21 08:30:54', 1, '2023-08-14 23:16:13', 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (6, '角色管理', 1, 'SystemRole', 1, '/system/role/index', 0, 'system:role:list', '{"title":"角色管理","icon":"ep:user","showParent":true}', 1, '角色管理菜单', 0, '2022-05-21 08:30:54', 1, '2023-08-14 23:16:23', 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (7, '菜单管理', 1, 'MenuManagement', 1, '/system/menu/index', 0, 'system:menu:list', '{"title":"菜单管理","icon":"ep:menu","showParent":true}', 1, '菜单管理菜单', 0, '2022-05-21 08:30:54', 1, '2023-08-14 23:15:41', 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (8, '部门管理', 1, 'Department', 1, '/system/dept/index', 0, 'system:dept:list', '{"title":"部门管理","icon":"fa-solid:code-branch","showParent":true}', 1, '部门管理菜单', 0, '2022-05-21 08:30:54', 1, '2023-08-14 23:15:35', 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (9, '岗位管理', 1, 'Post', 1, '/system/post/index', 0, 'system:post:list', '{"title":"岗位管理","icon":"ep:postcard","showParent":true}', 1, '岗位管理菜单', 0, '2022-05-21 08:30:54', 1, '2023-08-14 23:15:11', 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (10, '参数设置', 1, 'Config', 1, '/system/config/index', 0, 'system:config:list', '{"title":"参数设置","icon":"ep:setting","showParent":true}', 1, '参数设置菜单', 0, '2022-05-21 08:30:54', 1, '2023-08-14 23:15:03', 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (11, '通知公告', 1, 'SystemNotice', 1, '/system/notice/index', 0, 'system:notice:list', '{"title":"通知公告","icon":"ep:notification","showParent":true}', 1, '通知公告菜单', 0, '2022-05-21 08:30:54', 1, '2023-08-14 23:14:56', 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (12, '日志管理', 1, 'LogManagement', 1, '/system/logd', 0, '', '{"title":"日志管理","icon":"ep:document","showParent":true}', 1, '日志管理菜单', 0, '2022-05-21 08:30:54', 1, '2023-08-14 23:14:47', 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (13, '在线用户', 1, 'OnlineUser', 2, '/system/monitor/onlineUser/index', 0, 'monitor:online:list', '{"title":"在线用户","icon":"fa-solid:users","showParent":true}', 1, '在线用户菜单', 0, '2022-05-21 08:30:54', 1, '2023-08-14 23:13:13', 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (14, '数据监控', 1, 'DataMonitor', 2, '/system/monitor/druid/index', 0, 'monitor:druid:list', '{"title":"数据监控","icon":"fa:database","showParent":true,"frameSrc":"/druid/login.html","isFrameSrcInternal":true}', 1, '数据监控菜单', 0, '2022-05-21 08:30:54', 1, '2023-08-14 23:13:25', 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (15, '服务监控', 1, 'ServerInfo', 2, '/system/monitor/server/index', 0, 'monitor:server:list', '{"title":"服务监控","icon":"fa:server","showParent":true}', 1, '服务监控菜单', 0, '2022-05-21 08:30:54', 1, '2023-08-14 23:13:34', 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (16, '缓存监控', 1, 'CacheInfo', 2, '/system/monitor/cache/index', 0, 'monitor:cache:list', '{"title":"缓存监控","icon":"ep:reading","showParent":true}', 1, '缓存监控菜单', 0, '2022-05-21 08:30:54', 1, '2023-08-14 23:12:59', 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (17, '系统接口', 1, 'SystemAPI', 3, '/tool/swagger/index', 0, 'tool:swagger:list', '{"title":"系统接口","icon":"ep:document-remove","showParent":true,"frameSrc":"/swagger-ui/index.html","isFrameSrcInternal":true}', 1, '系统接口菜单', 0, '2022-05-21 08:30:54', 1, '2023-08-14 23:14:01', 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (18, '操作日志', 1, 'OperationLog', 12, '/system/log/operationLog/index', 0, 'monitor:operlog:list', '{"title":"操作日志"}', 1, '操作日志菜单', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (19, '登录日志', 1, 'LoginLog', 12, '/system/log/loginLog/index', 0, 'monitor:logininfor:list', '{"title":"登录日志"}', 1, '登录日志菜单', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (20, '用户查询', 0, ' ', 5, '', 1, 'system:user:query', '{"title":"用户查询"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (21, '用户新增', 0, ' ', 5, '', 1, 'system:user:add', '{"title":"用户新增"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (22, '用户修改', 0, ' ', 5, '', 1, 'system:user:edit', '{"title":"用户修改"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (23, '用户删除', 0, ' ', 5, '', 1, 'system:user:remove', '{"title":"用户删除"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (24, '用户导出', 0, ' ', 5, '', 1, 'system:user:export', '{"title":"用户导出"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (25, '用户导入', 0, ' ', 5, '', 1, 'system:user:import', '{"title":"用户导入"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (26, '重置密码', 0, ' ', 5, '', 1, 'system:user:resetPwd', '{"title":"重置密码"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (27, '角色查询', 0, ' ', 6, '', 1, 'system:role:query', '{"title":"角色查询"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (28, '角色新增', 0, ' ', 6, '', 1, 'system:role:add', '{"title":"角色新增"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (29, '角色修改', 0, ' ', 6, '', 1, 'system:role:edit', '{"title":"角色修改"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (30, '角色删除', 0, ' ', 6, '', 1, 'system:role:remove', '{"title":"角色删除"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (31, '角色导出', 0, ' ', 6, '', 1, 'system:role:export', '{"title":"角色导出"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (32, '菜单查询', 0, ' ', 7, '', 1, 'system:menu:query', '{"title":"菜单查询"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (33, '菜单新增', 0, ' ', 7, '', 1, 'system:menu:add', '{"title":"菜单新增"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (34, '菜单修改', 0, ' ', 7, '', 1, 'system:menu:edit', '{"title":"菜单修改"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (35, '菜单删除', 0, ' ', 7, '', 1, 'system:menu:remove', '{"title":"菜单删除"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (36, '部门查询', 0, ' ', 8, '', 1, 'system:dept:query', '{"title":"部门查询"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (37, '部门新增', 0, ' ', 8, '', 1, 'system:dept:add', '{"title":"部门新增"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (38, '部门修改', 0, ' ', 8, '', 1, 'system:dept:edit', '{"title":"部门修改"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (39, '部门删除', 0, ' ', 8, '', 1, 'system:dept:remove', '{"title":"部门删除"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (40, '岗位查询', 0, ' ', 9, '', 1, 'system:post:query', '{"title":"岗位查询"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (41, '岗位新增', 0, ' ', 9, '', 1, 'system:post:add', '{"title":"岗位新增"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (42, '岗位修改', 0, ' ', 9, '', 1, 'system:post:edit', '{"title":"岗位修改"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (43, '岗位删除', 0, ' ', 9, '', 1, 'system:post:remove', '{"title":"岗位删除"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (44, '岗位导出', 0, ' ', 9, '', 1, 'system:post:export', '{"title":"岗位导出"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (45, '参数查询', 0, ' ', 10, '', 1, 'system:config:query', '{"title":"参数查询"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (46, '参数新增', 0, ' ', 10, '', 1, 'system:config:add', '{"title":"参数新增"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (47, '参数修改', 0, ' ', 10, '', 1, 'system:config:edit', '{"title":"参数修改"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (48, '参数删除', 0, ' ', 10, '', 1, 'system:config:remove', '{"title":"参数删除"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (49, '参数导出', 0, ' ', 10, '', 1, 'system:config:export', '{"title":"参数导出"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (50, '公告查询', 0, ' ', 11, '', 1, 'system:notice:query', '{"title":"公告查询"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (51, '公告新增', 0, ' ', 11, '', 1, 'system:notice:add', '{"title":"公告新增"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (52, '公告修改', 0, ' ', 11, '', 1, 'system:notice:edit', '{"title":"公告修改"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (53, '公告删除', 0, ' ', 11, '', 1, 'system:notice:remove', '{"title":"公告删除"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (54, '操作查询', 0, ' ', 18, '', 1, 'monitor:operlog:query', '{"title":"操作查询"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (55, '操作删除', 0, ' ', 18, '', 1, 'monitor:operlog:remove', '{"title":"操作删除"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (56, '日志导出', 0, ' ', 18, '', 1, 'monitor:operlog:export', '{"title":"日志导出"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (57, '登录查询', 0, ' ', 19, '', 1, 'monitor:logininfor:query', '{"title":"登录查询"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (58, '登录删除', 0, ' ', 19, '', 1, 'monitor:logininfor:remove', '{"title":"登录删除"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (59, '日志导出', 0, ' ', 19, '', 1, 'monitor:logininfor:export', '{"title":"日志导出","rank":22}', 1, '', 0, '2022-05-21 08:30:54', 1, '2023-07-22 17:02:28', 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (60, '在线查询', 0, ' ', 13, '', 1, 'monitor:online:query', '{"title":"在线查询"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (61, '批量强退', 0, ' ', 13, '', 1, 'monitor:online:batchLogout', '{"title":"批量强退"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (62, '单条强退', 0, ' ', 13, '', 1, 'monitor:online:forceLogout', '{"title":"单条强退"}', 1, '', 0, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (63, 'AgileBoot Github地址', 4, 'https://github.com/valarchie/AgileBoot-Back-End', 0, '/external', 0, '', '{"title":"AgileBoot Github地址","icon":"fa-solid:external-link-alt","showParent":true,"rank":9}', 1, 'Agileboot github地址', 0, '2022-05-21 08:30:54', 1, '2023-08-14 23:12:13', 0); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (64, '首页', 2, '', 0, '/global', 0, '121212', '{"title":"首页","showParent":true,"rank":3}', 1, '', 1, '2023-07-24 22:36:03', 1, '2023-07-24 22:38:37', 1); -INSERT INTO sys_menu (menu_id, menu_name, menu_type, router_name, parent_id, path, is_button, permission, meta_info, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (65, '个人中心', 1, 'PersonalCenter', 2053, '/system/user/profile', 0, '434sdf', '{"title":"个人中心","showParent":true,"rank":3}', 1, '', 1, '2023-07-24 22:36:55', null, null, 1); - -create table sys_notice -( - notice_id int auto_increment comment '公告ID' - primary key, - notice_title varchar(64) not null comment '公告标题', - notice_type smallint not null comment '公告类型(1通知 2公告)', - notice_content text null comment '公告内容', - status smallint default 0 not null comment '公告状态(1正常 0关闭)', - creator_id bigint not null comment '创建者ID', - create_time datetime null comment '创建时间', - updater_id bigint null comment '更新者ID', - update_time datetime null comment '更新时间', - remark varchar(255) default '' not null comment '备注', - deleted tinyint(1) default 0 not null comment '逻辑删除' -) - comment '通知公告表'; - -INSERT INTO sys_notice (notice_id, notice_title, notice_type, notice_content, status, creator_id, create_time, updater_id, update_time, remark, deleted) VALUES (1, '温馨提醒:2018-07-01 AgileBoot新版本发布啦', 2, '新版本内容~~~~~~~~~~', 1, 1, '2022-05-21 08:30:55', 1, '2022-08-29 20:12:37', '管理员', 0); -INSERT INTO sys_notice (notice_id, notice_title, notice_type, notice_content, status, creator_id, create_time, updater_id, update_time, remark, deleted) VALUES (2, '维护通知:2018-07-01 AgileBoot系统凌晨维护', 1, '维护内容', 1, 1, '2022-05-21 08:30:55', null, null, '管理员', 0); - -create table sys_operation_log -( - operation_id bigint auto_increment comment '日志主键' - primary key, - business_type smallint default 0 not null comment '业务类型(0其它 1新增 2修改 3删除)', - request_method smallint default 0 not null comment '请求方式', - request_module varchar(64) default '' not null comment '请求模块', - request_url varchar(256) default '' not null comment '请求URL', - called_method varchar(128) default '' not null comment '调用方法', - operator_type smallint default 0 not null comment '操作类别(0其它 1后台用户 2手机端用户)', - user_id bigint default 0 null comment '用户ID', - username varchar(32) default '' null comment '操作人员', - operator_ip varchar(128) default '' null comment '操作人员ip', - operator_location varchar(256) default '' null comment '操作地点', - dept_id bigint default 0 null comment '部门ID', - dept_name varchar(64) null comment '部门名称', - operation_param varchar(2048) default '' null comment '请求参数', - operation_result varchar(2048) default '' null comment '返回参数', - status smallint default 1 not null comment '操作状态(1正常 0异常)', - error_stack varchar(2048) default '' null comment '错误消息', - operation_time datetime not null comment '操作时间', - deleted tinyint(1) default 0 not null comment '逻辑删除' -) - comment '操作日志记录'; - -INSERT INTO sys_operation_log (operation_id, business_type, request_method, request_module, request_url, called_method, operator_type, user_id, username, operator_ip, operator_location, dept_id, dept_name, operation_param, operation_result, status, error_stack, operation_time, deleted) VALUES (561, 1, 2, '菜单管理', '/system/menus', 'com.agileboot.admin.controller.system.SysMenuController.add()', 1, 0, 'admin', '127.0.0.1', '内网IP', 0, null, '{"menuName":"","permission":"","parentId":2035,"path":"","isButton":false,"routerName":"","meta":{"showParent":true,"rank":0},"status":1},', '', 1, '', '2023-07-22 17:06:57', 0); - -create table sys_post -( - post_id bigint auto_increment comment '岗位ID' - primary key, - post_code varchar(64) not null comment '岗位编码', - post_name varchar(64) not null comment '岗位名称', - post_sort int not null comment '显示顺序', - status smallint not null comment '状态(1正常 0停用)', - remark varchar(512) null comment '备注', - creator_id bigint null, - create_time datetime null comment '创建时间', - updater_id bigint null, - update_time datetime null comment '更新时间', - deleted tinyint(1) default 0 not null comment '逻辑删除' -) - comment '岗位信息表'; - -INSERT INTO sys_post (post_id, post_code, post_name, post_sort, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (1, 'ceo', '董事长', 1, 1, '', null, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_post (post_id, post_code, post_name, post_sort, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (2, 'se', '项目经理', 2, 1, '', null, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_post (post_id, post_code, post_name, post_sort, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (3, 'hr', '人力资源', 3, 1, '', null, '2022-05-21 08:30:54', null, null, 0); -INSERT INTO sys_post (post_id, post_code, post_name, post_sort, status, remark, creator_id, create_time, updater_id, update_time, deleted) VALUES (4, 'user', '普通员工', 5, 0, '', null, '2022-05-21 08:30:54', null, null, 0); - -create table sys_role -( - role_id bigint auto_increment comment '角色ID' - primary key, - role_name varchar(32) not null comment '角色名称', - role_key varchar(128) not null comment '角色权限字符串', - role_sort int not null comment '显示顺序', - data_scope smallint default 1 null comment '数据范围(1:全部数据权限 2:自定数据权限 3: 本部门数据权限 4: 本部门及以下数据权限 5: 本人权限)', - dept_id_set varchar(1024) default '' null comment '角色所拥有的部门数据权限', - status smallint not null comment '角色状态(1正常 0停用)', - creator_id bigint null comment '创建者ID', - create_time datetime null comment '创建时间', - updater_id bigint null comment '更新者ID', - update_time datetime null comment '更新时间', - remark varchar(512) null comment '备注', - deleted tinyint(1) default 0 not null comment '删除标志(0代表存在 1代表删除)' -) - comment '角色信息表'; - -INSERT INTO sys_role (role_id, role_name, role_key, role_sort, data_scope, dept_id_set, status, creator_id, create_time, updater_id, update_time, remark, deleted) VALUES (1, '超级管理员', 'admin', 1, 1, '', 1, null, '2022-05-21 08:30:54', null, null, '超级管理员', 0); -INSERT INTO sys_role (role_id, role_name, role_key, role_sort, data_scope, dept_id_set, status, creator_id, create_time, updater_id, update_time, remark, deleted) VALUES (2, '普通角色', 'common', 3, 2, '', 1, null, '2022-05-21 08:30:54', null, null, '普通角色', 0); -INSERT INTO sys_role (role_id, role_name, role_key, role_sort, data_scope, dept_id_set, status, creator_id, create_time, updater_id, update_time, remark, deleted) VALUES (3, '闲置角色', 'unused', 4, 2, '', 0, null, '2022-05-21 08:30:54', null, null, '未使用的角色', 0); - -create table sys_role_menu -( - role_id bigint not null comment '角色ID', - menu_id bigint not null comment '菜单ID', - primary key (role_id, menu_id) -) - comment '角色和菜单关联表'; - -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 1); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 2); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 3); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 4); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 5); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 6); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 7); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 8); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 9); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 10); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 11); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 12); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 13); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 14); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 15); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 16); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 17); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 18); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 19); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 20); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 21); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 22); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 23); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 24); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 25); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 26); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 27); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 28); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 29); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 30); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 31); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 32); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 33); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 34); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 35); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 36); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 37); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 38); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 39); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 40); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 41); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 42); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 43); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 44); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 45); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 46); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 47); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 48); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 49); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 50); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 51); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 52); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 53); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 54); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 55); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 56); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 57); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 58); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 59); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 60); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (2, 61); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (3, 1); -INSERT INTO sys_role_menu (role_id, menu_id) VALUES (111, 1); - -create table sys_user -( - user_id bigint auto_increment comment '用户ID' - primary key, - post_id bigint null comment '职位id', - role_id bigint null comment '角色id', - dept_id bigint null comment '部门ID', - username varchar(64) not null comment '用户账号', - nickname varchar(32) not null comment '用户昵称', - user_type smallint default 0 null comment '用户类型(00系统用户)', - email varchar(128) default '' null comment '用户邮箱', - phone_number varchar(18) default '' null comment '手机号码', - sex smallint default 0 null comment '用户性别(0男 1女 2未知)', - avatar varchar(512) default '' null comment '头像地址', - password varchar(128) default '' not null comment '密码', - status smallint default 0 not null comment '帐号状态(1正常 2停用 3冻结)', - login_ip varchar(128) default '' null comment '最后登录IP', - login_date datetime null comment '最后登录时间', - is_admin tinyint(1) default 0 not null comment '超级管理员标志(1是,0否)', - creator_id bigint null comment '更新者ID', - create_time datetime null comment '创建时间', - updater_id bigint null comment '更新者ID', - update_time datetime null comment '更新时间', - remark varchar(512) null comment '备注', - deleted tinyint(1) default 0 not null comment '删除标志(0代表存在 1代表删除)' -) - comment '用户信息表'; - -INSERT INTO sys_user (user_id, post_id, role_id, dept_id, username, nickname, user_type, email, phone_number, sex, avatar, password, status, login_ip, login_date, is_admin, creator_id, create_time, updater_id, update_time, remark, deleted) VALUES (1, 1, 1, 4, 'admin', 'valarchie1', 0, 'agileboot@163.com', '15888888883', 0, '/profile/avatar/20230725164110_blob_6b7a989b1cdd4dd396665d2cfd2addc5.png', '$2a$10$o55UFZAtyWnDpRV6dvQe8.c/MjlFacC49ASj2usNXm9BY74SYI/uG', 1, '127.0.0.1', '2023-08-14 23:07:03', 1, null, '2022-05-21 08:30:54', 1, '2023-08-14 23:07:03', '管理员', 0); -INSERT INTO sys_user (user_id, post_id, role_id, dept_id, username, nickname, user_type, email, phone_number, sex, avatar, password, status, login_ip, login_date, is_admin, creator_id, create_time, updater_id, update_time, remark, deleted) VALUES (2, 2, 2, 5, 'ag1', 'valarchie2', 0, 'agileboot1@qq.com', '15666666666', 1, '/profile/avatar/20230725114818_avatar_b5bf400732bb43369b4df58802049b22.png', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', 1, '127.0.0.1', '2022-05-21 08:30:54', 0, null, '2022-05-21 08:30:54', null, null, '测试员1', 0); -INSERT INTO sys_user (user_id, post_id, role_id, dept_id, username, nickname, user_type, email, phone_number, sex, avatar, password, status, login_ip, login_date, is_admin, creator_id, create_time, updater_id, update_time, remark, deleted) VALUES (3, 2, 0, 5, 'ag2', 'valarchie3', 0, 'agileboot2@qq.com', '15666666667', 1, '/profile/avatar/20230725114818_avatar_b5bf400732bb43369b4df58802049b22.png', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', 1, '127.0.0.1', '2022-05-21 08:30:54', 0, null, '2022-05-21 08:30:54', null, null, '测试员2', 0); - diff --git a/agileboot-system/sql/agileboot_20221007.sql b/agileboot-system/sql/agileboot_20221007.sql deleted file mode 100644 index 853efb2..0000000 --- a/agileboot-system/sql/agileboot_20221007.sql +++ /dev/null @@ -1,428 +0,0 @@ -/* -Navicat MySQL Data Transfer - -Source Server : Local-Mysql -Source Server Version : 80029 -Source Host : localhost:33066 -Source Database : agileboot - -Target Server Type : MYSQL -Target Server Version : 80029 -File Encoding : 65001 - -Date: 2022-10-07 16:05:40 -*/ - -SET FOREIGN_KEY_CHECKS=0; - --- ---------------------------- --- Table structure for sys_config --- ---------------------------- -DROP TABLE IF EXISTS `sys_config`; -CREATE TABLE `sys_config` ( - `config_id` int NOT NULL AUTO_INCREMENT COMMENT '参数主键', - `config_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '配置名称', - `config_key` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '配置键名', - `config_options` varchar(1024) NOT NULL DEFAULT '' COMMENT '可选的选项', - `config_value` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '配置值', - `is_allow_change` tinyint(1) NOT NULL COMMENT '是否允许修改', - `creator_id` bigint DEFAULT NULL COMMENT '创建者ID', - `updater_id` bigint DEFAULT NULL COMMENT '更新者ID', - `update_time` datetime DEFAULT NULL COMMENT '更新时间', - `create_time` datetime DEFAULT NULL COMMENT '创建时间', - `remark` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注', - `deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '逻辑删除', - PRIMARY KEY (`config_id`), - UNIQUE KEY `config_key_uniq_idx` (`config_key`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=100 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='参数配置表'; - --- ---------------------------- --- Records of sys_config --- ---------------------------- -INSERT INTO `sys_config` VALUES ('1', '主框架页-默认皮肤样式名称', 'sys.index.skinName', '["skin-blue","skin-green","skin-purple","skin-red","skin-yellow"]', 'skin-blue', '1', null, null, '2022-08-28 22:12:19', '2022-05-21 08:30:55', '蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow', '0'); -INSERT INTO `sys_config` VALUES ('2', '用户管理-账号初始密码', 'sys.user.initPassword', '', '1234567', '1', null, null, '2022-08-28 21:54:19', '2022-05-21 08:30:55', '初始化密码 123456', '0'); -INSERT INTO `sys_config` VALUES ('3', '主框架页-侧边栏主题', 'sys.index.sideTheme', '["theme-dark","theme-light"]', 'theme-dark', '1', null, null, '2022-08-28 22:12:15', '2022-08-20 08:30:55', '深色主题theme-dark,浅色主题theme-light', '0'); -INSERT INTO `sys_config` VALUES ('4', '账号自助-验证码开关', 'sys.account.captchaOnOff', '["true","false"]', 'false', '0', null, null, '2022-08-28 22:03:37', '2022-05-21 08:30:55', '是否开启验证码功能(true开启,false关闭)', '0'); -INSERT INTO `sys_config` VALUES ('5', '账号自助-是否开启用户注册功能', 'sys.account.registerUser', '["true","false"]', 'true', '0', null, '1', '2022-10-05 22:18:57', '2022-05-21 08:30:55', '是否开启注册用户功能(true开启,false关闭)', '0'); - - --- ---------------------------- --- Table structure for sys_dept --- ---------------------------- -DROP TABLE IF EXISTS `sys_dept`; -CREATE TABLE `sys_dept` ( - `dept_id` bigint NOT NULL AUTO_INCREMENT COMMENT '部门id', - `parent_id` bigint NOT NULL DEFAULT '0' COMMENT '父部门id', - `ancestors` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '祖级列表', - `dept_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '部门名称', - `order_num` int NOT NULL DEFAULT '0' COMMENT '显示顺序', - `leader_id` bigint DEFAULT NULL, - `leader_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '负责人', - `phone` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '联系电话', - `email` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '邮箱', - `status` smallint NOT NULL DEFAULT '0' COMMENT '部门状态(0停用 1启用)', - `creator_id` bigint DEFAULT NULL COMMENT '创建者ID', - `create_time` datetime DEFAULT NULL COMMENT '创建时间', - `updater_id` bigint DEFAULT NULL COMMENT '更新者ID', - `update_time` datetime DEFAULT NULL COMMENT '更新时间', - `deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '逻辑删除', - PRIMARY KEY (`dept_id`) -) ENGINE=InnoDB AUTO_INCREMENT=203 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='部门表'; - --- ---------------------------- --- Records of sys_dept --- ---------------------------- -INSERT INTO `sys_dept` VALUES ('1', '0', '0', 'AgileBoot科技', '0', null, 'valarchie', '15888888888', 'valarchie@163.com', '1', null, '2022-05-21 08:30:54', null, null, '0'); -INSERT INTO `sys_dept` VALUES ('2', '1', '0,1', '深圳总公司', '1', null, 'valarchie', '15888888888', 'valarchie@163.com', '1', null, '2022-05-21 08:30:54', null, null, '0'); -INSERT INTO `sys_dept` VALUES ('3', '1', '0,1', '长沙分公司', '2', null, 'valarchie', '15888888888', 'valarchie@163.com', '1', null, '2022-05-21 08:30:54', null, null, '0'); -INSERT INTO `sys_dept` VALUES ('4', '2', '0,1,2', '研发部门', '1', null, 'valarchie', '15888888888', 'valarchie@163.com', '1', null, '2022-05-21 08:30:54', null, null, '0'); -INSERT INTO `sys_dept` VALUES ('5', '2', '0,1,2', '市场部门', '2', null, 'valarchie', '15888888888', 'valarchie@163.com', '1', null, '2022-05-21 08:30:54', null, null, '0'); -INSERT INTO `sys_dept` VALUES ('6', '2', '0,1,2', '测试部门', '3', null, 'valarchie', '15888888888', 'valarchie@163.com', '1', null, '2022-05-21 08:30:54', null, null, '0'); -INSERT INTO `sys_dept` VALUES ('7', '2', '0,1,2', '财务部门', '4', null, 'valarchie', '15888888888', 'valarchie@163.com', '1', null, '2022-05-21 08:30:54', null, null, '0'); -INSERT INTO `sys_dept` VALUES ('8', '2', '0,1,2', '运维部门', '5', null, 'valarchie', '15888888888', 'valarchie@163.com', '1', null, '2022-05-21 08:30:54', null, null, '0'); -INSERT INTO `sys_dept` VALUES ('9', '3', '0,1,3', '市场部门', '1', null, 'valarchie', '15888888888', 'valarchie@163.com', '1', null, '2022-05-21 08:30:54', null, null, '0'); -INSERT INTO `sys_dept` VALUES ('10', '3', '0,1,3', '财务部门', '2', null, 'valarchie', '15888888888', 'valarchie@163.com', '0', null, '2022-05-21 08:30:54', null, null, '0'); - --- ---------------------------- --- Table structure for sys_login_info --- ---------------------------- -DROP TABLE IF EXISTS `sys_login_info`; -CREATE TABLE `sys_login_info` ( - `info_id` bigint NOT NULL AUTO_INCREMENT COMMENT '访问ID', - `username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '用户账号', - `ip_address` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '登录IP地址', - `login_location` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '登录地点', - `browser` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '浏览器类型', - `operation_system` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '操作系统', - `status` smallint NOT NULL DEFAULT '0' COMMENT '登录状态(1成功 0失败)', - `msg` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '提示消息', - `login_time` datetime DEFAULT NULL COMMENT '访问时间', - `deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '逻辑删除', - PRIMARY KEY (`info_id`) -) ENGINE=InnoDB AUTO_INCREMENT=415 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='系统访问记录'; - --- ---------------------------- --- Records of sys_login_info --- ---------------------------- - --- ---------------------------- --- Table structure for sys_menu --- ---------------------------- -DROP TABLE IF EXISTS `sys_menu`; -CREATE TABLE `sys_menu` ( - `menu_id` bigint NOT NULL AUTO_INCREMENT COMMENT '菜单ID', - `menu_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '菜单名称', - `parent_id` bigint NOT NULL DEFAULT '0' COMMENT '父菜单ID', - `order_num` int NOT NULL DEFAULT '0' COMMENT '显示顺序', - `path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '路由地址', - `component` varchar(255) DEFAULT NULL COMMENT '组件路径', - `query` varchar(255) DEFAULT NULL COMMENT '路由参数', - `is_external` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否为外链(1是 0否)', - `is_cache` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否缓存(1缓存 0不缓存)', - `menu_type` smallint NOT NULL DEFAULT '0' COMMENT '菜单类型(M=1目录 C=2菜单 F=3按钮)', - `is_visible` tinyint(1) NOT NULL DEFAULT '0' COMMENT '菜单状态(1显示 0隐藏)', - `status` smallint NOT NULL DEFAULT '0' COMMENT '菜单状态(1启用 0停用)', - `perms` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '权限标识', - `icon` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '#' COMMENT '菜单图标', - `creator_id` bigint DEFAULT NULL COMMENT '创建者ID', - `create_time` datetime DEFAULT NULL COMMENT '创建时间', - `updater_id` bigint DEFAULT NULL COMMENT '更新者ID', - `update_time` datetime DEFAULT NULL COMMENT '更新时间', - `remark` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '备注', - `deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '逻辑删除', - PRIMARY KEY (`menu_id`) -) ENGINE=InnoDB AUTO_INCREMENT=2007 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='菜单权限表'; - --- ---------------------------- --- Records of sys_menu --- ---------------------------- -INSERT INTO `sys_menu` VALUES ('1', '系统管理', '0', '1', 'system', null, '', '0', '1', '1', '1', '1', '', 'system', '0', '2022-05-21 08:30:54', null, null, '系统管理目录', '0'); -INSERT INTO `sys_menu` VALUES ('2', '系统监控', '0', '2', 'monitor', null, '', '0', '1', '1', '1', '1', '', 'monitor', '0', '2022-05-21 08:30:54', null, null, '系统监控目录', '0'); -INSERT INTO `sys_menu` VALUES ('3', '系统工具', '0', '3', 'tool', null, '', '0', '1', '1', '1', '1', '', 'tool', '0', '2022-05-21 08:30:54', null, null, '系统工具目录', '0'); -INSERT INTO `sys_menu` VALUES ('4', 'AgileBoot官网', '0', '4', 'https://juejin.cn/column/7159946528827080734', null, '', '1', '1', '1', '1', '1', '', 'guide', '0', '2022-05-21 08:30:54', null, null, 'Agileboot官网地址', '0'); -INSERT INTO `sys_menu` VALUES ('5', '用户管理', '1', '1', 'user', 'system/user/index', '', '0', '1', '2', '1', '1', 'system:user:list', 'user', '0', '2022-05-21 08:30:54', null, null, '用户管理菜单', '0'); -INSERT INTO `sys_menu` VALUES ('6', '角色管理', '1', '2', 'role', 'system/role/index', '', '0', '1', '2', '1', '1', 'system:role:list', 'peoples', '0', '2022-05-21 08:30:54', null, null, '角色管理菜单', '0'); -INSERT INTO `sys_menu` VALUES ('7', '菜单管理', '1', '3', 'menu', 'system/menu/index', '', '0', '1', '2', '1', '1', 'system:menu:list', 'tree-table', '0', '2022-05-21 08:30:54', null, null, '菜单管理菜单', '0'); -INSERT INTO `sys_menu` VALUES ('8', '部门管理', '1', '4', 'dept', 'system/dept/index', '', '0', '1', '2', '1', '1', 'system:dept:list', 'tree', '0', '2022-05-21 08:30:54', null, null, '部门管理菜单', '0'); -INSERT INTO `sys_menu` VALUES ('9', '岗位管理', '1', '5', 'post', 'system/post/index', '', '0', '1', '2', '1', '1', 'system:post:list', 'post', '0', '2022-05-21 08:30:54', null, null, '岗位管理菜单', '0'); -INSERT INTO `sys_menu` VALUES ('10', '参数设置', '1', '7', 'config', 'system/config/index', '', '0', '1', '2', '1', '1', 'system:config:list', 'edit', '0', '2022-05-21 08:30:54', null, null, '参数设置菜单', '0'); -INSERT INTO `sys_menu` VALUES ('11', '通知公告', '1', '8', 'notice', 'system/notice/index', '', '0', '1', '2', '1', '1', 'system:notice:list', 'message', '0', '2022-05-21 08:30:54', null, null, '通知公告菜单', '0'); -INSERT INTO `sys_menu` VALUES ('12', '日志管理', '1', '9', 'log', '', '', '0', '1', '1', '1', '1', '', 'log', '0', '2022-05-21 08:30:54', null, null, '日志管理菜单', '0'); -INSERT INTO `sys_menu` VALUES ('13', '在线用户', '2', '1', 'online', 'monitor/online/index', '', '0', '1', '2', '1', '1', 'monitor:online:list', 'online', '0', '2022-05-21 08:30:54', null, null, '在线用户菜单', '0'); -INSERT INTO `sys_menu` VALUES ('14', '数据监控', '2', '3', 'druid', 'monitor/druid/index', '', '0', '1', '2', '1', '1', 'monitor:druid:list', 'druid', '0', '2022-05-21 08:30:54', null, null, '数据监控菜单', '0'); -INSERT INTO `sys_menu` VALUES ('15', '服务监控', '2', '4', 'server', 'monitor/server/index', '', '0', '1', '2', '1', '1', 'monitor:server:list', 'server', '0', '2022-05-21 08:30:54', null, null, '服务监控菜单', '0'); -INSERT INTO `sys_menu` VALUES ('16', '缓存监控', '2', '5', 'cache', 'monitor/cache/index', '', '0', '1', '2', '1', '1', 'monitor:cache:list', 'redis', '0', '2022-05-21 08:30:54', null, null, '缓存监控菜单', '0'); -INSERT INTO `sys_menu` VALUES ('17', '系统接口', '3', '3', 'swagger', 'tool/swagger/index', '', '0', '1', '2', '1', '1', 'tool:swagger:list', 'swagger', '0', '2022-05-21 08:30:54', null, null, '系统接口菜单', '0'); -INSERT INTO `sys_menu` VALUES ('18', '操作日志', '12', '1', 'operlog', 'monitor/operlog/index', '', '0', '1', '2', '1', '1', 'monitor:operlog:list', 'form', '0', '2022-05-21 08:30:54', null, null, '操作日志菜单', '0'); -INSERT INTO `sys_menu` VALUES ('19', '登录日志', '12', '2', 'logininfor', 'monitor/logininfor/index', '', '0', '1', '2', '1', '1', 'monitor:logininfor:list', 'logininfor', '0', '2022-05-21 08:30:54', null, null, '登录日志菜单', '0'); -INSERT INTO `sys_menu` VALUES ('20', '用户查询', '5', '1', '', '', '', '0', '1', '3', '1', '1', 'system:user:query', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('21', '用户新增', '5', '2', '', '', '', '0', '1', '3', '1', '1', 'system:user:add', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('22', '用户修改', '5', '3', '', '', '', '0', '1', '3', '1', '1', 'system:user:edit', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('23', '用户删除', '5', '4', '', '', '', '0', '1', '3', '1', '1', 'system:user:remove', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('24', '用户导出', '5', '5', '', '', '', '0', '1', '3', '1', '1', 'system:user:export', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('25', '用户导入', '5', '6', '', '', '', '0', '1', '3', '1', '1', 'system:user:import', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('26', '重置密码', '5', '7', '', '', '', '0', '1', '3', '1', '1', 'system:user:resetPwd', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('27', '角色查询', '6', '1', '', '', '', '0', '1', '3', '1', '1', 'system:role:query', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('28', '角色新增', '6', '2', '', '', '', '0', '1', '3', '1', '1', 'system:role:add', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('29', '角色修改', '6', '3', '', '', '', '0', '1', '3', '1', '1', 'system:role:edit', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('30', '角色删除', '6', '4', '', '', '', '0', '1', '3', '1', '1', 'system:role:remove', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('31', '角色导出', '6', '5', '', '', '', '0', '1', '3', '1', '1', 'system:role:export', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('32', '菜单查询', '7', '1', '', '', '', '0', '1', '3', '1', '1', 'system:menu:query', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('33', '菜单新增', '7', '2', '', '', '', '0', '1', '3', '1', '1', 'system:menu:add', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('34', '菜单修改', '7', '3', '', '', '', '0', '1', '3', '1', '1', 'system:menu:edit', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('35', '菜单删除', '7', '4', '', '', '', '0', '1', '3', '1', '1', 'system:menu:remove', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('36', '部门查询', '8', '1', '', '', '', '0', '1', '3', '1', '1', 'system:dept:query', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('37', '部门新增', '8', '2', '', '', '', '0', '1', '3', '1', '1', 'system:dept:add', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('38', '部门修改', '8', '3', '', '', '', '0', '1', '3', '1', '1', 'system:dept:edit', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('39', '部门删除', '8', '4', '', '', '', '0', '1', '3', '1', '1', 'system:dept:remove', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('40', '岗位查询', '9', '1', '', '', '', '0', '1', '3', '1', '1', 'system:post:query', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('41', '岗位新增', '9', '2', '', '', '', '0', '1', '3', '1', '1', 'system:post:add', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('42', '岗位修改', '9', '3', '', '', '', '0', '1', '3', '1', '1', 'system:post:edit', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('43', '岗位删除', '9', '4', '', '', '', '0', '1', '3', '1', '1', 'system:post:remove', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('44', '岗位导出', '9', '5', '', '', '', '0', '1', '3', '1', '1', 'system:post:export', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('45', '参数查询', '10', '1', '#', '', '', '0', '1', '3', '1', '1', 'system:config:query', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('46', '参数新增', '10', '2', '#', '', '', '0', '1', '3', '1', '1', 'system:config:add', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('47', '参数修改', '10', '3', '#', '', '', '0', '1', '3', '1', '1', 'system:config:edit', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('48', '参数删除', '10', '4', '#', '', '', '0', '1', '3', '1', '1', 'system:config:remove', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('49', '参数导出', '10', '5', '#', '', '', '0', '1', '3', '1', '1', 'system:config:export', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('50', '公告查询', '11', '1', '#', '', '', '0', '1', '3', '1', '1', 'system:notice:query', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('51', '公告新增', '11', '2', '#', '', '', '0', '1', '3', '1', '1', 'system:notice:add', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('52', '公告修改', '11', '3', '#', '', '', '0', '1', '3', '1', '1', 'system:notice:edit', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('53', '公告删除', '11', '4', '#', '', '', '0', '1', '3', '1', '1', 'system:notice:remove', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('54', '操作查询', '18', '1', '#', '', '', '0', '1', '3', '1', '1', 'monitor:operlog:query', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('55', '操作删除', '18', '2', '#', '', '', '0', '1', '3', '1', '1', 'monitor:operlog:remove', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('56', '日志导出', '18', '4', '#', '', '', '0', '1', '3', '1', '1', 'monitor:operlog:export', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('57', '登录查询', '19', '1', '#', '', '', '0', '1', '3', '1', '1', 'monitor:logininfor:query', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('58', '登录删除', '19', '2', '#', '', '', '0', '1', '3', '1', '1', 'monitor:logininfor:remove', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('59', '日志导出', '19', '3', '#', '', '', '0', '1', '3', '1', '1', 'monitor:logininfor:export', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('60', '在线查询', '13', '1', '#', '', '', '0', '1', '3', '1', '1', 'monitor:online:query', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('61', '批量强退', '13', '2', '#', '', '', '0', '1', '3', '1', '1', 'monitor:online:batchLogout', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); -INSERT INTO `sys_menu` VALUES ('62', '单条强退', '13', '3', '#', '', '', '0', '1', '3', '1', '1', 'monitor:online:forceLogout', '#', '0', '2022-05-21 08:30:54', null, null, '', '0'); - - --- ---------------------------- --- Table structure for sys_notice --- ---------------------------- -DROP TABLE IF EXISTS `sys_notice`; -CREATE TABLE `sys_notice` ( - `notice_id` int NOT NULL AUTO_INCREMENT COMMENT '公告ID', - `notice_title` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '公告标题', - `notice_type` smallint NOT NULL COMMENT '公告类型(1通知 2公告)', - `notice_content` text COMMENT '公告内容', - `status` smallint NOT NULL DEFAULT '0' COMMENT '公告状态(1正常 0关闭)', - `creator_id` bigint NOT NULL COMMENT '创建者ID', - `create_time` datetime DEFAULT NULL COMMENT '创建时间', - `updater_id` bigint DEFAULT NULL COMMENT '更新者ID', - `update_time` datetime DEFAULT NULL COMMENT '更新时间', - `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '备注', - `deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '逻辑删除', - PRIMARY KEY (`notice_id`) -) ENGINE=InnoDB AUTO_INCREMENT=31 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='通知公告表'; - --- ---------------------------- --- Records of sys_notice --- ---------------------------- -INSERT INTO `sys_notice` VALUES ('1', '温馨提醒:2018-07-01 AgileBoot新版本发布啦', '2', '新版本内容~~~~~~~~~~', '1', '1', '2022-05-21 08:30:55', '1', '2022-08-29 20:12:37', '管理员', '0'); -INSERT INTO `sys_notice` VALUES ('2', '维护通知:2018-07-01 AgileBoot系统凌晨维护', '1', '维护内容', '1', '1', '2022-05-21 08:30:55', null, null, '管理员', '0'); - - --- ---------------------------- --- Table structure for sys_operation_log --- ---------------------------- -DROP TABLE IF EXISTS `sys_operation_log`; -CREATE TABLE `sys_operation_log` ( - `operation_id` bigint NOT NULL AUTO_INCREMENT COMMENT '日志主键', - `business_type` smallint NOT NULL DEFAULT '0' COMMENT '业务类型(0其它 1新增 2修改 3删除)', - `request_method` smallint NOT NULL DEFAULT '0' COMMENT '请求方式', - `request_module` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '请求模块', - `request_url` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '请求URL', - `called_method` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '调用方法', - `operator_type` smallint NOT NULL DEFAULT '0' COMMENT '操作类别(0其它 1后台用户 2手机端用户)', - `user_id` bigint DEFAULT '0' COMMENT '用户ID', - `username` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '操作人员', - `operator_ip` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '操作人员ip', - `operator_location` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '操作地点', - `dept_id` bigint DEFAULT '0' COMMENT '部门ID', - `dept_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '部门名称', - `operation_param` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '请求参数', - `operation_result` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '返回参数', - `status` smallint NOT NULL DEFAULT '1' COMMENT '操作状态(1正常 0异常)', - `error_stack` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '错误消息', - `operation_time` datetime NOT NULL COMMENT '操作时间', - `deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '逻辑删除', - PRIMARY KEY (`operation_id`) -) ENGINE=InnoDB AUTO_INCREMENT=379 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='操作日志记录'; - --- ---------------------------- --- Records of sys_operation_log --- ---------------------------- - --- ---------------------------- --- Table structure for sys_post --- ---------------------------- -DROP TABLE IF EXISTS `sys_post`; -CREATE TABLE `sys_post` ( - `post_id` bigint NOT NULL AUTO_INCREMENT COMMENT '岗位ID', - `post_code` varchar(64) NOT NULL COMMENT '岗位编码', - `post_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '岗位名称', - `post_sort` int NOT NULL COMMENT '显示顺序', - `status` smallint NOT NULL COMMENT '状态(1正常 0停用)', - `remark` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注', - `creator_id` bigint DEFAULT NULL, - `create_time` datetime DEFAULT NULL COMMENT '创建时间', - `updater_id` bigint DEFAULT NULL, - `update_time` datetime DEFAULT NULL COMMENT '更新时间', - `deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '逻辑删除', - PRIMARY KEY (`post_id`) -) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='岗位信息表'; - --- ---------------------------- --- Records of sys_post --- ---------------------------- -INSERT INTO `sys_post` VALUES ('1', 'ceo', '董事长', '1', '1', '', null, '2022-05-21 08:30:54', null, null, '0'); -INSERT INTO `sys_post` VALUES ('2', 'se', '项目经理', '2', '1', '', null, '2022-05-21 08:30:54', null, null, '0'); -INSERT INTO `sys_post` VALUES ('3', 'hr', '人力资源', '3', '1', '', null, '2022-05-21 08:30:54', null, null, '0'); -INSERT INTO `sys_post` VALUES ('4', 'user', '普通员工', '5', '0', '', null, '2022-05-21 08:30:54', null, null, '0'); - --- ---------------------------- --- Table structure for sys_role --- ---------------------------- -DROP TABLE IF EXISTS `sys_role`; -CREATE TABLE `sys_role` ( - `role_id` bigint NOT NULL AUTO_INCREMENT COMMENT '角色ID', - `role_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色名称', - `role_key` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '角色权限字符串', - `role_sort` int NOT NULL COMMENT '显示顺序', - `data_scope` smallint DEFAULT '1' COMMENT '数据范围(1:全部数据权限 2:自定数据权限 3: 本部门数据权限 4: 本部门及以下数据权限 5: 本人权限)', - `dept_id_set` varchar(1024) DEFAULT '' COMMENT '角色所拥有的部门数据权限', - `status` smallint NOT NULL COMMENT '角色状态(1正常 0停用)', - `creator_id` bigint DEFAULT NULL COMMENT '创建者ID', - `create_time` datetime DEFAULT NULL COMMENT '创建时间', - `updater_id` bigint DEFAULT NULL COMMENT '更新者ID', - `update_time` datetime DEFAULT NULL COMMENT '更新时间', - `remark` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注', - `deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '删除标志(0代表存在 1代表删除)', - PRIMARY KEY (`role_id`) -) ENGINE=InnoDB AUTO_INCREMENT=111 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='角色信息表'; - --- ---------------------------- --- Records of sys_role --- ---------------------------- -INSERT INTO `sys_role` VALUES ('1', '超级管理员', 'admin', '1', '1', '', '1', null, '2022-05-21 08:30:54', null, null, '超级管理员', '0'); -INSERT INTO `sys_role` VALUES ('2', '普通角色', 'common', '3', '2', '', '1', null, '2022-05-21 08:30:54', null, null, '普通角色', '0'); -INSERT INTO `sys_role` VALUES ('3', '闲置角色', 'unused', '4', '2', '', '0', null, '2022-05-21 08:30:54', null, null, '未使用的角色', '0'); - --- ---------------------------- --- Table structure for sys_role_menu --- ---------------------------- -DROP TABLE IF EXISTS `sys_role_menu`; -CREATE TABLE `sys_role_menu` ( - `role_id` bigint NOT NULL COMMENT '角色ID', - `menu_id` bigint NOT NULL COMMENT '菜单ID', - PRIMARY KEY (`role_id`,`menu_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='角色和菜单关联表'; - --- ---------------------------- --- Records of sys_role_menu --- ---------------------------- -INSERT INTO `sys_role_menu` VALUES ('2', '1'); -INSERT INTO `sys_role_menu` VALUES ('2', '2'); -INSERT INTO `sys_role_menu` VALUES ('2', '3'); -INSERT INTO `sys_role_menu` VALUES ('2', '4'); -INSERT INTO `sys_role_menu` VALUES ('2', '5'); -INSERT INTO `sys_role_menu` VALUES ('2', '6'); -INSERT INTO `sys_role_menu` VALUES ('2', '7'); -INSERT INTO `sys_role_menu` VALUES ('2', '8'); -INSERT INTO `sys_role_menu` VALUES ('2', '9'); -INSERT INTO `sys_role_menu` VALUES ('2', '10'); -INSERT INTO `sys_role_menu` VALUES ('2', '11'); -INSERT INTO `sys_role_menu` VALUES ('2', '12'); -INSERT INTO `sys_role_menu` VALUES ('2', '13'); -INSERT INTO `sys_role_menu` VALUES ('2', '14'); -INSERT INTO `sys_role_menu` VALUES ('2', '15'); -INSERT INTO `sys_role_menu` VALUES ('2', '16'); -INSERT INTO `sys_role_menu` VALUES ('2', '17'); -INSERT INTO `sys_role_menu` VALUES ('2', '18'); -INSERT INTO `sys_role_menu` VALUES ('2', '19'); -INSERT INTO `sys_role_menu` VALUES ('2', '20'); -INSERT INTO `sys_role_menu` VALUES ('2', '21'); -INSERT INTO `sys_role_menu` VALUES ('2', '22'); -INSERT INTO `sys_role_menu` VALUES ('2', '23'); -INSERT INTO `sys_role_menu` VALUES ('2', '24'); -INSERT INTO `sys_role_menu` VALUES ('2', '25'); -INSERT INTO `sys_role_menu` VALUES ('2', '26'); -INSERT INTO `sys_role_menu` VALUES ('2', '27'); -INSERT INTO `sys_role_menu` VALUES ('2', '28'); -INSERT INTO `sys_role_menu` VALUES ('2', '29'); -INSERT INTO `sys_role_menu` VALUES ('2', '30'); -INSERT INTO `sys_role_menu` VALUES ('2', '31'); -INSERT INTO `sys_role_menu` VALUES ('2', '32'); -INSERT INTO `sys_role_menu` VALUES ('2', '33'); -INSERT INTO `sys_role_menu` VALUES ('2', '34'); -INSERT INTO `sys_role_menu` VALUES ('2', '35'); -INSERT INTO `sys_role_menu` VALUES ('2', '36'); -INSERT INTO `sys_role_menu` VALUES ('2', '37'); -INSERT INTO `sys_role_menu` VALUES ('2', '38'); -INSERT INTO `sys_role_menu` VALUES ('2', '39'); -INSERT INTO `sys_role_menu` VALUES ('2', '40'); -INSERT INTO `sys_role_menu` VALUES ('2', '41'); -INSERT INTO `sys_role_menu` VALUES ('2', '42'); -INSERT INTO `sys_role_menu` VALUES ('2', '43'); -INSERT INTO `sys_role_menu` VALUES ('2', '44'); -INSERT INTO `sys_role_menu` VALUES ('2', '45'); -INSERT INTO `sys_role_menu` VALUES ('2', '46'); -INSERT INTO `sys_role_menu` VALUES ('2', '47'); -INSERT INTO `sys_role_menu` VALUES ('2', '48'); -INSERT INTO `sys_role_menu` VALUES ('2', '49'); -INSERT INTO `sys_role_menu` VALUES ('2', '50'); -INSERT INTO `sys_role_menu` VALUES ('2', '51'); -INSERT INTO `sys_role_menu` VALUES ('2', '52'); -INSERT INTO `sys_role_menu` VALUES ('2', '53'); -INSERT INTO `sys_role_menu` VALUES ('2', '54'); -INSERT INTO `sys_role_menu` VALUES ('2', '55'); -INSERT INTO `sys_role_menu` VALUES ('2', '56'); -INSERT INTO `sys_role_menu` VALUES ('2', '57'); -INSERT INTO `sys_role_menu` VALUES ('2', '58'); -INSERT INTO `sys_role_menu` VALUES ('2', '59'); -INSERT INTO `sys_role_menu` VALUES ('2', '60'); -INSERT INTO `sys_role_menu` VALUES ('2', '61'); --- roleId = 2的权限 特地少一个 方便测试 -INSERT INTO `sys_role_menu` VALUES ('3', '1'); - - --- ---------------------------- --- Table structure for sys_user --- ---------------------------- -DROP TABLE IF EXISTS `sys_user`; -CREATE TABLE `sys_user` ( - `user_id` bigint NOT NULL AUTO_INCREMENT COMMENT '用户ID', - `post_id` bigint DEFAULT NULL COMMENT '职位id', - `role_id` bigint DEFAULT NULL COMMENT '角色id', - `dept_id` bigint DEFAULT NULL COMMENT '部门ID', - `username` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户账号', - `nick_name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户昵称', - `user_type` smallint DEFAULT '0' COMMENT '用户类型(00系统用户)', - `email` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '用户邮箱', - `phone_number` varchar(18) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '手机号码', - `sex` smallint DEFAULT '0' COMMENT '用户性别(0男 1女 2未知)', - `avatar` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '头像地址', - `password` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '密码', - `status` smallint NOT NULL DEFAULT '0' COMMENT '帐号状态(1正常 2停用 3冻结)', - `login_ip` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '最后登录IP', - `login_date` datetime DEFAULT NULL COMMENT '最后登录时间', - `is_admin` tinyint(1) NOT NULL DEFAULT '0' COMMENT '超级管理员标志(1是,0否)', - `creator_id` bigint DEFAULT NULL COMMENT '更新者ID', - `create_time` datetime DEFAULT NULL COMMENT '创建时间', - `updater_id` bigint DEFAULT NULL COMMENT '更新者ID', - `update_time` datetime DEFAULT NULL COMMENT '更新时间', - `remark` varchar(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注', - `deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '删除标志(0代表存在 1代表删除)', - PRIMARY KEY (`user_id`) -) ENGINE=InnoDB AUTO_INCREMENT=109 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='用户信息表'; - --- ---------------------------- --- Records of sys_user --- ---------------------------- -INSERT INTO `sys_user` VALUES ('1', '1', '1', '4', 'admin', 'valarchie1', '0', 'agileboot@163.com', '15888888889', '0', '', '$2a$10$rb1wRoEIkLbIknREEN1LH.FGs4g0oOS5t6l5LQ793nRaFO.SPHDHy', '1', '127.0.0.1', '2022-10-06 17:00:06', 1, null, '2022-05-21 08:30:54', '1', '2022-10-06 17:00:06', '管理员', '0'); -INSERT INTO `sys_user` VALUES ('2', '2', '2', '5', 'ag1', 'valarchie2', '0', 'agileboot1@qq.com', '15666666666', '1', '', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '1', '127.0.0.1', '2022-05-21 08:30:54', 0, null, '2022-05-21 08:30:54', null, null, '测试员1', '0'); -INSERT INTO `sys_user` VALUES ('3', '2', '0', '5', 'ag2', 'valarchie3', '0', 'agileboot2@qq.com', '15666666667', '1', '', '$2a$10$7JB720yubVSZvUI0rEqK/.VqGOZTH.ulu33dHOiBE8ByOhJIrdAu2', '1', '127.0.0.1', '2022-05-21 08:30:54', 0, null, '2022-05-21 08:30:54', null, null, '测试员2', '0'); diff --git a/agileboot-system/sql/combine.sh b/agileboot-system/sql/combine.sh deleted file mode 100644 index 3e6ba65..0000000 --- a/agileboot-system/sql/combine.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -# 用于将IDEA导出的不同表sql文件,整合成一份 - -# Get the current date in the format yyyymmdd -current_date=$(date +%Y%m%d) - -# Create the new file name -new_file="agileboot-${current_date}.sql" - -# Check if the new file already exists -if [[ -f "$new_file" ]]; then - # Remove the existing file - rm "$new_file" -fi - -# Loop through all .sql files in the current directory -for file in *.sql -do - # Replace '`agileboot`.' with an empty string and append the contents to the new file with a blank line after - sed "s/\`agileboot-pure\`\./ /g" "$file" >> "$new_file" - echo "" >> "$new_file" -done - -echo "Concatenation complete. Output file: $new_file" \ No newline at end of file diff --git a/agileboot-system/wol-api/src/main/java/com/agileboot/api/system/ststem b/agileboot-system/wol-api/src/main/java/com/agileboot/api/system/ststem deleted file mode 100644 index e69de29..0000000 From d23500d656670d2299bab84e4915c680013a4bfd Mon Sep 17 00:00:00 2001 From: cuijiawang Date: Wed, 24 Sep 2025 16:49:29 +0800 Subject: [PATCH 2/2] del --- agileboot-admin/pom.xml | 72 ----- .../admin/AgileBootAdminApplication.java | 32 --- .../controller/common/FileController.java | 129 --------- .../controller/common/LoginController.java | 139 ---------- .../controller/system/MonitorController.java | 82 ------ .../system/SysConfigController.java | 88 ------ .../controller/system/SysDeptController.java | 111 -------- .../controller/system/SysLogsController.java | 120 -------- .../controller/system/SysMenuController.java | 120 -------- .../system/SysNoticeController.java | 122 --------- .../controller/system/SysPostController.java | 122 --------- .../system/SysProfileController.java | 97 ------- .../controller/system/SysRoleController.java | 197 ------------- .../controller/system/SysUserController.java | 169 ------------ .../customize/aop/accessLog/AccessLog.java | 45 --- .../aop/accessLog/AccessLogAspect.java | 59 ---- .../aop/accessLog/OperationLogModel.java | 159 ----------- .../customize/async/AsyncTaskFactory.java | 77 ------ .../config/JwtAuthenticationTokenFilter.java | 53 ---- .../customize/config/SecurityConfig.java | 164 ----------- .../customize/service/login/LoginService.java | 222 --------------- .../customize/service/login/TokenService.java | 163 ----------- .../service/login/UserDetailsServiceImpl.java | 117 -------- .../service/login/command/LoginCommand.java | 33 --- .../service/login/dto/CaptchaDTO.java | 15 - .../service/login/dto/ConfigDTO.java | 18 -- .../DataPermissionCheckerFactory.java | 66 ----- .../permission/DataPermissionService.java | 70 ----- .../permission/MenuPermissionService.java | 48 ---- .../model/AbstractDataPermissionChecker.java | 25 -- .../permission/model/DataCondition.java | 21 -- .../checker/AllDataPermissionChecker.java | 25 -- .../checker/CustomDataPermissionChecker.java | 42 --- .../checker/DefaultDataPermissionChecker.java | 25 -- .../DeptTreeDataPermissionChecker.java | 44 --- .../OnlySelfDataPermissionChecker.java | 40 --- .../SingleDeptDataPermissionChecker.java | 42 --- .../src/main/resources/application-dev.yml | 104 ------- .../src/main/resources/application-test.yml | 53 ---- .../src/main/resources/application.yml | 46 ---- agileboot-api/pom.xml | 47 ---- .../agileboot/api/AgileBooApiApplication.java | 32 --- .../api/controller/OrderController.java | 25 -- .../api/controller/app/AppController.java | 39 --- .../controller/common/LoginController.java | 38 --- .../config/JwtAuthenticationFilter.java | 52 ---- .../api/customize/config/SecurityConfig.java | 85 ------ .../customize/service/JwtTokenService.java | 127 --------- .../api/customize/util/ApiEncryptor.java | 12 - .../src/main/resources/application.yml | 28 -- agileboot-domain/pom.xml | 41 --- .../domain/common/cache/CacheCenter.java | 52 ---- .../common/cache/GuavaCacheService.java | 39 --- .../domain/common/cache/MapCache.java | 83 ------ .../common/cache/RedisCacheService.java | 82 ------ .../common/command/BulkOperationCommand.java | 28 -- .../common/dto/CurrentLoginUserDTO.java | 18 -- .../agileboot/domain/common/dto/TokenDTO.java | 17 -- .../domain/common/dto/TreeSelectedDTO.java | 19 -- .../domain/common/dto/UploadDTO.java | 18 -- .../domain/common/dto/UploadFileDTO.java | 19 -- .../config/ConfigApplicationService.java | 52 ---- .../config/command/ConfigUpdateCommand.java | 24 -- .../system/config/model/ConfigModel.java | 60 ---- .../config/model/ConfigModelFactory.java | 33 --- .../system/config/query/ConfigQuery.java | 42 --- .../system/dept/DeptApplicationService.java | 88 ------ .../system/dept/command/AddDeptCommand.java | 58 ---- .../dept/command/UpdateDeptCommand.java | 19 -- .../domain/system/dept/db/SysDeptEntity.java | 75 ----- .../domain/system/dept/db/SysDeptMapper.java | 15 - .../domain/system/dept/db/SysDeptService.java | 50 ---- .../system/dept/db/SysDeptServiceImpl.java | 62 ----- .../domain/system/dept/dto/DeptDTO.java | 51 ---- .../domain/system/dept/model/DeptModel.java | 106 ------- .../system/dept/model/DeptModelFactory.java | 45 --- .../domain/system/dept/query/DeptQuery.java | 36 --- .../system/log/LogApplicationService.java | 54 ---- .../system/log/db/SysLoginInfoEntity.java | 79 ------ .../system/log/db/SysLoginInfoMapper.java | 15 - .../system/log/db/SysLoginInfoService.java | 15 - .../log/db/SysLoginInfoServiceImpl.java | 18 -- .../system/log/db/SysOperationLogEntity.java | 115 -------- .../system/log/db/SysOperationLogMapper.java | 15 - .../system/log/db/SysOperationLogService.java | 15 - .../log/db/SysOperationLogServiceImpl.java | 18 -- .../domain/system/log/dto/LoginLogDTO.java | 63 ----- .../system/log/dto/OperationLogDTO.java | 95 ------- .../system/log/query/LoginLogQuery.java | 37 --- .../system/log/query/OperationLogQuery.java | 34 --- .../system/menu/MenuApplicationService.java | 171 ------------ .../system/menu/command/AddMenuCommand.java | 36 --- .../menu/command/UpdateMenuCommand.java | 17 -- .../domain/system/menu/db/SysMenuEntity.java | 80 ------ .../domain/system/menu/db/SysMenuMapper.java | 50 ---- .../domain/system/menu/db/SysMenuService.java | 59 ---- .../system/menu/db/SysMenuServiceImpl.java | 75 ----- .../domain/system/menu/dto/ExtraIconDTO.java | 16 -- .../domain/system/menu/dto/MenuDTO.java | 76 ------ .../domain/system/menu/dto/MenuDetailDTO.java | 30 -- .../domain/system/menu/dto/MetaDTO.java | 60 ---- .../domain/system/menu/dto/RouterDTO.java | 77 ------ .../domain/system/menu/dto/TransitionDTO.java | 19 -- .../domain/system/menu/model/MenuModel.java | 116 -------- .../system/menu/model/MenuModelFactory.java | 33 --- .../domain/system/menu/model/RouterModel.java | 205 -------------- .../domain/system/menu/query/MenuQuery.java | 32 --- .../monitor/MonitorApplicationService.java | 87 ------ .../domain/system/monitor/dto/CpuInfo.java | 64 ----- .../domain/system/monitor/dto/DiskInfo.java | 48 ---- .../domain/system/monitor/dto/JvmInfo.java | 92 ------- .../domain/system/monitor/dto/MemoryInfo.java | 45 --- .../system/monitor/dto/OnlineUserDTO.java | 77 ------ .../system/monitor/dto/RedisCacheInfoDTO.java | 24 -- .../domain/system/monitor/dto/ServerInfo.java | 175 ------------ .../domain/system/monitor/dto/SystemInfo.java | 38 --- .../notice/NoticeApplicationService.java | 69 ----- .../notice/command/NoticeAddCommand.java | 30 -- .../notice/command/NoticeUpdateCommand.java | 19 -- .../system/notice/db/SysNoticeEntity.java | 60 ---- .../system/notice/db/SysNoticeMapper.java | 34 --- .../system/notice/db/SysNoticeService.java | 29 -- .../notice/db/SysNoticeServiceImpl.java | 24 -- .../domain/system/notice/dto/NoticeDTO.java | 45 --- .../system/notice/model/NoticeModel.java | 45 --- .../notice/model/NoticeModelFactory.java | 35 --- .../system/notice/query/NoticeQuery.java | 35 --- .../system/post/PostApplicationService.java | 85 ------ .../system/post/command/AddPostCommand.java | 37 --- .../post/command/UpdatePostCommand.java | 19 -- .../domain/system/post/db/SysPostEntity.java | 60 ---- .../domain/system/post/db/SysPostMapper.java | 15 - .../domain/system/post/db/SysPostService.java | 40 --- .../system/post/db/SysPostServiceImpl.java | 55 ---- .../domain/system/post/dto/PostDTO.java | 52 ---- .../domain/system/post/model/PostModel.java | 63 ----- .../system/post/model/PostModelFactory.java | 31 --- .../domain/system/post/query/PostQuery.java | 35 --- .../system/role/RoleApplicationService.java | 164 ----------- .../system/role/command/AddRoleCommand.java | 52 ---- .../role/command/UpdateDataScopeCommand.java | 26 -- .../role/command/UpdateRoleCommand.java | 19 -- .../role/command/UpdateStatusCommand.java | 17 -- .../domain/system/role/db/SysRoleEntity.java | 68 ----- .../domain/system/role/db/SysRoleMapper.java | 33 --- .../system/role/db/SysRoleMenuEntity.java | 44 --- .../system/role/db/SysRoleMenuMapper.java | 15 - .../system/role/db/SysRoleMenuService.java | 15 - .../role/db/SysRoleMenuServiceImpl.java | 18 -- .../domain/system/role/db/SysRoleService.java | 52 ---- .../system/role/db/SysRoleServiceImpl.java | 55 ---- .../domain/system/role/dto/RoleDTO.java | 50 ---- .../domain/system/role/model/RoleModel.java | 146 ---------- .../system/role/model/RoleModelFactory.java | 55 ---- .../system/role/query/AllocatedRoleQuery.java | 31 --- .../domain/system/role/query/RoleQuery.java | 38 --- .../role/query/UnallocatedRoleQuery.java | 32 --- .../system/user/UserApplicationService.java | 186 ------------- .../system/user/command/AddUserCommand.java | 49 ---- .../user/command/ChangeStatusCommand.java | 14 - .../user/command/ResetPasswordCommand.java | 14 - .../user/command/UpdateProfileCommand.java | 18 -- .../user/command/UpdateUserAvatarCommand.java | 21 -- .../user/command/UpdateUserCommand.java | 15 - .../command/UpdateUserPasswordCommand.java | 15 - .../domain/system/user/db/SearchUserDO.java | 17 -- .../domain/system/user/db/SysUserEntity.java | 105 ------- .../domain/system/user/db/SysUserMapper.java | 96 ------- .../domain/system/user/db/SysUserService.java | 92 ------- .../system/user/db/SysUserServiceImpl.java | 90 ------ .../domain/system/user/dto/UserDTO.java | 133 --------- .../domain/system/user/dto/UserDetailDTO.java | 33 --- .../domain/system/user/dto/UserInfoDTO.java | 15 - .../system/user/dto/UserProfileDTO.java | 32 --- .../domain/system/user/model/UserModel.java | 149 ---------- .../system/user/model/UserModelFactory.java | 41 --- .../system/user/query/SearchUserQuery.java | 43 --- .../resources/mapper/user/SysUserMapper.xml | 7 - agileboot-infrastructure/pom.xml | 137 ---------- .../WarDeploymentInitializer.java | 16 -- .../annotations/ratelimit/RateLimit.java | 121 -------- .../annotations/ratelimit/RateLimitKey.java | 17 -- .../ratelimit/RateLimiterAspect.java | 51 ---- .../AbstractRateLimitChecker.java | 17 -- .../implementation/MapRateLimitChecker.java | 42 --- .../implementation/RedisRateLimitChecker.java | 67 ----- .../unrepeatable/Unrepeatable.java | 95 ------- .../unrepeatable/UnrepeatableInterceptor.java | 65 ----- .../infrastructure/cache/RedisUtil.java | 210 -------------- .../cache/aop/CacheNameConstants.java | 14 - .../cache/aop/GuavaCacheBean.java | 91 ------ .../cache/aop/RedisCacheBean.java | 70 ----- .../cache/aop/package-info.java | 11 - .../guava/AbstractGuavaCacheTemplate.java | 107 -------- .../cache/redis/CacheKeyEnum.java | 46 ---- .../cache/redis/RedisCacheTemplate.java | 127 --------- .../config/ApplicationConfig.java | 21 -- .../infrastructure/config/FilterConfig.java | 80 ------ .../config/GlobalTransactionConfig.java | 108 -------- .../infrastructure/config/JacksonConfig.java | 31 --- .../infrastructure/config/MyBatisConfig.java | 32 --- .../config/ResourcesConfig.java | 27 -- .../config/SpringDocConfig.java | 29 -- .../config/captcha/CaptchaConfig.java | 97 ------- .../captcha/CaptchaMathTextCreator.java | 75 ----- .../config/redis/EmbeddedRedisConfig.java | 38 --- .../config/redis/RedisConfig.java | 61 ----- .../exception/DbExceptionAspect.java | 73 ----- .../exception/GlobalExceptionFilter.java | 58 ---- .../exception/GlobalExceptionInterceptor.java | 106 ------- .../infrastructure/filter/TestFilter.java | 33 --- .../i18n/MessageI18nCheckerRunner.java | 52 ---- .../infrastructure/log/MethodLogAspect.java | 85 ------ .../mybatisplus/CodeGenerator.java | 258 ------------------ .../mybatisplus/CustomMetaObjectHandler.java | 62 ----- .../mybatisplus/MySqlFunction.java | 30 -- .../schedule/ScheduleJobManager.java | 61 ----- .../security/RsaKeyPairGenerator.java | 23 -- .../xss/JsonHtmlXssTrimSerializer.java | 34 --- .../infrastructure/thread/ShutdownHook.java | 32 --- .../infrastructure/thread/ThreadConfig.java | 23 -- .../thread/ThreadPoolManager.java | 72 ----- .../user/AuthenticationUtils.java | 85 ------ .../infrastructure/user/app/AppLoginUser.java | 27 -- .../user/base/BaseLoginUser.java | 128 --------- .../infrastructure/user/base/LoginInfo.java | 36 --- .../user/web/DataScopeEnum.java | 42 --- .../infrastructure/user/web/RoleInfo.java | 44 --- .../user/web/SystemLoginUser.java | 52 ---- .../src/main/resources/application-basic.yml | 129 --------- .../src/main/resources/banner.txt | 8 - .../main/resources/h2sql/agileboot_data.sql | 225 --------------- .../main/resources/h2sql/agileboot_schema.sql | 184 ------------- .../main/resources/i18n/messages.properties | 10 - .../src/main/resources/logback-spring.xml | 122 --------- .../main/resources/pgsql/agileboot_data.sql | 195 ------------- .../main/resources/pgsql/agileboot_schema.sql | 174 ------------ bin/ag-admin.bat | 67 ----- bin/ag-admin.sh | 86 ------ bin/run.bat | 14 - 240 files changed, 15033 deletions(-) delete mode 100644 agileboot-admin/pom.xml delete mode 100644 agileboot-admin/src/main/java/com/agileboot/admin/AgileBootAdminApplication.java delete mode 100644 agileboot-admin/src/main/java/com/agileboot/admin/controller/common/FileController.java delete mode 100644 agileboot-admin/src/main/java/com/agileboot/admin/controller/common/LoginController.java delete mode 100644 agileboot-admin/src/main/java/com/agileboot/admin/controller/system/MonitorController.java delete mode 100644 agileboot-admin/src/main/java/com/agileboot/admin/controller/system/SysConfigController.java delete mode 100644 agileboot-admin/src/main/java/com/agileboot/admin/controller/system/SysDeptController.java delete mode 100644 agileboot-admin/src/main/java/com/agileboot/admin/controller/system/SysLogsController.java delete mode 100644 agileboot-admin/src/main/java/com/agileboot/admin/controller/system/SysMenuController.java delete mode 100644 agileboot-admin/src/main/java/com/agileboot/admin/controller/system/SysNoticeController.java delete mode 100644 agileboot-admin/src/main/java/com/agileboot/admin/controller/system/SysPostController.java delete mode 100644 agileboot-admin/src/main/java/com/agileboot/admin/controller/system/SysProfileController.java delete mode 100644 agileboot-admin/src/main/java/com/agileboot/admin/controller/system/SysRoleController.java delete mode 100644 agileboot-admin/src/main/java/com/agileboot/admin/controller/system/SysUserController.java delete mode 100644 agileboot-admin/src/main/java/com/agileboot/admin/customize/aop/accessLog/AccessLog.java delete mode 100644 agileboot-admin/src/main/java/com/agileboot/admin/customize/aop/accessLog/AccessLogAspect.java delete mode 100644 agileboot-admin/src/main/java/com/agileboot/admin/customize/aop/accessLog/OperationLogModel.java delete mode 100644 agileboot-admin/src/main/java/com/agileboot/admin/customize/async/AsyncTaskFactory.java delete mode 100644 agileboot-admin/src/main/java/com/agileboot/admin/customize/config/JwtAuthenticationTokenFilter.java delete mode 100644 agileboot-admin/src/main/java/com/agileboot/admin/customize/config/SecurityConfig.java delete mode 100644 agileboot-admin/src/main/java/com/agileboot/admin/customize/service/login/LoginService.java delete mode 100644 agileboot-admin/src/main/java/com/agileboot/admin/customize/service/login/TokenService.java delete mode 100644 agileboot-admin/src/main/java/com/agileboot/admin/customize/service/login/UserDetailsServiceImpl.java delete mode 100644 agileboot-admin/src/main/java/com/agileboot/admin/customize/service/login/command/LoginCommand.java delete mode 100644 agileboot-admin/src/main/java/com/agileboot/admin/customize/service/login/dto/CaptchaDTO.java delete mode 100644 agileboot-admin/src/main/java/com/agileboot/admin/customize/service/login/dto/ConfigDTO.java delete mode 100644 agileboot-admin/src/main/java/com/agileboot/admin/customize/service/permission/DataPermissionCheckerFactory.java delete mode 100644 agileboot-admin/src/main/java/com/agileboot/admin/customize/service/permission/DataPermissionService.java delete mode 100644 agileboot-admin/src/main/java/com/agileboot/admin/customize/service/permission/MenuPermissionService.java delete mode 100644 agileboot-admin/src/main/java/com/agileboot/admin/customize/service/permission/model/AbstractDataPermissionChecker.java delete mode 100644 agileboot-admin/src/main/java/com/agileboot/admin/customize/service/permission/model/DataCondition.java delete mode 100644 agileboot-admin/src/main/java/com/agileboot/admin/customize/service/permission/model/checker/AllDataPermissionChecker.java delete mode 100644 agileboot-admin/src/main/java/com/agileboot/admin/customize/service/permission/model/checker/CustomDataPermissionChecker.java delete mode 100644 agileboot-admin/src/main/java/com/agileboot/admin/customize/service/permission/model/checker/DefaultDataPermissionChecker.java delete mode 100644 agileboot-admin/src/main/java/com/agileboot/admin/customize/service/permission/model/checker/DeptTreeDataPermissionChecker.java delete mode 100644 agileboot-admin/src/main/java/com/agileboot/admin/customize/service/permission/model/checker/OnlySelfDataPermissionChecker.java delete mode 100644 agileboot-admin/src/main/java/com/agileboot/admin/customize/service/permission/model/checker/SingleDeptDataPermissionChecker.java delete mode 100644 agileboot-admin/src/main/resources/application-dev.yml delete mode 100644 agileboot-admin/src/main/resources/application-test.yml delete mode 100644 agileboot-admin/src/main/resources/application.yml delete mode 100644 agileboot-api/pom.xml delete mode 100644 agileboot-api/src/main/java/com/agileboot/api/AgileBooApiApplication.java delete mode 100644 agileboot-api/src/main/java/com/agileboot/api/controller/OrderController.java delete mode 100644 agileboot-api/src/main/java/com/agileboot/api/controller/app/AppController.java delete mode 100644 agileboot-api/src/main/java/com/agileboot/api/controller/common/LoginController.java delete mode 100644 agileboot-api/src/main/java/com/agileboot/api/customize/config/JwtAuthenticationFilter.java delete mode 100644 agileboot-api/src/main/java/com/agileboot/api/customize/config/SecurityConfig.java delete mode 100644 agileboot-api/src/main/java/com/agileboot/api/customize/service/JwtTokenService.java delete mode 100644 agileboot-api/src/main/java/com/agileboot/api/customize/util/ApiEncryptor.java delete mode 100644 agileboot-api/src/main/resources/application.yml delete mode 100644 agileboot-domain/pom.xml delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/common/cache/CacheCenter.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/common/cache/GuavaCacheService.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/common/cache/MapCache.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/common/cache/RedisCacheService.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/common/command/BulkOperationCommand.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/common/dto/CurrentLoginUserDTO.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/common/dto/TokenDTO.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/common/dto/TreeSelectedDTO.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/common/dto/UploadDTO.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/common/dto/UploadFileDTO.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/config/ConfigApplicationService.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/config/command/ConfigUpdateCommand.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/config/model/ConfigModel.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/config/model/ConfigModelFactory.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/config/query/ConfigQuery.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/dept/DeptApplicationService.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/dept/command/AddDeptCommand.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/dept/command/UpdateDeptCommand.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/dept/db/SysDeptEntity.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/dept/db/SysDeptMapper.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/dept/db/SysDeptService.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/dept/db/SysDeptServiceImpl.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/dept/dto/DeptDTO.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/dept/model/DeptModel.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/dept/model/DeptModelFactory.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/dept/query/DeptQuery.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/log/LogApplicationService.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/log/db/SysLoginInfoEntity.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/log/db/SysLoginInfoMapper.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/log/db/SysLoginInfoService.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/log/db/SysLoginInfoServiceImpl.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/log/db/SysOperationLogEntity.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/log/db/SysOperationLogMapper.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/log/db/SysOperationLogService.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/log/db/SysOperationLogServiceImpl.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/log/dto/LoginLogDTO.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/log/dto/OperationLogDTO.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/log/query/LoginLogQuery.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/log/query/OperationLogQuery.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/menu/MenuApplicationService.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/menu/command/AddMenuCommand.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/menu/command/UpdateMenuCommand.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/menu/db/SysMenuEntity.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/menu/db/SysMenuMapper.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/menu/db/SysMenuService.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/menu/db/SysMenuServiceImpl.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/menu/dto/ExtraIconDTO.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/menu/dto/MenuDTO.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/menu/dto/MenuDetailDTO.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/menu/dto/MetaDTO.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/menu/dto/RouterDTO.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/menu/dto/TransitionDTO.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/menu/model/MenuModel.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/menu/model/MenuModelFactory.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/menu/model/RouterModel.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/menu/query/MenuQuery.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/monitor/MonitorApplicationService.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/monitor/dto/CpuInfo.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/monitor/dto/DiskInfo.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/monitor/dto/JvmInfo.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/monitor/dto/MemoryInfo.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/monitor/dto/OnlineUserDTO.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/monitor/dto/RedisCacheInfoDTO.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/monitor/dto/ServerInfo.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/monitor/dto/SystemInfo.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/notice/NoticeApplicationService.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/notice/command/NoticeAddCommand.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/notice/command/NoticeUpdateCommand.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/notice/db/SysNoticeEntity.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/notice/db/SysNoticeMapper.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/notice/db/SysNoticeService.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/notice/db/SysNoticeServiceImpl.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/notice/dto/NoticeDTO.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/notice/model/NoticeModel.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/notice/model/NoticeModelFactory.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/notice/query/NoticeQuery.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/post/PostApplicationService.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/post/command/AddPostCommand.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/post/command/UpdatePostCommand.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/post/db/SysPostEntity.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/post/db/SysPostMapper.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/post/db/SysPostService.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/post/db/SysPostServiceImpl.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/post/dto/PostDTO.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/post/model/PostModel.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/post/model/PostModelFactory.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/post/query/PostQuery.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/role/RoleApplicationService.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/role/command/AddRoleCommand.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/role/command/UpdateDataScopeCommand.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/role/command/UpdateRoleCommand.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/role/command/UpdateStatusCommand.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/role/db/SysRoleEntity.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/role/db/SysRoleMapper.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/role/db/SysRoleMenuEntity.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/role/db/SysRoleMenuMapper.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/role/db/SysRoleMenuService.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/role/db/SysRoleMenuServiceImpl.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/role/db/SysRoleService.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/role/db/SysRoleServiceImpl.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/role/dto/RoleDTO.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/role/model/RoleModel.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/role/model/RoleModelFactory.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/role/query/AllocatedRoleQuery.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/role/query/RoleQuery.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/role/query/UnallocatedRoleQuery.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/user/UserApplicationService.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/user/command/AddUserCommand.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/user/command/ChangeStatusCommand.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/user/command/ResetPasswordCommand.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/user/command/UpdateProfileCommand.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/user/command/UpdateUserAvatarCommand.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/user/command/UpdateUserCommand.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/user/command/UpdateUserPasswordCommand.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/user/db/SearchUserDO.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/user/db/SysUserEntity.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/user/db/SysUserMapper.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/user/db/SysUserService.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/user/db/SysUserServiceImpl.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/user/dto/UserDTO.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/user/dto/UserDetailDTO.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/user/dto/UserInfoDTO.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/user/dto/UserProfileDTO.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/user/model/UserModel.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/user/model/UserModelFactory.java delete mode 100644 agileboot-domain/src/main/java/com/agileboot/domain/system/user/query/SearchUserQuery.java delete mode 100644 agileboot-domain/src/main/resources/mapper/user/SysUserMapper.xml delete mode 100644 agileboot-infrastructure/pom.xml delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/WarDeploymentInitializer.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/annotations/ratelimit/RateLimit.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/annotations/ratelimit/RateLimitKey.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/annotations/ratelimit/RateLimiterAspect.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/annotations/ratelimit/implementation/AbstractRateLimitChecker.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/annotations/ratelimit/implementation/MapRateLimitChecker.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/annotations/ratelimit/implementation/RedisRateLimitChecker.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/annotations/unrepeatable/Unrepeatable.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/annotations/unrepeatable/UnrepeatableInterceptor.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/cache/RedisUtil.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/cache/aop/CacheNameConstants.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/cache/aop/GuavaCacheBean.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/cache/aop/RedisCacheBean.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/cache/aop/package-info.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/cache/guava/AbstractGuavaCacheTemplate.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/cache/redis/CacheKeyEnum.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/cache/redis/RedisCacheTemplate.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/config/ApplicationConfig.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/config/FilterConfig.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/config/GlobalTransactionConfig.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/config/JacksonConfig.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/config/MyBatisConfig.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/config/ResourcesConfig.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/config/SpringDocConfig.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/config/captcha/CaptchaConfig.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/config/captcha/CaptchaMathTextCreator.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/config/redis/EmbeddedRedisConfig.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/config/redis/RedisConfig.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/exception/DbExceptionAspect.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/exception/GlobalExceptionFilter.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/exception/GlobalExceptionInterceptor.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/filter/TestFilter.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/i18n/MessageI18nCheckerRunner.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/log/MethodLogAspect.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/mybatisplus/CodeGenerator.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/mybatisplus/CustomMetaObjectHandler.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/mybatisplus/MySqlFunction.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/schedule/ScheduleJobManager.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/security/RsaKeyPairGenerator.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/security/xss/JsonHtmlXssTrimSerializer.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/thread/ShutdownHook.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/thread/ThreadConfig.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/thread/ThreadPoolManager.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/user/AuthenticationUtils.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/user/app/AppLoginUser.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/user/base/BaseLoginUser.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/user/base/LoginInfo.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/user/web/DataScopeEnum.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/user/web/RoleInfo.java delete mode 100644 agileboot-infrastructure/src/main/java/com/agileboot/infrastructure/user/web/SystemLoginUser.java delete mode 100644 agileboot-infrastructure/src/main/resources/application-basic.yml delete mode 100644 agileboot-infrastructure/src/main/resources/banner.txt delete mode 100644 agileboot-infrastructure/src/main/resources/h2sql/agileboot_data.sql delete mode 100644 agileboot-infrastructure/src/main/resources/h2sql/agileboot_schema.sql delete mode 100644 agileboot-infrastructure/src/main/resources/i18n/messages.properties delete mode 100644 agileboot-infrastructure/src/main/resources/logback-spring.xml delete mode 100644 agileboot-infrastructure/src/main/resources/pgsql/agileboot_data.sql delete mode 100644 agileboot-infrastructure/src/main/resources/pgsql/agileboot_schema.sql delete mode 100644 bin/ag-admin.bat delete mode 100644 bin/ag-admin.sh delete mode 100644 bin/run.bat diff --git a/agileboot-admin/pom.xml b/agileboot-admin/pom.xml deleted file mode 100644 index d53826a..0000000 --- a/agileboot-admin/pom.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - agileboot - com.agileboot - 1.0.0 - - jar - 4.0.0 - - agileboot-admin - - - web服务入口 - - - - - - - com.agileboot - agileboot-domain - - - - org.springframework.boot - spring-boot-starter-test - test - - - org.junit.vintage - junit-vintage-engine - - - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - org.springframework.boot - spring-boot-maven-plugin - - - - repackage - - - - - - org.apache.maven.plugins - maven-surefire-plugin - ${maven.surefire.plugin.version} - - - false - - - - - - - - diff --git a/agileboot-admin/src/main/java/com/agileboot/admin/AgileBootAdminApplication.java b/agileboot-admin/src/main/java/com/agileboot/admin/AgileBootAdminApplication.java deleted file mode 100644 index 7fdfd4c..0000000 --- a/agileboot-admin/src/main/java/com/agileboot/admin/AgileBootAdminApplication.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.agileboot.admin; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; -import org.springframework.context.annotation.ComponentScan; - -/** - * 启动程序 - * 定制banner.txt的网站 - * http://patorjk.com/software/taag - * http://www.network-science.de/ascii/ - * http://www.degraeve.com/img2txt.php - * http://life.chacuo.net/convertfont2char - * @author valarchie - */ -@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}) -@ComponentScan(basePackages = "com.agileboot.*") -public class AgileBootAdminApplication { - - public static void main(String[] args) { - SpringApplication.run(AgileBootAdminApplication.class, args); - String successMsg = " ____ _ _ __ _ _ \n" - + " / ___| | |_ __ _ _ __ | |_ _ _ _ __ ___ _ _ ___ ___ ___ ___ ___ / _| _ _ | || |\n" - + " \\___ \\ | __|/ _` || '__|| __| | | | || '_ \\ / __|| | | | / __|/ __|/ _ \\/ __|/ __|| |_ | | | || || |\n" - + " ___) || |_| (_| || | | |_ | |_| || |_) | \\__ \\| |_| || (__| (__| __/\\__ \\\\__ \\| _|| |_| || ||_|\n" - + " |____/ \\__|\\__,_||_| \\__| \\__,_|| .__/ |___/ \\__,_| \\___|\\___|\\___||___/|___/|_| \\__,_||_|(_)\n" - + " |_| "; - - System.out.println(successMsg); - } -} diff --git a/agileboot-admin/src/main/java/com/agileboot/admin/controller/common/FileController.java b/agileboot-admin/src/main/java/com/agileboot/admin/controller/common/FileController.java deleted file mode 100644 index 6960c3b..0000000 --- a/agileboot-admin/src/main/java/com/agileboot/admin/controller/common/FileController.java +++ /dev/null @@ -1,129 +0,0 @@ -package com.agileboot.admin.controller.common; - -import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.io.FileUtil; -import cn.hutool.core.io.file.FileNameUtil; -import com.agileboot.common.constant.Constants.UploadSubDir; -import com.agileboot.common.core.dto.ResponseDTO; -import com.agileboot.common.exception.ApiException; -import com.agileboot.common.exception.error.ErrorCode; -import com.agileboot.common.exception.error.ErrorCode.Business; -import com.agileboot.common.utils.ServletHolderUtil; -import com.agileboot.common.utils.file.FileUploadUtils; -import com.agileboot.common.utils.jackson.JacksonUtil; -import com.agileboot.domain.common.dto.UploadDTO; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import java.util.ArrayList; -import java.util.List; -import jakarta.servlet.http.HttpServletResponse; -import lombok.extern.slf4j.Slf4j; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.multipart.MultipartFile; - -/** - * 通用请求处理 - * TODO 需要重构 - * @author valarchie - */ -@Tag(name = "上传API", description = "上传相关接口") -@RestController -@RequestMapping("/file") -@Slf4j -public class FileController { - - - /** - * 通用下载请求 - * download接口 其实不是很有必要 - * @param fileName 文件名称 - */ - @Operation(summary = "下载文件") - @GetMapping("/download") - public ResponseEntity fileDownload(String fileName, HttpServletResponse response) { - try { - if (!FileUploadUtils.isAllowDownload(fileName)) { - // 返回类型是ResponseEntity 不能捕获异常, 需要手动将错误填到 ResponseEntity - ResponseDTO fail = ResponseDTO.fail( - new ApiException(Business.COMMON_FILE_NOT_ALLOWED_TO_DOWNLOAD, fileName)); - return new ResponseEntity<>(JacksonUtil.to(fail).getBytes(), null, HttpStatus.OK); - } - - String filePath = FileUploadUtils.getFileAbsolutePath(UploadSubDir.DOWNLOAD_PATH, fileName); - - HttpHeaders downloadHeader = FileUploadUtils.getDownloadHeader(fileName); - - response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE); - return new ResponseEntity<>(FileUtil.readBytes(filePath), downloadHeader, HttpStatus.OK); - } catch (Exception e) { - log.error("下载文件失败", e); - return null; - } - } - - /** - * 通用上传请求(单个) - */ - @Operation(summary = "单个上传文件") - @PostMapping("/upload") - public ResponseDTO uploadFile(MultipartFile file) { - if (file == null) { - throw new ApiException(ErrorCode.Business.UPLOAD_FILE_IS_EMPTY); - } - - // 上传并返回新文件名称 - String fileName = FileUploadUtils.upload(UploadSubDir.UPLOAD_PATH, file); - - String url = ServletHolderUtil.getContextUrl() + fileName; - - UploadDTO uploadDTO = UploadDTO.builder() - // 全路径 - .url(url) - // 相对路径 - .fileName(fileName) - // 新生成的文件名 - .newFileName(FileNameUtil.getName(fileName)) - // 原始的文件名 - .originalFilename(file.getOriginalFilename()).build(); - - return ResponseDTO.ok(uploadDTO); - } - - /** - * 通用上传请求(多个) - */ - @Operation(summary = "多个上传文件") - @PostMapping("/uploads") - public ResponseDTO> uploadFiles(List files) { - if (CollUtil.isEmpty(files)) { - throw new ApiException(ErrorCode.Business.UPLOAD_FILE_IS_EMPTY); - } - - List uploads = new ArrayList<>(); - - for (MultipartFile file : files) { - if (file != null) { - // 上传并返回新文件名称 - String fileName = FileUploadUtils.upload(UploadSubDir.UPLOAD_PATH, file); - String url = ServletHolderUtil.getContextUrl() + fileName; - UploadDTO uploadDTO = UploadDTO.builder() - .url(url) - .fileName(fileName) - .newFileName(FileNameUtil.getName(fileName)) - .originalFilename(file.getOriginalFilename()).build(); - - uploads.add(uploadDTO); - - } - } - return ResponseDTO.ok(uploads); - } - -} diff --git a/agileboot-admin/src/main/java/com/agileboot/admin/controller/common/LoginController.java b/agileboot-admin/src/main/java/com/agileboot/admin/controller/common/LoginController.java deleted file mode 100644 index 6c365ca..0000000 --- a/agileboot-admin/src/main/java/com/agileboot/admin/controller/common/LoginController.java +++ /dev/null @@ -1,139 +0,0 @@ -package com.agileboot.admin.controller.common; - -import cn.hutool.core.util.StrUtil; -import com.agileboot.common.config.AgileBootConfig; -import com.agileboot.common.core.dto.ResponseDTO; -import com.agileboot.common.exception.ApiException; -import com.agileboot.common.exception.error.ErrorCode.Business; -import com.agileboot.domain.common.dto.CurrentLoginUserDTO; -import com.agileboot.domain.common.dto.TokenDTO; -import com.agileboot.domain.system.menu.MenuApplicationService; -import com.agileboot.domain.system.menu.dto.RouterDTO; -import com.agileboot.domain.system.user.UserApplicationService; -import com.agileboot.domain.system.user.command.AddUserCommand; -import com.agileboot.infrastructure.annotations.ratelimit.RateLimit; -import com.agileboot.infrastructure.annotations.ratelimit.RateLimit.CacheType; -import com.agileboot.infrastructure.annotations.ratelimit.RateLimit.LimitType; -import com.agileboot.infrastructure.user.AuthenticationUtils; -import com.agileboot.admin.customize.service.login.dto.CaptchaDTO; -import com.agileboot.admin.customize.service.login.dto.ConfigDTO; -import com.agileboot.admin.customize.service.login.command.LoginCommand; -import com.agileboot.infrastructure.user.web.SystemLoginUser; -import com.agileboot.infrastructure.annotations.ratelimit.RateLimitKey; -import com.agileboot.admin.customize.service.login.LoginService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import java.util.List; -import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; - -/** - * 首页 - * - * @author valarchie - */ -@Tag(name = "登录API", description = "登录相关接口") -@RestController -@RequiredArgsConstructor -public class LoginController { - - private final LoginService loginService; - - private final MenuApplicationService menuApplicationService; - - private final UserApplicationService userApplicationService; - - private final AgileBootConfig agileBootConfig; - - /** - * 访问首页,提示语 - */ - @Operation(summary = "首页") - @GetMapping("/") - @RateLimit(key = RateLimitKey.TEST_KEY, time = 10, maxCount = 5, cacheType = CacheType.Map, - limitType = LimitType.GLOBAL) - public String index() { - return StrUtil.format("欢迎使用{}后台管理框架,当前版本:v{},请通过前端地址访问。", - agileBootConfig.getName(), agileBootConfig.getVersion()); - } - - - /** - * 获取系统的内置配置 - * - * @return 配置信息 - */ - @GetMapping("/getConfig") - public ResponseDTO getConfig() { - ConfigDTO configDTO = loginService.getConfig(); - return ResponseDTO.ok(configDTO); - } - - /** - * 生成验证码 - */ - @Operation(summary = "验证码") - @RateLimit(key = RateLimitKey.LOGIN_CAPTCHA_KEY, time = 10, maxCount = 10, cacheType = CacheType.REDIS, - limitType = LimitType.IP) - @GetMapping("/captchaImage") - public ResponseDTO getCaptchaImg() { - CaptchaDTO captchaImg = loginService.generateCaptchaImg(); - return ResponseDTO.ok(captchaImg); - } - - /** - * 登录方法 - * - * @param loginCommand 登录信息 - * @return 结果 - */ - @Operation(summary = "登录") - @PostMapping("/login") - public ResponseDTO login(@RequestBody LoginCommand loginCommand) { - // 生成令牌 - String token = loginService.login(loginCommand); - SystemLoginUser loginUser = AuthenticationUtils.getSystemLoginUser(); - CurrentLoginUserDTO currentUserDTO = userApplicationService.getLoginUserInfo(loginUser); - - return ResponseDTO.ok(new TokenDTO(token, currentUserDTO)); - } - - /** - * 获取用户信息 - * - * @return 用户信息 - */ - @Operation(summary = "获取当前登录用户信息") - @GetMapping("/getLoginUserInfo") - public ResponseDTO getLoginUserInfo() { - SystemLoginUser loginUser = AuthenticationUtils.getSystemLoginUser(); - - CurrentLoginUserDTO currentUserDTO = userApplicationService.getLoginUserInfo(loginUser); - - return ResponseDTO.ok(currentUserDTO); - } - - /** - * 获取路由信息 - * TODO 如果要在前端开启路由缓存的话 需要在ServerConfig.json 中 设置CachingAsyncRoutes=true 避免一直重复请求路由接口 - * @return 路由信息 - */ - @Operation(summary = "获取用户对应的菜单路由", description = "用于动态生成路由") - @GetMapping("/getRouters") - public ResponseDTO> getRouters() { - SystemLoginUser loginUser = AuthenticationUtils.getSystemLoginUser(); - List routerTree = menuApplicationService.getRouterTree(loginUser); - return ResponseDTO.ok(routerTree); - } - - - @Operation(summary = "注册接口", description = "暂未实现") - @PostMapping("/register") - public ResponseDTO register(@RequestBody AddUserCommand command) { - return ResponseDTO.fail(new ApiException(Business.COMMON_UNSUPPORTED_OPERATION)); - } - -} diff --git a/agileboot-admin/src/main/java/com/agileboot/admin/controller/system/MonitorController.java b/agileboot-admin/src/main/java/com/agileboot/admin/controller/system/MonitorController.java deleted file mode 100644 index a0d29cf..0000000 --- a/agileboot-admin/src/main/java/com/agileboot/admin/controller/system/MonitorController.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.agileboot.admin.controller.system; - -import com.agileboot.common.core.base.BaseController; -import com.agileboot.common.core.dto.ResponseDTO; -import com.agileboot.common.core.page.PageDTO; -import com.agileboot.domain.common.cache.CacheCenter; -import com.agileboot.domain.system.monitor.MonitorApplicationService; -import com.agileboot.domain.system.monitor.dto.OnlineUserDTO; -import com.agileboot.domain.system.monitor.dto.RedisCacheInfoDTO; -import com.agileboot.domain.system.monitor.dto.ServerInfo; -import com.agileboot.admin.customize.aop.accessLog.AccessLog; -import com.agileboot.common.enums.common.BusinessTypeEnum; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import java.util.List; -import lombok.RequiredArgsConstructor; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * 缓存监控 - * - * @author valarchie - */ -@Tag(name = "监控API", description = "监控相关信息") -@RestController -@RequestMapping("/monitor") -@RequiredArgsConstructor -public class MonitorController extends BaseController { - - private final MonitorApplicationService monitorApplicationService; - - @Operation(summary = "Redis信息") - @PreAuthorize("@permission.has('monitor:cache:list')") - @GetMapping("/cacheInfo") - public ResponseDTO getRedisCacheInfo() { - RedisCacheInfoDTO redisCacheInfo = monitorApplicationService.getRedisCacheInfo(); - return ResponseDTO.ok(redisCacheInfo); - } - - - @Operation(summary = "服务器信息") - @PreAuthorize("@permission.has('monitor:server:list')") - @GetMapping("/serverInfo") - public ResponseDTO getServerInfo() { - ServerInfo serverInfo = monitorApplicationService.getServerInfo(); - return ResponseDTO.ok(serverInfo); - } - - /** - * 获取在线用户列表 - * - * @param ipAddress ip地址 - * @param username 用户名 - * @return 分页处理后的在线用户信息 - */ - @Operation(summary = "在线用户列表") - @PreAuthorize("@permission.has('monitor:online:list')") - @GetMapping("/onlineUsers") - public ResponseDTO> onlineUsers(String ipAddress, String username) { - List onlineUserList = monitorApplicationService.getOnlineUserList(username, ipAddress); - return ResponseDTO.ok(new PageDTO<>(onlineUserList)); - } - - /** - * 强退用户 - */ - @Operation(summary = "强退用户") - @PreAuthorize("@permission.has('monitor:online:forceLogout')") - @AccessLog(title = "在线用户", businessType = BusinessTypeEnum.FORCE_LOGOUT) - @DeleteMapping("/onlineUser/{tokenId}") - public ResponseDTO logoutOnlineUser(@PathVariable String tokenId) { - CacheCenter.loginUserCache.delete(tokenId); - return ResponseDTO.ok(); - } - - -} diff --git a/agileboot-admin/src/main/java/com/agileboot/admin/controller/system/SysConfigController.java b/agileboot-admin/src/main/java/com/agileboot/admin/controller/system/SysConfigController.java deleted file mode 100644 index c53e3b2..0000000 --- a/agileboot-admin/src/main/java/com/agileboot/admin/controller/system/SysConfigController.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.agileboot.admin.controller.system; - -import com.agileboot.common.core.base.BaseController; -import com.agileboot.common.core.dto.ResponseDTO; -import com.agileboot.common.core.page.PageDTO; -import com.agileboot.domain.common.cache.CacheCenter; -import com.agileboot.domain.system.config.ConfigApplicationService; -import com.agileboot.domain.system.config.command.ConfigUpdateCommand; -import com.agileboot.domain.system.config.dto.ConfigDTO; -import com.agileboot.domain.system.config.query.ConfigQuery; -import com.agileboot.admin.customize.aop.accessLog.AccessLog; -import com.agileboot.common.enums.common.BusinessTypeEnum; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import jakarta.validation.constraints.NotNull; -import jakarta.validation.constraints.Positive; -import lombok.RequiredArgsConstructor; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * 参数配置 信息操作处理 - * @author valarchie - */ -@RestController -@RequestMapping("/system") -@Validated -@RequiredArgsConstructor -@Tag(name = "配置API", description = "配置相关的增删查改") -public class SysConfigController extends BaseController { - - private final ConfigApplicationService configApplicationService; - - /** - * 获取参数配置列表 - */ - @Operation(summary = "参数列表", description = "分页获取配置参数列表") - @PreAuthorize("@permission.has('system:config:list')") - @GetMapping("/configs") - public ResponseDTO> list(ConfigQuery query) { - PageDTO page = configApplicationService.getConfigList(query); - return ResponseDTO.ok(page); - } - - /** - * 根据参数编号获取详细信息 - */ - @PreAuthorize("@permission.has('system:config:query')") - @GetMapping(value = "/config/{configId}") - @Operation(summary = "配置信息", description = "配置的详细信息") - public ResponseDTO getInfo(@NotNull @Positive @PathVariable Long configId) { - ConfigDTO config = configApplicationService.getConfigInfo(configId); - return ResponseDTO.ok(config); - } - - - /** - * 修改参数配置 - */ - @PreAuthorize("@permission.has('system:config:edit')") - @AccessLog(title = "参数管理", businessType = BusinessTypeEnum.MODIFY) - @Operation(summary = "配置修改", description = "配置修改") - @PutMapping(value = "/config/{configId}") - public ResponseDTO edit(@NotNull @Positive @PathVariable Long configId, @RequestBody ConfigUpdateCommand config) { - config.setConfigId(configId); - configApplicationService.updateConfig(config); - return ResponseDTO.ok(); - } - - /** - * 刷新参数缓存 - */ - @Operation(summary = "刷新配置缓存") - @PreAuthorize("@permission.has('system:config:remove')") - @AccessLog(title = "参数管理", businessType = BusinessTypeEnum.CLEAN) - @DeleteMapping("/configs/cache") - public ResponseDTO refreshCache() { - CacheCenter.configCache.invalidateAll(); - return ResponseDTO.ok(); - } -} diff --git a/agileboot-admin/src/main/java/com/agileboot/admin/controller/system/SysDeptController.java b/agileboot-admin/src/main/java/com/agileboot/admin/controller/system/SysDeptController.java deleted file mode 100644 index d2df346..0000000 --- a/agileboot-admin/src/main/java/com/agileboot/admin/controller/system/SysDeptController.java +++ /dev/null @@ -1,111 +0,0 @@ -package com.agileboot.admin.controller.system; - -import cn.hutool.core.lang.tree.Tree; -import com.agileboot.common.core.base.BaseController; -import com.agileboot.common.core.dto.ResponseDTO; -import com.agileboot.domain.system.dept.DeptApplicationService; -import com.agileboot.domain.system.dept.command.AddDeptCommand; -import com.agileboot.domain.system.dept.command.UpdateDeptCommand; -import com.agileboot.domain.system.dept.dto.DeptDTO; -import com.agileboot.domain.system.dept.query.DeptQuery; -import com.agileboot.admin.customize.aop.accessLog.AccessLog; -import com.agileboot.common.enums.common.BusinessTypeEnum; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import java.util.List; -import jakarta.validation.constraints.NotNull; -import lombok.RequiredArgsConstructor; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * 部门信息 - * - * @author valarchie - */ -@RestController -@RequestMapping("/system") -@Validated -@RequiredArgsConstructor -@Tag(name = "部门API", description = "部门相关的增删查改") -public class SysDeptController extends BaseController { - - private final DeptApplicationService deptApplicationService; - - /** - * 获取部门列表 - */ - @Operation(summary = "部门列表") - @PreAuthorize("@permission.has('system:dept:list')") - @GetMapping("/depts") - public ResponseDTO> list(DeptQuery query) { - List deptList = deptApplicationService.getDeptList(query); - return ResponseDTO.ok(deptList); - } - - /** - * 根据部门编号获取详细信息 - */ - @Operation(summary = "部门详情") - @PreAuthorize("@permission.has('system:dept:query')") - @GetMapping(value = "/dept/{deptId}") - public ResponseDTO getInfo(@PathVariable Long deptId) { - DeptDTO dept = deptApplicationService.getDeptInfo(deptId); - return ResponseDTO.ok(dept); - } - - /** - * 获取部门下拉树列表 - */ - @Operation(summary = "获取部门树级结构") - @GetMapping("/depts/dropdown") - public ResponseDTO>> dropdownList() { - List> deptTree = deptApplicationService.getDeptTree(); - return ResponseDTO.ok(deptTree); - } - - /** - * 新增部门 - */ - @Operation(summary = "新增部门") - @PreAuthorize("@permission.has('system:dept:add')") - @AccessLog(title = "部门管理", businessType = BusinessTypeEnum.ADD) - @PostMapping("/dept") - public ResponseDTO add(@RequestBody AddDeptCommand addCommand) { - deptApplicationService.addDept(addCommand); - return ResponseDTO.ok(); - } - - /** - * 修改部门 - */ - @Operation(summary = "修改部门") - @PreAuthorize("@permission.has('system:dept:edit') AND @dataScope.checkDeptId(#updateCommand.deptId)") - @AccessLog(title = "部门管理", businessType = BusinessTypeEnum.MODIFY) - @PutMapping("/dept/{deptId}") - public ResponseDTO edit(@PathVariable("deptId")Long deptId, @RequestBody UpdateDeptCommand updateCommand) { - updateCommand.setDeptId(deptId); - deptApplicationService.updateDept(updateCommand); - return ResponseDTO.ok(); - } - - /** - * 删除部门 - */ - @Operation(summary = "删除部门") - @PreAuthorize("@permission.has('system:dept:remove') AND @dataScope.checkDeptId(#deptId)") - @AccessLog(title = "部门管理", businessType = BusinessTypeEnum.DELETE) - @DeleteMapping("/dept/{deptId}") - public ResponseDTO remove(@PathVariable @NotNull Long deptId) { - deptApplicationService.removeDept(deptId); - return ResponseDTO.ok(); - } -} diff --git a/agileboot-admin/src/main/java/com/agileboot/admin/controller/system/SysLogsController.java b/agileboot-admin/src/main/java/com/agileboot/admin/controller/system/SysLogsController.java deleted file mode 100644 index f508f0b..0000000 --- a/agileboot-admin/src/main/java/com/agileboot/admin/controller/system/SysLogsController.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.agileboot.admin.controller.system; - - -import com.agileboot.common.core.base.BaseController; -import com.agileboot.common.core.dto.ResponseDTO; -import com.agileboot.common.core.page.PageDTO; -import com.agileboot.common.utils.poi.CustomExcelUtil; -import com.agileboot.domain.common.command.BulkOperationCommand; -import com.agileboot.domain.system.log.LogApplicationService; -import com.agileboot.domain.system.log.dto.LoginLogDTO; -import com.agileboot.domain.system.log.query.LoginLogQuery; -import com.agileboot.domain.system.log.dto.OperationLogDTO; -import com.agileboot.domain.system.log.query.OperationLogQuery; -import com.agileboot.admin.customize.aop.accessLog.AccessLog; -import com.agileboot.common.enums.common.BusinessTypeEnum; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import java.util.List; -import jakarta.servlet.http.HttpServletResponse; -import jakarta.validation.constraints.NotEmpty; -import jakarta.validation.constraints.NotNull; -import lombok.RequiredArgsConstructor; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -/** - * 系统访问记录 - * - * @author valarchie - */ -@Tag(name = "日志API", description = "日志相关API") -@RestController -@RequestMapping("/logs") -@Validated -@RequiredArgsConstructor -public class SysLogsController extends BaseController { - - private final LogApplicationService logApplicationService; - - @Operation(summary = "登录日志列表") - @PreAuthorize("@permission.has('monitor:logininfor:list')") - @GetMapping("/loginLogs") - public ResponseDTO> loginInfoList(LoginLogQuery query) { - PageDTO pageDTO = logApplicationService.getLoginInfoList(query); - return ResponseDTO.ok(pageDTO); - } - - @Operation(summary = "登录日志导出", description = "将登录日志导出到excel") - @AccessLog(title = "登录日志", businessType = BusinessTypeEnum.EXPORT) - @PreAuthorize("@permission.has('monitor:logininfor:export')") - @GetMapping("/loginLogs/excel") - public void loginInfosExcel(HttpServletResponse response, LoginLogQuery query) { - PageDTO pageDTO = logApplicationService.getLoginInfoList(query); - CustomExcelUtil.writeToResponse(pageDTO.getRows(), LoginLogDTO.class, response); - } - - @Operation(summary = "删除登录日志") - @PreAuthorize("@permission.has('monitor:logininfor:remove')") - @AccessLog(title = "登录日志", businessType = BusinessTypeEnum.DELETE) - @DeleteMapping("/loginLogs") - public ResponseDTO removeLoginInfos(@RequestParam @NotNull @NotEmpty List ids) { - logApplicationService.deleteLoginInfo(new BulkOperationCommand<>(ids)); - return ResponseDTO.ok(); - } - - @Operation(summary = "操作日志列表") - @PreAuthorize("@permission.has('monitor:operlog:list')") - @GetMapping("/operationLogs") - public ResponseDTO> operationLogs(OperationLogQuery query) { - PageDTO pageDTO = logApplicationService.getOperationLogList(query); - return ResponseDTO.ok(pageDTO); - } - -// @GetMapping("/download") -// public ResponseEntity downloadFile() throws IOException { -// // 从文件系统或其他位置获取文件输入流 -// File file = new File("path/to/file"); -// InputStream inputStream = new FileInputStream(file); -// CustomExcelUtil.wri -// -// // 创建一个 InputStreamResource 对象,将文件输入流包装在其中 -// InputStreamResource resource = new InputStreamResource(inputStream); -// -// // 返回 ResponseEntity 对象,其中包含 InputStreamResource 对象和文件名 -// return ResponseEntity.ok() -// .header(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + file.getName()) -// .contentType(MediaType.APPLICATION_OCTET_STREAM) -// .contentLength(file.length()) -// .body(resource); -// } - /** - * 可否改成以上的形式 TODO - * @param response - * @param query - */ - @Operation(summary = "操作日志导出") - @AccessLog(title = "操作日志", businessType = BusinessTypeEnum.EXPORT) - @PreAuthorize("@permission.has('monitor:operlog:export')") - @GetMapping("/operationLogs/excel") - public void operationLogsExcel(HttpServletResponse response, OperationLogQuery query) { - PageDTO pageDTO = logApplicationService.getOperationLogList(query); - CustomExcelUtil.writeToResponse(pageDTO.getRows(), OperationLogDTO.class, response); - } - - @Operation(summary = "删除操作日志") - @AccessLog(title = "操作日志", businessType = BusinessTypeEnum.DELETE) - @PreAuthorize("@permission.has('monitor:operlog:remove')") - @DeleteMapping("/operationLogs") - public ResponseDTO removeOperationLogs(@RequestParam List operationIds) { - logApplicationService.deleteOperationLog(new BulkOperationCommand<>(operationIds)); - return ResponseDTO.ok(); - } - - -} diff --git a/agileboot-admin/src/main/java/com/agileboot/admin/controller/system/SysMenuController.java b/agileboot-admin/src/main/java/com/agileboot/admin/controller/system/SysMenuController.java deleted file mode 100644 index ff7a6db..0000000 --- a/agileboot-admin/src/main/java/com/agileboot/admin/controller/system/SysMenuController.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.agileboot.admin.controller.system; - -import cn.hutool.core.lang.tree.Tree; -import com.agileboot.common.core.base.BaseController; -import com.agileboot.common.core.dto.ResponseDTO; -import com.agileboot.domain.system.menu.MenuApplicationService; -import com.agileboot.domain.system.menu.command.AddMenuCommand; -import com.agileboot.domain.system.menu.command.UpdateMenuCommand; -import com.agileboot.domain.system.menu.dto.MenuDTO; -import com.agileboot.domain.system.menu.dto.MenuDetailDTO; -import com.agileboot.domain.system.menu.query.MenuQuery; -import com.agileboot.admin.customize.aop.accessLog.AccessLog; -import com.agileboot.infrastructure.user.AuthenticationUtils; -import com.agileboot.infrastructure.user.web.SystemLoginUser; -import com.agileboot.common.enums.common.BusinessTypeEnum; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import java.util.List; -import jakarta.validation.constraints.NotNull; -import jakarta.validation.constraints.PositiveOrZero; -import lombok.RequiredArgsConstructor; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * 菜单信息 - * - * @author valarchie - */ -@Tag(name = "菜单API", description = "菜单相关的增删查改") -@RestController -@RequestMapping("/system/menus") -@Validated -@RequiredArgsConstructor -public class SysMenuController extends BaseController { - - private final MenuApplicationService menuApplicationService; - - /** - * 获取菜单列表 - */ - @Operation(summary = "菜单列表") - @PreAuthorize("@permission.has('system:menu:list')") - @GetMapping - public ResponseDTO> menuList(MenuQuery menuQuery) { - List menuList = menuApplicationService.getMenuList(menuQuery); - return ResponseDTO.ok(menuList); - } - - /** - * 根据菜单编号获取详细信息 - */ - @Operation(summary = "菜单详情") - @PreAuthorize("@permission.has('system:menu:query')") - @GetMapping(value = "/{menuId}") - public ResponseDTO menuInfo(@PathVariable @NotNull @PositiveOrZero Long menuId) { - MenuDetailDTO menu = menuApplicationService.getMenuInfo(menuId); - return ResponseDTO.ok(menu); - } - - /** - * 获取菜单下拉树列表 - */ - @Operation(summary = "菜单列表(树级)", description = "菜单树级下拉框") - @GetMapping("/dropdown") - public ResponseDTO>> dropdownList() { - SystemLoginUser loginUser = AuthenticationUtils.getSystemLoginUser(); - List> dropdownList = menuApplicationService.getDropdownList(loginUser); - return ResponseDTO.ok(dropdownList); - } - - /** - * 新增菜单 - * 需支持一级菜单以及 多级菜单 子菜单为一个 或者 多个的情况 - * 隐藏菜单不显示 以及rank排序 - * 内链 和 外链 - */ - @Operation(summary = "添加菜单") - @PreAuthorize("@permission.has('system:menu:add')") - @AccessLog(title = "菜单管理", businessType = BusinessTypeEnum.ADD) - @PostMapping - public ResponseDTO add(@RequestBody AddMenuCommand addCommand) { - menuApplicationService.addMenu(addCommand); - return ResponseDTO.ok(); - } - - /** - * 修改菜单 - */ - @Operation(summary = "编辑菜单") - @PreAuthorize("@permission.has('system:menu:edit')") - @AccessLog(title = "菜单管理", businessType = BusinessTypeEnum.MODIFY) - @PutMapping("/{menuId}") - public ResponseDTO edit(@PathVariable("menuId") Long menuId, @RequestBody UpdateMenuCommand updateCommand) { - updateCommand.setMenuId(menuId); - menuApplicationService.updateMenu(updateCommand); - return ResponseDTO.ok(); - } - - /** - * 删除菜单 - */ - @Operation(summary = "删除菜单") - @PreAuthorize("@permission.has('system:menu:remove')") - @AccessLog(title = "菜单管理", businessType = BusinessTypeEnum.DELETE) - @DeleteMapping("/{menuId}") - public ResponseDTO remove(@PathVariable("menuId") Long menuId) { - menuApplicationService.remove(menuId); - return ResponseDTO.ok(); - } - -} diff --git a/agileboot-admin/src/main/java/com/agileboot/admin/controller/system/SysNoticeController.java b/agileboot-admin/src/main/java/com/agileboot/admin/controller/system/SysNoticeController.java deleted file mode 100644 index 718992d..0000000 --- a/agileboot-admin/src/main/java/com/agileboot/admin/controller/system/SysNoticeController.java +++ /dev/null @@ -1,122 +0,0 @@ -package com.agileboot.admin.controller.system; - -import com.agileboot.common.core.base.BaseController; -import com.agileboot.common.core.dto.ResponseDTO; -import com.agileboot.common.core.page.PageDTO; -import com.agileboot.domain.common.command.BulkOperationCommand; -import com.agileboot.domain.system.notice.NoticeApplicationService; -import com.agileboot.domain.system.notice.command.NoticeAddCommand; -import com.agileboot.domain.system.notice.command.NoticeUpdateCommand; -import com.agileboot.domain.system.notice.dto.NoticeDTO; -import com.agileboot.domain.system.notice.query.NoticeQuery; -import com.agileboot.admin.customize.aop.accessLog.AccessLog; -import com.agileboot.infrastructure.annotations.unrepeatable.Unrepeatable; -import com.agileboot.infrastructure.annotations.unrepeatable.Unrepeatable.CheckType; -import com.agileboot.common.enums.common.BusinessTypeEnum; -import com.baomidou.dynamic.datasource.annotation.DS; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import java.util.List; -import jakarta.validation.constraints.NotNull; -import jakarta.validation.constraints.Positive; -import lombok.RequiredArgsConstructor; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -/** - * 公告 信息操作处理 - * - * @author valarchie - */ -@Tag(name = "公告API", description = "公告相关的增删查改") -@RestController -@RequestMapping("/system/notices") -@Validated -@RequiredArgsConstructor -public class SysNoticeController extends BaseController { - - private final NoticeApplicationService noticeApplicationService; - - /** - * 获取通知公告列表 - */ - @Operation(summary = "公告列表") - @PreAuthorize("@permission.has('system:notice:list')") - @GetMapping - public ResponseDTO> list(NoticeQuery query) { - PageDTO pageDTO = noticeApplicationService.getNoticeList(query); - return ResponseDTO.ok(pageDTO); - } - - /** - * 获取通知公告列表 - * 从从库获取数据 例子 仅供参考 - */ - @Operation(summary = "公告列表(从数据库从库获取)", description = "演示主从库的例子") - @DS("slave") - @PreAuthorize("@permission.has('system:notice:list')") - @GetMapping("/database/slave") - public ResponseDTO> listFromSlave(NoticeQuery query) { - PageDTO pageDTO = noticeApplicationService.getNoticeList(query); - return ResponseDTO.ok(pageDTO); - } - - /** - * 根据通知公告编号获取详细信息 - */ - @Operation(summary = "公告详情") - @PreAuthorize("@permission.has('system:notice:query')") - @GetMapping(value = "/{noticeId}") - public ResponseDTO getInfo(@PathVariable @NotNull @Positive Long noticeId) { - return ResponseDTO.ok(noticeApplicationService.getNoticeInfo(noticeId)); - } - - /** - * 新增通知公告 - */ - @Operation(summary = "添加公告") - @Unrepeatable(interval = 60, checkType = CheckType.SYSTEM_USER) - @PreAuthorize("@permission.has('system:notice:add')") - @AccessLog(title = "通知公告", businessType = BusinessTypeEnum.ADD) - @PostMapping - public ResponseDTO add(@RequestBody NoticeAddCommand addCommand) { - noticeApplicationService.addNotice(addCommand); - return ResponseDTO.ok(); - } - - /** - * 修改通知公告 - */ - @Operation(summary = "修改公告") - @PreAuthorize("@permission.has('system:notice:edit')") - @AccessLog(title = "通知公告", businessType = BusinessTypeEnum.MODIFY) - @PutMapping("/{noticeId}") - public ResponseDTO edit(@PathVariable Long noticeId, @RequestBody NoticeUpdateCommand updateCommand) { - updateCommand.setNoticeId(noticeId); - noticeApplicationService.updateNotice(updateCommand); - return ResponseDTO.ok(); - } - - /** - * 删除通知公告 - */ - @Operation(summary = "删除公告") - @PreAuthorize("@permission.has('system:notice:remove')") - @AccessLog(title = "通知公告", businessType = BusinessTypeEnum.DELETE) - @DeleteMapping - public ResponseDTO remove(@RequestParam List noticeIds) { - noticeApplicationService.deleteNotice(new BulkOperationCommand<>(noticeIds)); - return ResponseDTO.ok(); - } - - -} diff --git a/agileboot-admin/src/main/java/com/agileboot/admin/controller/system/SysPostController.java b/agileboot-admin/src/main/java/com/agileboot/admin/controller/system/SysPostController.java deleted file mode 100644 index 08ee0d7..0000000 --- a/agileboot-admin/src/main/java/com/agileboot/admin/controller/system/SysPostController.java +++ /dev/null @@ -1,122 +0,0 @@ -package com.agileboot.admin.controller.system; - -import com.agileboot.admin.customize.aop.accessLog.AccessLog; -import com.agileboot.common.core.base.BaseController; -import com.agileboot.common.core.dto.ResponseDTO; -import com.agileboot.common.core.page.PageDTO; -import com.agileboot.common.enums.common.BusinessTypeEnum; -import com.agileboot.common.utils.poi.CustomExcelUtil; -import com.agileboot.domain.common.command.BulkOperationCommand; -import com.agileboot.domain.system.post.PostApplicationService; -import com.agileboot.domain.system.post.command.AddPostCommand; -import com.agileboot.domain.system.post.command.UpdatePostCommand; -import com.agileboot.domain.system.post.dto.PostDTO; -import com.agileboot.domain.system.post.query.PostQuery; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import java.util.List; -import jakarta.servlet.http.HttpServletResponse; -import jakarta.validation.constraints.NotEmpty; -import jakarta.validation.constraints.NotNull; -import lombok.RequiredArgsConstructor; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -/** - * 岗位信息操作处理 - * - * @author ruoyi - */ -@Tag(name = "职位API", description = "职位相关的增删查改") -@RestController -@RequestMapping("/system/post") -@Validated -@RequiredArgsConstructor -public class SysPostController extends BaseController { - - private final PostApplicationService postApplicationService; - - /** - * 获取岗位列表 - */ - @Operation(summary = "职位列表") - @PreAuthorize("@permission.has('system:post:list')") - @GetMapping("/list") - public ResponseDTO> list(PostQuery query) { - PageDTO pageDTO = postApplicationService.getPostList(query); - return ResponseDTO.ok(pageDTO); - } - - /** - * 导出查询到的所有岗位信息到excel文件 - * @param response http响应 - * @param query 查询参数 - * @author Kevin Zhang - * @date 2023-10-02 - */ - @Operation(summary = "职位列表导出") - @AccessLog(title = "岗位管理", businessType = BusinessTypeEnum.EXPORT) - @PreAuthorize("@permission.has('system:post:export')") - @GetMapping("/excel") - public void export(HttpServletResponse response, PostQuery query) { - List all = postApplicationService.getPostListAll(query); - CustomExcelUtil.writeToResponse(all, PostDTO.class, response); - } - - /** - * 根据岗位编号获取详细信息 - */ - @Operation(summary = "职位详情") - @PreAuthorize("@permission.has('system:post:query')") - @GetMapping(value = "/{postId}") - public ResponseDTO getInfo(@PathVariable Long postId) { - PostDTO post = postApplicationService.getPostInfo(postId); - return ResponseDTO.ok(post); - } - - /** - * 新增岗位 - */ - @Operation(summary = "添加职位") - @PreAuthorize("@permission.has('system:post:add')") - @AccessLog(title = "岗位管理", businessType = BusinessTypeEnum.ADD) - @PostMapping - public ResponseDTO add(@RequestBody AddPostCommand addCommand) { - postApplicationService.addPost(addCommand); - return ResponseDTO.ok(); - } - - /** - * 修改岗位 - */ - @Operation(summary = "修改职位") - @PreAuthorize("@permission.has('system:post:edit')") - @AccessLog(title = "岗位管理", businessType = BusinessTypeEnum.MODIFY) - @PutMapping - public ResponseDTO edit(@RequestBody UpdatePostCommand updateCommand) { - postApplicationService.updatePost(updateCommand); - return ResponseDTO.ok(); - } - - /** - * 删除岗位 - */ - @Operation(summary = "删除职位") - @PreAuthorize("@permission.has('system:post:remove')") - @AccessLog(title = "岗位管理", businessType = BusinessTypeEnum.DELETE) - @DeleteMapping - public ResponseDTO remove(@RequestParam @NotNull @NotEmpty List ids) { - postApplicationService.deletePost(new BulkOperationCommand<>(ids)); - return ResponseDTO.ok(); - } - -} diff --git a/agileboot-admin/src/main/java/com/agileboot/admin/controller/system/SysProfileController.java b/agileboot-admin/src/main/java/com/agileboot/admin/controller/system/SysProfileController.java deleted file mode 100644 index 36905c8..0000000 --- a/agileboot-admin/src/main/java/com/agileboot/admin/controller/system/SysProfileController.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.agileboot.admin.controller.system; - -import com.agileboot.common.constant.Constants.UploadSubDir; -import com.agileboot.common.core.base.BaseController; -import com.agileboot.common.core.dto.ResponseDTO; -import com.agileboot.common.exception.ApiException; -import com.agileboot.common.exception.error.ErrorCode; -import com.agileboot.common.utils.file.FileUploadUtils; -import com.agileboot.domain.common.dto.UploadFileDTO; -import com.agileboot.domain.system.user.UserApplicationService; -import com.agileboot.domain.system.user.command.UpdateProfileCommand; -import com.agileboot.domain.system.user.command.UpdateUserAvatarCommand; -import com.agileboot.domain.system.user.command.UpdateUserPasswordCommand; -import com.agileboot.domain.system.user.dto.UserProfileDTO; -import com.agileboot.admin.customize.aop.accessLog.AccessLog; -import com.agileboot.infrastructure.user.AuthenticationUtils; -import com.agileboot.infrastructure.user.web.SystemLoginUser; -import com.agileboot.common.enums.common.BusinessTypeEnum; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.multipart.MultipartFile; - -/** - * 个人信息 业务处理 - * - * @author ruoyi - */ -@Tag(name = "个人信息API", description = "个人信息相关接口") -@RestController -@RequestMapping("/system/user/profile") -@RequiredArgsConstructor -public class SysProfileController extends BaseController { - - private final UserApplicationService userApplicationService; - - /** - * 个人信息 - */ - @Operation(summary = "获取个人信息") - @GetMapping - public ResponseDTO profile() { - SystemLoginUser user = AuthenticationUtils.getSystemLoginUser(); - UserProfileDTO userProfile = userApplicationService.getUserProfile(user.getUserId()); - return ResponseDTO.ok(userProfile); - } - - /** - * 修改用户 - */ - @Operation(summary = "修改个人信息") - @AccessLog(title = "个人信息", businessType = BusinessTypeEnum.MODIFY) - @PutMapping - public ResponseDTO updateProfile(@RequestBody UpdateProfileCommand command) { - SystemLoginUser loginUser = AuthenticationUtils.getSystemLoginUser(); - command.setUserId(loginUser.getUserId()); - userApplicationService.updateUserProfile(command); - return ResponseDTO.ok(); - } - - /** - * 重置密码 - */ - @Operation(summary = "重置个人密码") - @AccessLog(title = "个人信息", businessType = BusinessTypeEnum.MODIFY) - @PutMapping("/password") - public ResponseDTO updatePassword(@RequestBody UpdateUserPasswordCommand command) { - SystemLoginUser loginUser = AuthenticationUtils.getSystemLoginUser(); - command.setUserId(loginUser.getUserId()); - userApplicationService.updatePasswordBySelf(loginUser, command); - return ResponseDTO.ok(); - } - - /** - * 头像上传 - */ - @Operation(summary = "修改个人头像") - @AccessLog(title = "用户头像", businessType = BusinessTypeEnum.MODIFY) - @PostMapping("/avatar") - public ResponseDTO avatar(@RequestParam("avatarfile") MultipartFile file) { - if (file.isEmpty()) { - throw new ApiException(ErrorCode.Business.USER_UPLOAD_FILE_FAILED); - } - SystemLoginUser loginUser = AuthenticationUtils.getSystemLoginUser(); - String avatarUrl = FileUploadUtils.upload(UploadSubDir.AVATAR_PATH, file); - - userApplicationService.updateUserAvatar(new UpdateUserAvatarCommand(loginUser.getUserId(), avatarUrl)); - return ResponseDTO.ok(new UploadFileDTO(avatarUrl)); - } -} diff --git a/agileboot-admin/src/main/java/com/agileboot/admin/controller/system/SysRoleController.java b/agileboot-admin/src/main/java/com/agileboot/admin/controller/system/SysRoleController.java deleted file mode 100644 index 15fd9ce..0000000 --- a/agileboot-admin/src/main/java/com/agileboot/admin/controller/system/SysRoleController.java +++ /dev/null @@ -1,197 +0,0 @@ -package com.agileboot.admin.controller.system; - -import com.agileboot.common.core.base.BaseController; -import com.agileboot.common.core.dto.ResponseDTO; -import com.agileboot.common.core.page.PageDTO; -import com.agileboot.common.utils.poi.CustomExcelUtil; -import com.agileboot.domain.system.role.RoleApplicationService; -import com.agileboot.domain.system.role.command.AddRoleCommand; -import com.agileboot.domain.system.role.command.UpdateDataScopeCommand; -import com.agileboot.domain.system.role.command.UpdateRoleCommand; -import com.agileboot.domain.system.role.command.UpdateStatusCommand; -import com.agileboot.domain.system.role.dto.RoleDTO; -import com.agileboot.domain.system.role.query.AllocatedRoleQuery; -import com.agileboot.domain.system.role.query.RoleQuery; -import com.agileboot.domain.system.role.query.UnallocatedRoleQuery; -import com.agileboot.domain.system.user.dto.UserDTO; -import com.agileboot.admin.customize.aop.accessLog.AccessLog; -import com.agileboot.common.enums.common.BusinessTypeEnum; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import java.util.List; -import jakarta.servlet.http.HttpServletResponse; -import jakarta.validation.constraints.NotNull; -import lombok.RequiredArgsConstructor; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * 角色信息 - * - * @author valarchie - */ -@Tag(name = "角色API", description = "角色相关的增删查改") -@RestController -@RequestMapping("/system/role") -@Validated -@RequiredArgsConstructor -public class SysRoleController extends BaseController { - - private final RoleApplicationService roleApplicationService; - - @Operation(summary = "角色列表") - @PreAuthorize("@permission.has('system:role:list')") - @GetMapping("/list") - public ResponseDTO> list(RoleQuery query) { - PageDTO pageDTO = roleApplicationService.getRoleList(query); - return ResponseDTO.ok(pageDTO); - } - - @Operation(summary = "角色列表导出") - @AccessLog(title = "角色管理", businessType = BusinessTypeEnum.EXPORT) - @PreAuthorize("@permission.has('system:role:export')") - @PostMapping("/export") - public void export(HttpServletResponse response, RoleQuery query) { - PageDTO pageDTO = roleApplicationService.getRoleList(query); - CustomExcelUtil.writeToResponse(pageDTO.getRows(), RoleDTO.class, response); - } - - /** - * 根据角色编号获取详细信息 - */ - @Operation(summary = "角色详情") - @PreAuthorize("@permission.has('system:role:query')") - @GetMapping(value = "/{roleId}") - public ResponseDTO getInfo(@PathVariable @NotNull Long roleId) { - RoleDTO roleInfo = roleApplicationService.getRoleInfo(roleId); - return ResponseDTO.ok(roleInfo); - } - - /** - * 新增角色 - */ - @Operation(summary = "添加角色") - @PreAuthorize("@permission.has('system:role:add')") - @AccessLog(title = "角色管理", businessType = BusinessTypeEnum.ADD) - @PostMapping - public ResponseDTO add(@RequestBody AddRoleCommand addCommand) { - roleApplicationService.addRole(addCommand); - return ResponseDTO.ok(); - } - - /** - * 移除角色 - */ - @Operation(summary = "删除角色") - @PreAuthorize("@permission.has('system:role:remove')") - @AccessLog(title = "角色管理", businessType = BusinessTypeEnum.DELETE) - @DeleteMapping(value = "/{roleId}") - public ResponseDTO remove(@PathVariable("roleId") List roleIds) { - roleApplicationService.deleteRoleByBulk(roleIds); - return ResponseDTO.ok(); - } - - /** - * 修改保存角色 - */ - @Operation(summary = "修改角色") - @PreAuthorize("@permission.has('system:role:edit')") - @AccessLog(title = "角色管理", businessType = BusinessTypeEnum.MODIFY) - @PutMapping - public ResponseDTO edit(@Validated @RequestBody UpdateRoleCommand updateCommand) { - roleApplicationService.updateRole(updateCommand); - return ResponseDTO.ok(); - } - - /** - * 修改保存数据权限 - */ - @Operation(summary = "修改角色数据权限") - @PreAuthorize("@permission.has('system:role:edit')") - @AccessLog(title = "角色管理", businessType = BusinessTypeEnum.MODIFY) - @PutMapping("/{roleId}/dataScope") - public ResponseDTO dataScope(@PathVariable("roleId") Long roleId, - @RequestBody UpdateDataScopeCommand command) { - command.setRoleId(roleId); - - roleApplicationService.updateDataScope(command); - return ResponseDTO.ok(); - } - - /** - * 角色状态修改 - */ - @Operation(summary = "修改角色状态") - @PreAuthorize("@permission.has('system:role:edit')") - @AccessLog(title = "角色管理", businessType = BusinessTypeEnum.MODIFY) - @PutMapping("/{roleId}/status") - public ResponseDTO changeStatus(@PathVariable("roleId") Long roleId, - @RequestBody UpdateStatusCommand command) { - command.setRoleId(roleId); - - roleApplicationService.updateStatus(command); - return ResponseDTO.ok(); - } - - - /** - * 查询已分配用户角色列表 - */ - @Operation(summary = "已关联该角色的用户列表") - @PreAuthorize("@permission.has('system:role:list')") - @GetMapping("/{roleId}/allocated/list") - public ResponseDTO> allocatedUserList(@PathVariable("roleId") Long roleId, - AllocatedRoleQuery query) { - query.setRoleId(roleId); - PageDTO page = roleApplicationService.getAllocatedUserList(query); - return ResponseDTO.ok(page); - } - - /** - * 查询未分配用户角色列表 - */ - @Operation(summary = "未关联该角色的用户列表") - @PreAuthorize("@permission.has('system:role:list')") - @GetMapping("/{roleId}/unallocated/list") - public ResponseDTO> unallocatedUserList(@PathVariable("roleId") Long roleId, - UnallocatedRoleQuery query) { - query.setRoleId(roleId); - PageDTO page = roleApplicationService.getUnallocatedUserList(query); - return ResponseDTO.ok(page); - } - - - /** - * 批量取消授权用户 - */ - @Operation(summary = "批量解除角色和用户的关联") - @PreAuthorize("@permission.has('system:role:edit')") - @AccessLog(title = "角色管理", businessType = BusinessTypeEnum.GRANT) - @DeleteMapping("/users/{userIds}/grant/bulk") - public ResponseDTO deleteRoleOfUserByBulk(@PathVariable("userIds") List userIds) { - roleApplicationService.deleteRoleOfUserByBulk(userIds); - return ResponseDTO.ok(); - } - - /** - * 批量选择用户授权 - */ - @Operation(summary = "批量添加用户和角色关联") - @PreAuthorize("@permission.has('system:role:edit')") - @AccessLog(title = "角色管理", businessType = BusinessTypeEnum.GRANT) - @PostMapping("/{roleId}/users/{userIds}/grant/bulk") - public ResponseDTO addRoleForUserByBulk(@PathVariable("roleId") Long roleId, - @PathVariable("userIds") List userIds) { - roleApplicationService.addRoleOfUserByBulk(roleId, userIds); - return ResponseDTO.ok(); - } - -} diff --git a/agileboot-admin/src/main/java/com/agileboot/admin/controller/system/SysUserController.java b/agileboot-admin/src/main/java/com/agileboot/admin/controller/system/SysUserController.java deleted file mode 100644 index 1ca515a..0000000 --- a/agileboot-admin/src/main/java/com/agileboot/admin/controller/system/SysUserController.java +++ /dev/null @@ -1,169 +0,0 @@ -package com.agileboot.admin.controller.system; - -import cn.hutool.core.collection.ListUtil; -import com.agileboot.common.core.base.BaseController; -import com.agileboot.common.core.dto.ResponseDTO; -import com.agileboot.common.core.page.PageDTO; -import com.agileboot.common.utils.poi.CustomExcelUtil; -import com.agileboot.domain.common.command.BulkOperationCommand; -import com.agileboot.domain.system.user.UserApplicationService; -import com.agileboot.domain.system.user.command.AddUserCommand; -import com.agileboot.domain.system.user.command.ChangeStatusCommand; -import com.agileboot.domain.system.user.command.ResetPasswordCommand; -import com.agileboot.domain.system.user.command.UpdateUserCommand; -import com.agileboot.domain.system.user.dto.UserDTO; -import com.agileboot.domain.system.user.dto.UserDetailDTO; -import com.agileboot.domain.system.user.query.SearchUserQuery; -import com.agileboot.admin.customize.aop.accessLog.AccessLog; -import com.agileboot.infrastructure.user.AuthenticationUtils; -import com.agileboot.infrastructure.user.web.SystemLoginUser; -import com.agileboot.common.enums.common.BusinessTypeEnum; -import com.agileboot.domain.system.user.db.SearchUserDO; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import java.util.List; -import jakarta.servlet.http.HttpServletResponse; -import lombok.RequiredArgsConstructor; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.multipart.MultipartFile; - -/** - * 用户信息 - * @author valarchie - */ -@Tag(name = "用户API", description = "用户相关的增删查改") -@RestController -@RequestMapping("/system/users") -@RequiredArgsConstructor -public class SysUserController extends BaseController { - - private final UserApplicationService userApplicationService; - - /** - * 获取用户列表 - */ - @Operation(summary = "用户列表") - @PreAuthorize("@permission.has('system:user:list') AND @dataScope.checkDeptId(#query.deptId)") - @GetMapping - public ResponseDTO> userList(SearchUserQuery query) { - PageDTO page = userApplicationService.getUserList(query); - return ResponseDTO.ok(page); - } - - @Operation(summary = "用户列表导出") - @AccessLog(title = "用户管理", businessType = BusinessTypeEnum.EXPORT) - @PreAuthorize("@permission.has('system:user:export')") - @GetMapping("/excel") - public void exportUserByExcel(HttpServletResponse response, SearchUserQuery query) { - PageDTO userList = userApplicationService.getUserList(query); - CustomExcelUtil.writeToResponse(userList.getRows(), UserDTO.class, response); - } - - @Operation(summary = "用户列表导入") - @AccessLog(title = "用户管理", businessType = BusinessTypeEnum.IMPORT) - @PreAuthorize("@permission.has('system:user:import')") - @PostMapping("/excel") - public ResponseDTO importUserByExcel(MultipartFile file) { - List commands = CustomExcelUtil.readFromRequest(AddUserCommand.class, file); - - for (AddUserCommand command : commands) { - userApplicationService.addUser(command); - } - return ResponseDTO.ok(); - } - - /** - * 下载批量导入模板 - */ - @Operation(summary = "用户导入excel下载") - @GetMapping("/excelTemplate") - public void downloadExcelTemplate(HttpServletResponse response) { - CustomExcelUtil.writeToResponse(ListUtil.toList(new AddUserCommand()), AddUserCommand.class, response); - } - - /** - * 根据用户编号获取详细信息 - */ - @Operation(summary = "用户详情") - @PreAuthorize("@permission.has('system:user:query')") - @GetMapping("/{userId}") - public ResponseDTO getUserDetailInfo(@PathVariable(value = "userId", required = false) Long userId) { - UserDetailDTO userDetailInfo = userApplicationService.getUserDetailInfo(userId); - return ResponseDTO.ok(userDetailInfo); - } - - /** - * 新增用户 - */ - @Operation(summary = "新增用户") - @PreAuthorize("@permission.has('system:user:add') AND @dataScope.checkDeptId(#command.deptId)") - @AccessLog(title = "用户管理", businessType = BusinessTypeEnum.ADD) - @PostMapping - public ResponseDTO add(@Validated @RequestBody AddUserCommand command) { - userApplicationService.addUser(command); - return ResponseDTO.ok(); - } - - /** - * 修改用户 - */ - @Operation(summary = "修改用户") - @PreAuthorize("@permission.has('system:user:edit') AND @dataScope.checkUserId(#command.userId)") - @AccessLog(title = "用户管理", businessType = BusinessTypeEnum.MODIFY) - @PutMapping("/{userId}") - public ResponseDTO edit(@Validated @RequestBody UpdateUserCommand command) { - userApplicationService.updateUser(command); - return ResponseDTO.ok(); - } - - /** - * 删除用户 - */ - @Operation(summary = "删除用户") - @PreAuthorize("@permission.has('system:user:remove') AND @dataScope.checkUserIds(#userIds)") - @AccessLog(title = "用户管理", businessType = BusinessTypeEnum.DELETE) - @DeleteMapping("/{userIds}") - public ResponseDTO remove(@PathVariable List userIds) { - BulkOperationCommand bulkDeleteCommand = new BulkOperationCommand<>(userIds); - SystemLoginUser loginUser = AuthenticationUtils.getSystemLoginUser(); - userApplicationService.deleteUsers(loginUser, bulkDeleteCommand); - return ResponseDTO.ok(); - } - - /** - * 重置密码 - */ - @Operation(summary = "重置用户密码") - @PreAuthorize("@permission.has('system:user:resetPwd') AND @dataScope.checkUserId(#userId)") - @AccessLog(title = "用户管理", businessType = BusinessTypeEnum.MODIFY) - @PutMapping("/{userId}/password") - public ResponseDTO resetPassword(@PathVariable Long userId, @RequestBody ResetPasswordCommand command) { - command.setUserId(userId); - userApplicationService.resetUserPassword(command); - return ResponseDTO.ok(); - } - - /** - * 状态修改 - */ - @Operation(summary = "修改用户状态") - @PreAuthorize("@permission.has('system:user:edit') AND @dataScope.checkUserId(#command.userId)") - @AccessLog(title = "用户管理", businessType = BusinessTypeEnum.MODIFY) - @PutMapping("/{userId}/status") - public ResponseDTO changeStatus(@PathVariable Long userId, @RequestBody ChangeStatusCommand command) { - command.setUserId(userId); - userApplicationService.changeUserStatus(command); - return ResponseDTO.ok(); - } - - -} diff --git a/agileboot-admin/src/main/java/com/agileboot/admin/customize/aop/accessLog/AccessLog.java b/agileboot-admin/src/main/java/com/agileboot/admin/customize/aop/accessLog/AccessLog.java deleted file mode 100644 index a00cd7c..0000000 --- a/agileboot-admin/src/main/java/com/agileboot/admin/customize/aop/accessLog/AccessLog.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.agileboot.admin.customize.aop.accessLog; - -import com.agileboot.common.enums.common.BusinessTypeEnum; -import com.agileboot.common.enums.common.OperatorTypeEnum; -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * 自定义操作日志记录注解 - * - * @author ruoyi - */ -@Target({ElementType.PARAMETER, ElementType.METHOD}) -@Retention(RetentionPolicy.RUNTIME) -@Documented -public @interface AccessLog { - - /** - * 模块 - */ - String title() default ""; - - /** - * 功能 - */ - BusinessTypeEnum businessType() default BusinessTypeEnum.OTHER; - - /** - * 操作人类别 - */ - OperatorTypeEnum operatorType() default OperatorTypeEnum.WEB; - - /** - * 是否保存请求的参数 - */ - boolean isSaveRequestData() default true; - - /** - * 是否保存响应的参数 - */ - boolean isSaveResponseData() default false; -} diff --git a/agileboot-admin/src/main/java/com/agileboot/admin/customize/aop/accessLog/AccessLogAspect.java b/agileboot-admin/src/main/java/com/agileboot/admin/customize/aop/accessLog/AccessLogAspect.java deleted file mode 100644 index 75145de..0000000 --- a/agileboot-admin/src/main/java/com/agileboot/admin/customize/aop/accessLog/AccessLogAspect.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.agileboot.admin.customize.aop.accessLog; - -import com.agileboot.admin.customize.async.AsyncTaskFactory; -import com.agileboot.infrastructure.thread.ThreadPoolManager; -import lombok.extern.slf4j.Slf4j; -import org.aspectj.lang.JoinPoint; -import org.aspectj.lang.annotation.AfterReturning; -import org.aspectj.lang.annotation.AfterThrowing; -import org.aspectj.lang.annotation.Aspect; -import org.springframework.stereotype.Component; - -/** - * 操作日志记录处理 - * - * @author valarchie - */ -@Aspect -@Component -@Slf4j -public class AccessLogAspect { - - /** - * 处理完请求后执行 - * - * @param joinPoint 切点 - */ - @AfterReturning(pointcut = "@annotation(controllerLog)", returning = "jsonResult") - public void doAfterReturning(JoinPoint joinPoint, AccessLog controllerLog, Object jsonResult) { - handleLog(joinPoint, controllerLog, null, jsonResult); - } - - /** - * 拦截异常操作 - * - * @param joinPoint 切点 - * @param e 异常 - */ - @AfterThrowing(value = "@annotation(controllerLog)", throwing = "e") - public void doAfterThrowing(JoinPoint joinPoint, AccessLog controllerLog, Exception e) { - handleLog(joinPoint, controllerLog, e, null); - } - - protected void handleLog(final JoinPoint joinPoint, AccessLog accessLog, final Exception e, Object jsonResult) { - try { - OperationLogModel operationLog = new OperationLogModel(); - operationLog.fillOperatorInfo(); - operationLog.fillRequestInfo(joinPoint, accessLog, jsonResult); - operationLog.fillStatus(e); - operationLog.fillAccessLogInfo(accessLog); - - // 保存数据库 - ThreadPoolManager.execute(AsyncTaskFactory.recordOperationLog(operationLog)); - } catch (Exception exp) { - log.error("写入操作日式失败", exp); - } - } - - -} diff --git a/agileboot-admin/src/main/java/com/agileboot/admin/customize/aop/accessLog/OperationLogModel.java b/agileboot-admin/src/main/java/com/agileboot/admin/customize/aop/accessLog/OperationLogModel.java deleted file mode 100644 index d6e136f..0000000 --- a/agileboot-admin/src/main/java/com/agileboot/admin/customize/aop/accessLog/OperationLogModel.java +++ /dev/null @@ -1,159 +0,0 @@ -package com.agileboot.admin.customize.aop.accessLog; - -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.EnumUtil; -import cn.hutool.core.util.StrUtil; -import cn.hutool.json.JSONUtil; -import com.agileboot.common.utils.ServletHolderUtil; -import com.agileboot.infrastructure.user.AuthenticationUtils; -import com.agileboot.infrastructure.user.web.SystemLoginUser; -import com.agileboot.common.enums.common.OperationStatusEnum; -import com.agileboot.common.enums.common.RequestMethodEnum; -import com.agileboot.common.enums.BasicEnumUtil; -import com.agileboot.domain.system.log.db.SysOperationLogEntity; -import lombok.extern.slf4j.Slf4j; -import org.aspectj.lang.JoinPoint; -import org.springframework.validation.BindingResult; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.servlet.HandlerMapping; - -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; -import java.util.Collection; -import java.util.Map; - -/** - * @author valarchie - */ -@Slf4j -public class OperationLogModel extends SysOperationLogEntity { - - public static final int MAX_DATA_LENGTH = 512; - - HttpServletRequest request = ServletHolderUtil.getRequest(); - - public void fillOperatorInfo() { - // 获取当前的用户 - String ip = ServletHolderUtil.getClientIp(); - setOperatorIp(ip); - SystemLoginUser loginUser = AuthenticationUtils.getSystemLoginUser(); - if (loginUser != null) { - this.setUsername(loginUser.getUsername()); - } - - this.setOperationTime(DateUtil.date()); - } - - - public void fillRequestInfo(final JoinPoint joinPoint, AccessLog accessLog, Object jsonResult) { - this.setRequestUrl(request.getRequestURI()); - // 设置方法名称 - String className = joinPoint.getTarget().getClass().getName(); - String methodName = joinPoint.getSignature().getName(); - String methodFormat = StrUtil.format("{}.{}()", className, methodName); - this.setCalledMethod(methodFormat); - // 设置请求方式 - RequestMethodEnum requestMethodEnum = EnumUtil.fromString(RequestMethodEnum.class, - request.getMethod()); - this.setRequestMethod(requestMethodEnum != null ? requestMethodEnum.getValue() : RequestMethodEnum.UNKNOWN.getValue()); - - - // 是否需要保存request,参数和值 - if (accessLog.isSaveRequestData()) { - // 获取参数的信息,传入到数据库中。 - recordRequestData(joinPoint); - } - // 是否需要保存response,参数和值 - if (accessLog.isSaveResponseData() && jsonResult != null) { - this.setOperationResult(StrUtil.sub(JSONUtil.toJsonStr(jsonResult), 0, MAX_DATA_LENGTH)); - } - } - - - public void fillAccessLogInfo(AccessLog log) { - // 设置action动作 - this.setBusinessType(log.businessType().ordinal()); - // 设置标题 - this.setRequestModule(log.title()); - // 设置操作人类别 - this.setOperatorType(log.operatorType().ordinal()); - } - - - public void fillStatus(Exception e) { - if (e != null) { - this.setStatus(OperationStatusEnum.FAIL.getValue()); - this.setErrorStack(StrUtil.sub(e.getMessage(), 0, MAX_DATA_LENGTH)); - } else { - this.setStatus(OperationStatusEnum.SUCCESS.getValue()); - } - } - - - /** - * 获取请求的参数,放到log中 - * - * @param joinPoint 方法切面 - */ - private void recordRequestData(JoinPoint joinPoint) { - RequestMethodEnum requestMethodEnum = BasicEnumUtil.fromValue(RequestMethodEnum.class, - this.getRequestMethod()); - - if (requestMethodEnum == RequestMethodEnum.GET || requestMethodEnum == RequestMethodEnum.POST) { - String params = argsArrayToString(joinPoint.getArgs()); - this.setOperationParam(StrUtil.sub(params, 0, MAX_DATA_LENGTH)); - } else { - Map paramsMap = (Map) request - .getAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE); - this.setOperationParam(StrUtil.sub(paramsMap.toString(), 0, MAX_DATA_LENGTH)); - } - } - - /** - * 参数拼装 - */ - private String argsArrayToString(Object[] paramsArray) { - StringBuilder params = new StringBuilder(); - if (paramsArray != null) { - for (Object o : paramsArray) { - if (o != null && !isCanNotBeParseToJson(o)) { - try { - Object jsonObj = JSONUtil.parseObj(o); - params.append(jsonObj).append(","); - } catch (Exception e) { - log.info("参数拼接错误", e); - } - } - } - } - return params.toString().trim(); - } - - /** - * 判断是否需要过滤的对象。 - * - * @param o 对象信息。 - * @return 如果是需要过滤的对象,则返回true;否则返回false。 - */ - @SuppressWarnings("rawtypes") - public boolean isCanNotBeParseToJson(final Object o) { - Class clazz = o.getClass(); - if (clazz.isArray()) { - return clazz.getComponentType().isAssignableFrom(MultipartFile.class); - } else if (Collection.class.isAssignableFrom(clazz)) { - Collection collection = (Collection) o; - for (Object value : collection) { - return value instanceof MultipartFile; - } - } else if (Map.class.isAssignableFrom(clazz)) { - Map map = (Map) o; - for (Object value : map.entrySet()) { - Map.Entry entry = (Map.Entry) value; - return entry.getValue() instanceof MultipartFile; - } - } - return o instanceof MultipartFile || o instanceof HttpServletRequest || o instanceof HttpServletResponse - || o instanceof BindingResult; - } - -} diff --git a/agileboot-admin/src/main/java/com/agileboot/admin/customize/async/AsyncTaskFactory.java b/agileboot-admin/src/main/java/com/agileboot/admin/customize/async/AsyncTaskFactory.java deleted file mode 100644 index 1c2ff72..0000000 --- a/agileboot-admin/src/main/java/com/agileboot/admin/customize/async/AsyncTaskFactory.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.agileboot.admin.customize.async; - -import cn.hutool.core.date.DateUtil; -import cn.hutool.extra.spring.SpringUtil; -import com.agileboot.common.utils.ServletHolderUtil; -import com.agileboot.common.utils.ip.IpRegionUtil; -import com.agileboot.common.enums.common.LoginStatusEnum; -import com.agileboot.domain.system.log.db.SysLoginInfoEntity; -import com.agileboot.domain.system.log.db.SysOperationLogEntity; -import com.agileboot.domain.system.log.db.SysLoginInfoService; -import com.agileboot.domain.system.log.db.SysOperationLogService; -import eu.bitwalker.useragentutils.UserAgent; -import lombok.extern.slf4j.Slf4j; - -/** - * 异步工厂(产生任务用) - * - * @author ruoyi - */ -@Slf4j -public class AsyncTaskFactory { - - private AsyncTaskFactory() { - } - - /** - * 记录登录信息 - * - * @param username 用户名 - * @param loginStatusEnum 状态 - * @param message 消息 - * @return 任务task - */ - public static Runnable loginInfoTask(final String username, final LoginStatusEnum loginStatusEnum, final String message) { - // 优化一下这个类 - final UserAgent userAgent = UserAgent.parseUserAgentString( - ServletHolderUtil.getRequest().getHeader("User-Agent")); - // 获取客户端浏览器 - final String browser = userAgent.getBrowser() != null ? userAgent.getBrowser().getName() : ""; - final String ip = ServletHolderUtil.getClientIp(); - final String address = IpRegionUtil.getBriefLocationByIp(ip); - // 获取客户端操作系统 - final String os = userAgent.getOperatingSystem() != null ? userAgent.getOperatingSystem().getName() : ""; - - log.info("ip: {}, address: {}, username: {}, loginStatusEnum: {}, message: {}", ip, address, username, - loginStatusEnum, message); - return () -> { - // 封装对象 - SysLoginInfoEntity loginInfo = new SysLoginInfoEntity(); - loginInfo.setUsername(username); - loginInfo.setIpAddress(ip); - loginInfo.setLoginLocation(address); - loginInfo.setBrowser(browser); - loginInfo.setOperationSystem(os); - loginInfo.setMsg(message); - loginInfo.setLoginTime(DateUtil.date()); - loginInfo.setStatus(loginStatusEnum.getValue()); - // 插入数据 - SpringUtil.getBean(SysLoginInfoService.class).save(loginInfo); - }; - } - - /** - * 操作日志记录 - * - * @param operationLog 操作日志信息 - * @return 任务task - */ - public static Runnable recordOperationLog(final SysOperationLogEntity operationLog) { - return () -> { - // 远程查询操作地点 - operationLog.setOperatorLocation(IpRegionUtil.getBriefLocationByIp(operationLog.getOperatorIp())); - SpringUtil.getBean(SysOperationLogService.class).save(operationLog); - }; - } - -} diff --git a/agileboot-admin/src/main/java/com/agileboot/admin/customize/config/JwtAuthenticationTokenFilter.java b/agileboot-admin/src/main/java/com/agileboot/admin/customize/config/JwtAuthenticationTokenFilter.java deleted file mode 100644 index 49f01f2..0000000 --- a/agileboot-admin/src/main/java/com/agileboot/admin/customize/config/JwtAuthenticationTokenFilter.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.agileboot.admin.customize.config; - -import com.agileboot.infrastructure.user.AuthenticationUtils; -import com.agileboot.infrastructure.user.web.SystemLoginUser; -import com.agileboot.admin.customize.service.login.TokenService; -import java.io.IOException; -import jakarta.servlet.FilterChain; -import jakarta.servlet.ServletException; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; -import org.springframework.security.core.context.SecurityContextHolder; -import org.springframework.security.web.authentication.WebAuthenticationDetailsSource; -import org.springframework.stereotype.Component; -import org.springframework.web.filter.OncePerRequestFilter; - -/** - * token过滤器 验证token有效性 - * 继承OncePerRequestFilter类的话 可以确保只执行filter一次, 避免执行多次 - * @author valarchie - */ -@Component -@Slf4j -@RequiredArgsConstructor -public class JwtAuthenticationTokenFilter extends OncePerRequestFilter { - - private final TokenService tokenService; - - @Override - protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) - throws ServletException, IOException { - SystemLoginUser loginUser = tokenService.getLoginUser(request); - if (loginUser != null && AuthenticationUtils.getAuthentication() == null) { - tokenService.refreshToken(loginUser); - // 如果没有将当前登录用户放入到上下文中的话,会认定用户未授权,返回用户未登陆的错误 - putCurrentLoginUserIntoContext(request, loginUser); - - log.debug("request process in jwt token filter. get login user id: {}", loginUser.getUserId()); - } - chain.doFilter(request, response); - } - - - private void putCurrentLoginUserIntoContext(HttpServletRequest request, SystemLoginUser loginUser) { - UsernamePasswordAuthenticationToken authToken = new UsernamePasswordAuthenticationToken(loginUser, - null, loginUser.getAuthorities()); - authToken.setDetails(new WebAuthenticationDetailsSource().buildDetails(request)); - SecurityContextHolder.getContext().setAuthentication(authToken); - } - -} diff --git a/agileboot-admin/src/main/java/com/agileboot/admin/customize/config/SecurityConfig.java b/agileboot-admin/src/main/java/com/agileboot/admin/customize/config/SecurityConfig.java deleted file mode 100644 index e8a6cc4..0000000 --- a/agileboot-admin/src/main/java/com/agileboot/admin/customize/config/SecurityConfig.java +++ /dev/null @@ -1,164 +0,0 @@ -package com.agileboot.admin.customize.config; - -import cn.hutool.json.JSONUtil; -import com.agileboot.admin.customize.service.login.LoginService; -import com.agileboot.common.core.dto.ResponseDTO; -import com.agileboot.common.exception.ApiException; -import com.agileboot.common.exception.error.ErrorCode.Client; -import com.agileboot.common.utils.ServletHolderUtil; -import com.agileboot.domain.common.cache.RedisCacheService; -import com.agileboot.admin.customize.async.AsyncTaskFactory; -import com.agileboot.infrastructure.thread.ThreadPoolManager; -import com.agileboot.infrastructure.user.web.SystemLoginUser; -import com.agileboot.admin.customize.service.login.TokenService; -import com.agileboot.common.enums.common.LoginStatusEnum; -import lombok.RequiredArgsConstructor; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.http.HttpMethod; -import org.springframework.security.authentication.AuthenticationManager; -import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; -import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; -import org.springframework.security.config.http.SessionCreationPolicy; -import org.springframework.security.core.userdetails.UserDetailsService; -import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; -import org.springframework.security.web.AuthenticationEntryPoint; -import org.springframework.security.web.SecurityFilterChain; -import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; -import org.springframework.security.web.authentication.logout.LogoutFilter; -import org.springframework.security.web.authentication.logout.LogoutSuccessHandler; -import org.springframework.web.filter.CorsFilter; - -/** - * 主要配置登录流程逻辑涉及以下几个类 - * @see UserDetailsServiceImpl#loadUserByUsername 用于登录流程通过用户名加载用户 - * @see this#unauthorizedHandler() 用于用户未授权或登录失败处理 - * @see this#logOutSuccessHandler 用于退出登录成功后的逻辑 - * @see JwtAuthenticationTokenFilter#doFilter token的校验和刷新 - * @see LoginService#login 登录逻辑 - * @author valarchie - */ -@Configuration -@EnableWebSecurity -@EnableGlobalMethodSecurity(prePostEnabled = true) -@RequiredArgsConstructor -public class SecurityConfig { - - private final TokenService tokenService; - - private final RedisCacheService redisCache; - - /** - * token认证过滤器 - */ - private final JwtAuthenticationTokenFilter jwtTokenFilter; - - private final UserDetailsService userDetailsService; - - /** - * 跨域过滤器 - */ - private final CorsFilter corsFilter; - - - /** - * 登录异常处理类 - * 用户未登陆的话 在这个Bean中处理 - */ - @Bean - public AuthenticationEntryPoint unauthorizedHandler() { - return (request, response, exception) -> { - ResponseDTO responseDTO = ResponseDTO.fail( - new ApiException(Client.COMMON_NO_AUTHORIZATION, request.getRequestURI()) - ); - ServletHolderUtil.renderString(response, JSONUtil.toJsonStr(responseDTO)); - }; - } - - - /** - * 退出成功处理类 返回成功 - * 在SecurityConfig类当中 定义了/logout 路径对应处理逻辑 - */ - @Bean - public LogoutSuccessHandler logOutSuccessHandler() { - return (request, response, authentication) -> { - SystemLoginUser loginUser = tokenService.getLoginUser(request); - if (loginUser != null) { - String userName = loginUser.getUsername(); - // 删除用户缓存记录 - redisCache.loginUserCache.delete(loginUser.getCachedKey()); - // 记录用户退出日志 - ThreadPoolManager.execute(AsyncTaskFactory.loginInfoTask( - userName, LoginStatusEnum.LOGOUT, LoginStatusEnum.LOGOUT.description())); - } - ServletHolderUtil.renderString(response, JSONUtil.toJsonStr(ResponseDTO.ok())); - }; - } - - /** - * 强散列哈希加密实现 - */ - @Bean - public BCryptPasswordEncoder bCryptPasswordEncoder() { - return new BCryptPasswordEncoder(); - } - - - /** - * 鉴权管理类 - * @see UserDetailsServiceImpl#loadUserByUsername - */ - @Bean - public AuthenticationManager authManager(HttpSecurity http) throws Exception { - return http.getSharedObject(AuthenticationManagerBuilder.class) - .userDetailsService(userDetailsService) - .passwordEncoder(bCryptPasswordEncoder()) - .and() - .build(); - } - - - @Bean - public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Exception { - httpSecurity - // CSRF禁用,因为不使用session - .csrf().disable() - // 认证失败处理类 - .exceptionHandling().authenticationEntryPoint(unauthorizedHandler()).and() - // 基于token,所以不需要session - .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and() - // 过滤请求 - .authorizeRequests() - // 对于登录login 注册register 验证码captchaImage 以及公共Api的请求允许匿名访问 - // 注意: 当携带token请求以下这几个接口时 会返回403的错误 - .antMatchers("/login", "/register", "/getConfig", "/captchaImage", "/api/**").anonymous() - .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", - "/profile/**").permitAll() - // TODO this is danger. - .antMatchers("/swagger-ui.html").anonymous() - .antMatchers("/swagger-resources/**").anonymous() - .antMatchers("/webjars/**").anonymous() - .antMatchers("/*/api-docs","/*/api-docs/swagger-config").anonymous() - .antMatchers("/**/api-docs.yaml" ).anonymous() - .antMatchers("/druid/**").anonymous() - // 除上面外的所有请求全部需要鉴权认证 - .anyRequest().authenticated() - .and() - // 禁用 X-Frame-Options 响应头。下面是具体解释: - // X-Frame-Options 是一个 HTTP 响应头,用于防止网页被嵌入到其他网页的 、