mirror of
				https://github.com/continew-org/continew-admin.git
				synced 2025-10-31 22:57:17 +08:00 
			
		
		
		
	refactor: PageDataResp => PageResp
This commit is contained in:
		
							
								
								
									
										52
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										52
									
								
								README.md
									
									
									
									
									
								
							| @@ -38,8 +38,8 @@ ContiNew Admin (Continue New Admin)中后台管理框架/脚手架,持续 | |||||||
|  |  | ||||||
| |        | 后端源码                                | 前端源码                                   | | |        | 后端源码                                | 前端源码                                   | | ||||||
| |--------| ----------------------------------------- | -------------------------------------------- | | |--------| ----------------------------------------- | -------------------------------------------- | | ||||||
| | GitHub | https://github.com/Charles7c/continew-admin | https://github.com/Charles7c/continew-admin-ui | | | GitHub | [github.com/Charles7c/continew-admin](https://github.com/Charles7c/continew-admin) | [github.com/Charles7c/continew-admin-ui](https://github.com/Charles7c/continew-admin-ui) | | ||||||
| | Gitee  | https://gitee.com/Charles7c/continew-admin | https://gitee.com/Charles7c/continew-admin-ui | | | Gitee  | [gitee.com/Charles7c/continew-admin](https://gitee.com/Charles7c/continew-admin) | [gitee.com/Charles7c/continew-admin-ui](https://gitee.com/Charles7c/continew-admin-ui) | | ||||||
|  |  | ||||||
| ## 主要特性 | ## 主要特性 | ||||||
|  |  | ||||||
| @@ -181,30 +181,30 @@ git clone https://github.com/Charles7c/continew-admin.git | |||||||
|  |  | ||||||
| ## 核心技术栈 | ## 核心技术栈 | ||||||
|  |  | ||||||
| | 名称                                                         | 版本         | 简介                                                         | | | 名称                                                         | 版本             | 简介                                                         | | ||||||
| | :----------------------------------------------------------- | :----------- | :----------------------------------------------------------- | | | :----------------------------------------------------------- |:---------------| :----------------------------------------------------------- | | ||||||
| | [ContiNew Starter](https://github.com/Charles7c/continew-starter) | 1.1.0        | ContiNew Starter(Continue New Starter)是一种特殊类型的 Spring Boot Starter,其作用与常规的 Starter 类似,基于“约定优于配置”的理念,再次精简常规配置,提供一个更为完整的配置解决方案,帮助开发人员更加快速的集成常用第三方库或工具到 Spring Boot Web 应用程序中。 | | | [ContiNew Starter](https://github.com/Charles7c/continew-starter) | 1.1.1-SNAPSHOT | ContiNew Starter(Continue New Starter)是一种特殊类型的 Spring Boot Starter,其作用与常规的 Starter 类似,基于“约定优于配置”的理念,再次精简常规配置,提供一个更为完整的配置解决方案,帮助开发人员更加快速的集成常用第三方库或工具到 Spring Boot Web 应用程序中。 | | ||||||
| | <a href="https://spring.io/projects/spring-boot" target="_blank">Spring Boot</a> | 3.1.7        | 简化 Spring 应用的初始搭建和开发过程,基于“约定优于配置”的理念,使开发人员不再需要定义样板化的配置。(Spring Boot 3.0 开始,要求 Java 17 作为最低版本) | | | <a href="https://spring.io/projects/spring-boot" target="_blank">Spring Boot</a> | 3.1.7          | 简化 Spring 应用的初始搭建和开发过程,基于“约定优于配置”的理念,使开发人员不再需要定义样板化的配置。(Spring Boot 3.0 开始,要求 Java 17 作为最低版本) | | ||||||
| | <a href="https://undertow.io/" target="_blank">Undertow</a>  | 2.3.10.Final | 采用 Java 开发的灵活的高性能 Web 服务器,提供包括阻塞和基于 NIO 的非堵塞机制。 | | | <a href="https://undertow.io/" target="_blank">Undertow</a>  | 2.3.10.Final   | 采用 Java 开发的灵活的高性能 Web 服务器,提供包括阻塞和基于 NIO 的非堵塞机制。 | | ||||||
| | <a href="https://sa-token.dev33.cn/" target="_blank">Sa-Token + JWT</a> | 1.37.0       | 轻量级 Java 权限认证框架,让鉴权变得简单、优雅。             | | | <a href="https://sa-token.dev33.cn/" target="_blank">Sa-Token + JWT</a> | 1.37.0         | 轻量级 Java 权限认证框架,让鉴权变得简单、优雅。             | | ||||||
| | <a href="https://baomidou.com/" target="_blank">MyBatis Plus</a> | 3.5.4.1      | MyBatis 的增强工具,在 MyBatis 的基础上只做增强不做改变,简化开发、提高效率。 | | | <a href="https://baomidou.com/" target="_blank">MyBatis Plus</a> | 3.5.4.1        | MyBatis 的增强工具,在 MyBatis 的基础上只做增强不做改变,简化开发、提高效率。 | | ||||||
| | <a href="https://www.kancloud.cn/tracy5546/dynamic-datasource/2264611" target="_blank">dynamic-datasource-spring-boot-starter</a> | 4.2.0        | 基于 Spring Boot 的快速集成多数据源的启动器。                | | | <a href="https://www.kancloud.cn/tracy5546/dynamic-datasource/2264611" target="_blank">dynamic-datasource-spring-boot-starter</a> | 4.2.0          | 基于 Spring Boot 的快速集成多数据源的启动器。                | | ||||||
| | Hikari                                                       | 5.0.1        | JDBC 连接池,号称 “史上最快连接池”,SpringBoot 在 2.0 之后,采用的默认数据库连接池就是 Hikari。 | | | Hikari                                                       | 5.0.1          | JDBC 连接池,号称 “史上最快连接池”,SpringBoot 在 2.0 之后,采用的默认数据库连接池就是 Hikari。 | | ||||||
| | <a href="https://dev.mysql.com/downloads/mysql/" target="_blank">MySQL</a> | 8.0.33       | 体积小、速度快、总体拥有成本低,是最流行的关系型数据库管理系统之一。 | | | <a href="https://dev.mysql.com/downloads/mysql/" target="_blank">MySQL</a> | 8.0.33         | 体积小、速度快、总体拥有成本低,是最流行的关系型数据库管理系统之一。 | | ||||||
| | <a href="https://dev.mysql.com/doc/connector-j/8.0/en/" target="_blank">mysql-connector-j</a> | 8.0.33       | MySQL Java 驱动。                                            | | | <a href="https://dev.mysql.com/doc/connector-j/8.0/en/" target="_blank">mysql-connector-j</a> | 8.0.33         | MySQL Java 驱动。                                            | | ||||||
| | <a href="https://github.com/p6spy/p6spy" target="_blank">P6Spy</a> | 3.9.1        | SQL 性能分析组件。                                           | | | <a href="https://github.com/p6spy/p6spy" target="_blank">P6Spy</a> | 3.9.1          | SQL 性能分析组件。                                           | | ||||||
| | <a href="https://github.com/liquibase/liquibase" target="_blank">Liquibase</a> | 4.20.0       | 用于管理数据库版本,跟踪、管理和应用数据库变化。             | | | <a href="https://github.com/liquibase/liquibase" target="_blank">Liquibase</a> | 4.20.0         | 用于管理数据库版本,跟踪、管理和应用数据库变化。             | | ||||||
| | <a href="https://github.com/redisson/redisson/wiki/Redisson%E9%A1%B9%E7%9B%AE%E4%BB%8B%E7%BB%8D" target="_blank">Redisson</a> | 3.25.2       | 不仅仅是一个 Redis Java 客户端,Redisson 充分的利用了 Redis 键值数据库提供的一系列优势,为使用者提供了一系列具有分布式特性的常用工具:分布式锁、限流器等。 | | | <a href="https://github.com/redisson/redisson/wiki/Redisson%E9%A1%B9%E7%9B%AE%E4%BB%8B%E7%BB%8D" target="_blank">Redisson</a> | 3.25.2         | 不仅仅是一个 Redis Java 客户端,Redisson 充分的利用了 Redis 键值数据库提供的一系列优势,为使用者提供了一系列具有分布式特性的常用工具:分布式锁、限流器等。 | | ||||||
| | <a href="https://redis.io/" target="_blank">Redis</a>        | 7.2.3        | 高性能的 key-value 数据库。                                  | | | <a href="https://redis.io/" target="_blank">Redis</a>        | 7.2.3          | 高性能的 key-value 数据库。                                  | | ||||||
| | [X File Storage](https://x-file-storage.xuyanwu.cn/#/)       | 2.0.0        | 一行代码将文件存储到本地、FTP、SFTP、WebDAV、阿里云 OSS、华为云 OBS...等其它兼容 S3 协议的存储平台。 | | | [X File Storage](https://x-file-storage.xuyanwu.cn/#/)       | 2.0.0          | 一行代码将文件存储到本地、FTP、SFTP、WebDAV、阿里云 OSS、华为云 OBS...等其它兼容 S3 协议的存储平台。 | | ||||||
| | <a href="https://sms4j.com/" target="_blank">SMS4J</a>       | 3.0.4        | 短信聚合框架,轻松集成多家短信服务,解决接入多个短信 SDK 的繁琐流程。 | | | <a href="https://sms4j.com/" target="_blank">SMS4J</a>       | 3.0.4          | 短信聚合框架,轻松集成多家短信服务,解决接入多个短信 SDK 的繁琐流程。 | | ||||||
| | <a href="https://justauth.cn/" target="_blank">Just Auth</a> | 1.16.6       | 开箱即用的整合第三方登录的开源组件,脱离繁琐的第三方登录 SDK,让登录变得 So easy! | | | <a href="https://justauth.cn/" target="_blank">Just Auth</a> | 1.16.6         | 开箱即用的整合第三方登录的开源组件,脱离繁琐的第三方登录 SDK,让登录变得 So easy! | | ||||||
| | <a href="https://easyexcel.opensource.alibaba.com/" target="_blank">Easy Excel</a> | 3.3.3        | 一个基于 Java 的、快速、简洁、解决大文件内存溢出的 Excel 处理工具。 | | | <a href="https://easyexcel.opensource.alibaba.com/" target="_blank">Easy Excel</a> | 3.3.3          | 一个基于 Java 的、快速、简洁、解决大文件内存溢出的 Excel 处理工具。 | | ||||||
| | [AJ-Captcha](https://ajcaptcha.beliefteam.cn/captcha-doc/)   | 1.3.0        | Java 行为验证码,包含滑动拼图、文字点选两种方式,UI支持弹出和嵌入两种方式。 | | | [AJ-Captcha](https://ajcaptcha.beliefteam.cn/captcha-doc/)   | 1.3.0          | Java 行为验证码,包含滑动拼图、文字点选两种方式,UI支持弹出和嵌入两种方式。 | | ||||||
| | Easy Captcha                                                 | 1.6.2        | Java 图形验证码,支持 gif、中文、算术等类型,可用于 Java Web、JavaSE 等项目。 | | | Easy Captcha                                                 | 1.6.2          | Java 图形验证码,支持 gif、中文、算术等类型,可用于 Java Web、JavaSE 等项目。 | | ||||||
| | <a href="https://doc.xiaominfo.com/" target="_blank">Knife4j</a> | 4.4.0        | 前身是 swagger-bootstrap-ui,集 Swagger2 和 OpenAPI3 为一体的增强解决方案。 | | | <a href="https://doc.xiaominfo.com/" target="_blank">Knife4j</a> | 4.4.0          | 前身是 swagger-bootstrap-ui,集 Swagger2 和 OpenAPI3 为一体的增强解决方案。 | | ||||||
| | <a href="https://www.hutool.cn/" target="_blank">Hutool</a>  | 5.8.24       | 小而全的 Java 工具类库,通过静态方法封装,降低相关 API 的学习成本,提高工作效率,使 Java 拥有函数式语言般的优雅,让 Java 语言也可以“甜甜的”。 | | | <a href="https://www.hutool.cn/" target="_blank">Hutool</a>  | 5.8.24         | 小而全的 Java 工具类库,通过静态方法封装,降低相关 API 的学习成本,提高工作效率,使 Java 拥有函数式语言般的优雅,让 Java 语言也可以“甜甜的”。 | | ||||||
| | <a href="https://projectlombok.org/" target="_blank">Lombok</a> | 1.18.30      | 在 Java 开发过程中用注解的方式,简化了 JavaBean 的编写,避免了冗余和样板式代码,让编写的类更加简洁。 | | | <a href="https://projectlombok.org/" target="_blank">Lombok</a> | 1.18.30        | 在 Java 开发过程中用注解的方式,简化了 JavaBean 的编写,避免了冗余和样板式代码,让编写的类更加简洁。 | | ||||||
|  |  | ||||||
| ## 项目结构 | ## 项目结构 | ||||||
|  |  | ||||||
|   | |||||||
| @@ -24,7 +24,7 @@ import top.charles7c.continew.admin.monitor.model.query.OperationLogQuery; | |||||||
| import top.charles7c.continew.admin.monitor.model.query.SystemLogQuery; | import top.charles7c.continew.admin.monitor.model.query.SystemLogQuery; | ||||||
| import top.charles7c.continew.admin.monitor.model.resp.*; | import top.charles7c.continew.admin.monitor.model.resp.*; | ||||||
| import top.charles7c.continew.starter.extension.crud.model.query.PageQuery; | import top.charles7c.continew.starter.extension.crud.model.query.PageQuery; | ||||||
| import top.charles7c.continew.starter.extension.crud.model.resp.PageDataResp; | import top.charles7c.continew.starter.extension.crud.model.resp.PageResp; | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * 系统日志业务接口 |  * 系统日志业务接口 | ||||||
| @@ -43,7 +43,7 @@ public interface LogService { | |||||||
|      *            分页查询条件 |      *            分页查询条件 | ||||||
|      * @return 操作日志分页信息 |      * @return 操作日志分页信息 | ||||||
|      */ |      */ | ||||||
|     PageDataResp<OperationLogResp> page(OperationLogQuery query, PageQuery pageQuery); |     PageResp<OperationLogResp> page(OperationLogQuery query, PageQuery pageQuery); | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|      * 分页查询登录日志列表 |      * 分页查询登录日志列表 | ||||||
| @@ -54,7 +54,7 @@ public interface LogService { | |||||||
|      *            分页查询条件 |      *            分页查询条件 | ||||||
|      * @return 登录日志分页信息 |      * @return 登录日志分页信息 | ||||||
|      */ |      */ | ||||||
|     PageDataResp<LoginLogResp> page(LoginLogQuery query, PageQuery pageQuery); |     PageResp<LoginLogResp> page(LoginLogQuery query, PageQuery pageQuery); | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|      * 分页查询系统日志列表 |      * 分页查询系统日志列表 | ||||||
| @@ -65,7 +65,7 @@ public interface LogService { | |||||||
|      *            分页查询条件 |      *            分页查询条件 | ||||||
|      * @return 系统日志分页信息 |      * @return 系统日志分页信息 | ||||||
|      */ |      */ | ||||||
|     PageDataResp<SystemLogResp> page(SystemLogQuery query, PageQuery pageQuery); |     PageResp<SystemLogResp> page(SystemLogQuery query, PageQuery pageQuery); | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|      * 查看系统日志详情 |      * 查看系统日志详情 | ||||||
|   | |||||||
| @@ -45,7 +45,7 @@ import top.charles7c.continew.starter.core.util.validate.CheckUtils; | |||||||
| import top.charles7c.continew.starter.data.mybatis.plus.query.QueryHelper; | import top.charles7c.continew.starter.data.mybatis.plus.query.QueryHelper; | ||||||
| import top.charles7c.continew.starter.extension.crud.base.CommonUserService; | import top.charles7c.continew.starter.extension.crud.base.CommonUserService; | ||||||
| import top.charles7c.continew.starter.extension.crud.model.query.PageQuery; | import top.charles7c.continew.starter.extension.crud.model.query.PageQuery; | ||||||
| import top.charles7c.continew.starter.extension.crud.model.resp.PageDataResp; | import top.charles7c.continew.starter.extension.crud.model.resp.PageResp; | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * 系统日志业务实现 |  * 系统日志业务实现 | ||||||
| @@ -62,7 +62,7 @@ public class LogServiceImpl implements LogService { | |||||||
|     private final CommonUserService commonUserService; |     private final CommonUserService commonUserService; | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|     public PageDataResp<OperationLogResp> page(OperationLogQuery query, PageQuery pageQuery) { |     public PageResp<OperationLogResp> page(OperationLogQuery query, PageQuery pageQuery) { | ||||||
|         QueryWrapper<LogDO> queryWrapper = QueryHelper.build(query); |         QueryWrapper<LogDO> queryWrapper = QueryHelper.build(query); | ||||||
|         // 限定查询信息 |         // 限定查询信息 | ||||||
|         List<String> fieldNameList = ReflectUtils.getNonStaticFieldsName(OperationLogResp.class); |         List<String> fieldNameList = ReflectUtils.getNonStaticFieldsName(OperationLogResp.class); | ||||||
| @@ -72,19 +72,19 @@ public class LogServiceImpl implements LogService { | |||||||
|         queryWrapper.select(columnNameList); |         queryWrapper.select(columnNameList); | ||||||
|         // 分页查询 |         // 分页查询 | ||||||
|         IPage<LogDO> page = logMapper.selectPage(pageQuery.toPage(), queryWrapper); |         IPage<LogDO> page = logMapper.selectPage(pageQuery.toPage(), queryWrapper); | ||||||
|         PageDataResp<OperationLogResp> pageDataResp = PageDataResp.build(page, OperationLogResp.class); |         PageResp<OperationLogResp> pageResp = PageResp.build(page, OperationLogResp.class); | ||||||
|         // 填充数据(如果是查询个人操作日志,只查询一次用户信息即可) |         // 填充数据(如果是查询个人操作日志,只查询一次用户信息即可) | ||||||
|         if (null != query.getUid()) { |         if (null != query.getUid()) { | ||||||
|             String nickname = ExceptionUtils.exToNull(() -> commonUserService.getNicknameById(query.getUid())); |             String nickname = ExceptionUtils.exToNull(() -> commonUserService.getNicknameById(query.getUid())); | ||||||
|             pageDataResp.getList().forEach(o -> o.setCreateUserString(nickname)); |             pageResp.getList().forEach(o -> o.setCreateUserString(nickname)); | ||||||
|         } else { |         } else { | ||||||
|             pageDataResp.getList().forEach(this::fill); |             pageResp.getList().forEach(this::fill); | ||||||
|         } |         } | ||||||
|         return pageDataResp; |         return pageResp; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|     public PageDataResp<LoginLogResp> page(LoginLogQuery query, PageQuery pageQuery) { |     public PageResp<LoginLogResp> page(LoginLogQuery query, PageQuery pageQuery) { | ||||||
|         QueryWrapper<LogDO> queryWrapper = QueryHelper.build(query); |         QueryWrapper<LogDO> queryWrapper = QueryHelper.build(query); | ||||||
|         queryWrapper.eq("module", "登录"); |         queryWrapper.eq("module", "登录"); | ||||||
|         // 限定查询信息 |         // 限定查询信息 | ||||||
| @@ -95,14 +95,14 @@ public class LogServiceImpl implements LogService { | |||||||
|         queryWrapper.select(columnNameList); |         queryWrapper.select(columnNameList); | ||||||
|         // 分页查询 |         // 分页查询 | ||||||
|         IPage<LogDO> page = logMapper.selectPage(pageQuery.toPage(), queryWrapper); |         IPage<LogDO> page = logMapper.selectPage(pageQuery.toPage(), queryWrapper); | ||||||
|         PageDataResp<LoginLogResp> pageDataResp = PageDataResp.build(page, LoginLogResp.class); |         PageResp<LoginLogResp> pageResp = PageResp.build(page, LoginLogResp.class); | ||||||
|         // 填充数据 |         // 填充数据 | ||||||
|         pageDataResp.getList().forEach(this::fill); |         pageResp.getList().forEach(this::fill); | ||||||
|         return pageDataResp; |         return pageResp; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|     public PageDataResp<SystemLogResp> page(SystemLogQuery query, PageQuery pageQuery) { |     public PageResp<SystemLogResp> page(SystemLogQuery query, PageQuery pageQuery) { | ||||||
|         QueryWrapper<LogDO> queryWrapper = QueryHelper.build(query); |         QueryWrapper<LogDO> queryWrapper = QueryHelper.build(query); | ||||||
|         // 限定查询信息 |         // 限定查询信息 | ||||||
|         List<String> fieldNameList = ReflectUtils.getNonStaticFieldsName(SystemLogResp.class); |         List<String> fieldNameList = ReflectUtils.getNonStaticFieldsName(SystemLogResp.class); | ||||||
| @@ -112,10 +112,10 @@ public class LogServiceImpl implements LogService { | |||||||
|         queryWrapper.select(columnNameList); |         queryWrapper.select(columnNameList); | ||||||
|         // 分页查询 |         // 分页查询 | ||||||
|         IPage<LogDO> page = logMapper.selectPage(pageQuery.toPage(), queryWrapper); |         IPage<LogDO> page = logMapper.selectPage(pageQuery.toPage(), queryWrapper); | ||||||
|         PageDataResp<SystemLogResp> pageDataResp = PageDataResp.build(page, SystemLogResp.class); |         PageResp<SystemLogResp> pageResp = PageResp.build(page, SystemLogResp.class); | ||||||
|         // 填充数据 |         // 填充数据 | ||||||
|         pageDataResp.getList().forEach(this::fill); |         pageResp.getList().forEach(this::fill); | ||||||
|         return pageDataResp; |         return pageResp; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|   | |||||||
| @@ -22,7 +22,7 @@ import top.charles7c.continew.admin.auth.model.query.OnlineUserQuery; | |||||||
| import top.charles7c.continew.admin.auth.model.resp.OnlineUserResp; | import top.charles7c.continew.admin.auth.model.resp.OnlineUserResp; | ||||||
| import top.charles7c.continew.admin.common.model.dto.LoginUser; | import top.charles7c.continew.admin.common.model.dto.LoginUser; | ||||||
| import top.charles7c.continew.starter.extension.crud.model.query.PageQuery; | import top.charles7c.continew.starter.extension.crud.model.query.PageQuery; | ||||||
| import top.charles7c.continew.starter.extension.crud.model.resp.PageDataResp; | import top.charles7c.continew.starter.extension.crud.model.resp.PageResp; | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * 在线用户业务接口 |  * 在线用户业务接口 | ||||||
| @@ -41,7 +41,7 @@ public interface OnlineUserService { | |||||||
|      *            分页查询条件 |      *            分页查询条件 | ||||||
|      * @return 分页列表信息 |      * @return 分页列表信息 | ||||||
|      */ |      */ | ||||||
|     PageDataResp<OnlineUserResp> page(OnlineUserQuery query, PageQuery pageQuery); |     PageResp<OnlineUserResp> page(OnlineUserQuery query, PageQuery pageQuery); | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|      * 查询列表 |      * 查询列表 | ||||||
|   | |||||||
| @@ -38,7 +38,7 @@ import top.charles7c.continew.admin.common.model.dto.LoginUser; | |||||||
| import top.charles7c.continew.admin.common.util.helper.LoginHelper; | import top.charles7c.continew.admin.common.util.helper.LoginHelper; | ||||||
| import top.charles7c.continew.starter.core.constant.StringConstants; | import top.charles7c.continew.starter.core.constant.StringConstants; | ||||||
| import top.charles7c.continew.starter.extension.crud.model.query.PageQuery; | import top.charles7c.continew.starter.extension.crud.model.query.PageQuery; | ||||||
| import top.charles7c.continew.starter.extension.crud.model.resp.PageDataResp; | import top.charles7c.continew.starter.extension.crud.model.resp.PageResp; | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * 在线用户业务实现 |  * 在线用户业务实现 | ||||||
| @@ -51,12 +51,12 @@ import top.charles7c.continew.starter.extension.crud.model.resp.PageDataResp; | |||||||
| public class OnlineUserServiceImpl implements OnlineUserService { | public class OnlineUserServiceImpl implements OnlineUserService { | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|     public PageDataResp<OnlineUserResp> page(OnlineUserQuery query, PageQuery pageQuery) { |     public PageResp<OnlineUserResp> page(OnlineUserQuery query, PageQuery pageQuery) { | ||||||
|         List<LoginUser> loginUserList = this.list(query); |         List<LoginUser> loginUserList = this.list(query); | ||||||
|         List<OnlineUserResp> list = BeanUtil.copyToList(loginUserList, OnlineUserResp.class); |         List<OnlineUserResp> list = BeanUtil.copyToList(loginUserList, OnlineUserResp.class); | ||||||
|         PageDataResp<OnlineUserResp> pageDataResp = PageDataResp.build(pageQuery.getPage(), pageQuery.getSize(), list); |         PageResp<OnlineUserResp> pageResp = PageResp.build(pageQuery.getPage(), pageQuery.getSize(), list); | ||||||
|         pageDataResp.getList().forEach(u -> u.setNickname(LoginHelper.getNickname(u.getId()))); |         pageResp.getList().forEach(u -> u.setNickname(LoginHelper.getNickname(u.getId()))); | ||||||
|         return pageDataResp; |         return pageResp; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|   | |||||||
| @@ -22,7 +22,7 @@ import top.charles7c.continew.admin.system.model.query.MessageQuery; | |||||||
| import top.charles7c.continew.admin.system.model.req.MessageReq; | import top.charles7c.continew.admin.system.model.req.MessageReq; | ||||||
| import top.charles7c.continew.admin.system.model.resp.MessageResp; | import top.charles7c.continew.admin.system.model.resp.MessageResp; | ||||||
| import top.charles7c.continew.starter.extension.crud.model.query.PageQuery; | import top.charles7c.continew.starter.extension.crud.model.query.PageQuery; | ||||||
| import top.charles7c.continew.starter.extension.crud.model.resp.PageDataResp; | import top.charles7c.continew.starter.extension.crud.model.resp.PageResp; | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * 消息业务接口 |  * 消息业务接口 | ||||||
| @@ -41,7 +41,7 @@ public interface MessageService { | |||||||
|      *            分页查询条件 |      *            分页查询条件 | ||||||
|      * @return 分页列表信息 |      * @return 分页列表信息 | ||||||
|      */ |      */ | ||||||
|     PageDataResp<MessageResp> page(MessageQuery query, PageQuery pageQuery); |     PageResp<MessageResp> page(MessageQuery query, PageQuery pageQuery); | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|      * 新增 |      * 新增 | ||||||
|   | |||||||
| @@ -42,7 +42,7 @@ import top.charles7c.continew.starter.core.util.validate.CheckUtils; | |||||||
| import top.charles7c.continew.starter.data.mybatis.plus.query.QueryHelper; | import top.charles7c.continew.starter.data.mybatis.plus.query.QueryHelper; | ||||||
| import top.charles7c.continew.starter.extension.crud.base.CommonUserService; | import top.charles7c.continew.starter.extension.crud.base.CommonUserService; | ||||||
| import top.charles7c.continew.starter.extension.crud.model.query.PageQuery; | import top.charles7c.continew.starter.extension.crud.model.query.PageQuery; | ||||||
| import top.charles7c.continew.starter.extension.crud.model.resp.PageDataResp; | import top.charles7c.continew.starter.extension.crud.model.resp.PageResp; | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * 消息业务实现 |  * 消息业务实现 | ||||||
| @@ -58,13 +58,13 @@ public class MessageServiceImpl implements MessageService { | |||||||
|     private final MessageUserService messageUserService; |     private final MessageUserService messageUserService; | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|     public PageDataResp<MessageResp> page(MessageQuery query, PageQuery pageQuery) { |     public PageResp<MessageResp> page(MessageQuery query, PageQuery pageQuery) { | ||||||
|         QueryWrapper<MessageDO> queryWrapper = QueryHelper.build(query); |         QueryWrapper<MessageDO> queryWrapper = QueryHelper.build(query); | ||||||
|         queryWrapper.apply(null != query.getUserId(), "t2.user_id={0}", query.getUserId()) |         queryWrapper.apply(null != query.getUserId(), "t2.user_id={0}", query.getUserId()) | ||||||
|             .apply(null != query.getIsRead(), "t2.is_read={0}", query.getIsRead()); |             .apply(null != query.getIsRead(), "t2.is_read={0}", query.getIsRead()); | ||||||
|         IPage<MessageResp> page = baseMapper.selectPageByUserId(pageQuery.toPage(), queryWrapper); |         IPage<MessageResp> page = baseMapper.selectPageByUserId(pageQuery.toPage(), queryWrapper); | ||||||
|         page.getRecords().forEach(this::fill); |         page.getRecords().forEach(this::fill); | ||||||
|         return PageDataResp.build(page); |         return PageResp.build(page); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|   | |||||||
| @@ -26,7 +26,7 @@ import top.charles7c.continew.admin.tool.model.req.GenConfigReq; | |||||||
| import top.charles7c.continew.admin.tool.model.resp.GeneratePreviewResp; | import top.charles7c.continew.admin.tool.model.resp.GeneratePreviewResp; | ||||||
| import top.charles7c.continew.admin.tool.model.resp.TableResp; | import top.charles7c.continew.admin.tool.model.resp.TableResp; | ||||||
| import top.charles7c.continew.starter.extension.crud.model.query.PageQuery; | import top.charles7c.continew.starter.extension.crud.model.query.PageQuery; | ||||||
| import top.charles7c.continew.starter.extension.crud.model.resp.PageDataResp; | import top.charles7c.continew.starter.extension.crud.model.resp.PageResp; | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * 代码生成业务接口 |  * 代码生成业务接口 | ||||||
| @@ -47,7 +47,7 @@ public interface GeneratorService { | |||||||
|      * @throws SQLException |      * @throws SQLException | ||||||
|      *             / |      *             / | ||||||
|      */ |      */ | ||||||
|     PageDataResp<TableResp> pageTable(TableQuery query, PageQuery pageQuery) throws SQLException; |     PageResp<TableResp> pageTable(TableQuery query, PageQuery pageQuery) throws SQLException; | ||||||
|  |  | ||||||
|     /** |     /** | ||||||
|      * 查询生成配置信息 |      * 查询生成配置信息 | ||||||
|   | |||||||
| @@ -61,7 +61,7 @@ import top.charles7c.continew.starter.core.util.db.MetaUtils; | |||||||
| import top.charles7c.continew.starter.core.util.db.Table; | import top.charles7c.continew.starter.core.util.db.Table; | ||||||
| import top.charles7c.continew.starter.core.util.validate.CheckUtils; | import top.charles7c.continew.starter.core.util.validate.CheckUtils; | ||||||
| import top.charles7c.continew.starter.extension.crud.model.query.PageQuery; | import top.charles7c.continew.starter.extension.crud.model.query.PageQuery; | ||||||
| import top.charles7c.continew.starter.extension.crud.model.resp.PageDataResp; | import top.charles7c.continew.starter.extension.crud.model.resp.PageResp; | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * 代码生成业务实现 |  * 代码生成业务实现 | ||||||
| @@ -80,7 +80,7 @@ public class GeneratorServiceImpl implements GeneratorService { | |||||||
|     private final GenConfigMapper genConfigMapper; |     private final GenConfigMapper genConfigMapper; | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|     public PageDataResp<TableResp> pageTable(TableQuery query, PageQuery pageQuery) throws SQLException { |     public PageResp<TableResp> pageTable(TableQuery query, PageQuery pageQuery) throws SQLException { | ||||||
|         List<Table> tableList = MetaUtils.getTables(dataSource); |         List<Table> tableList = MetaUtils.getTables(dataSource); | ||||||
|         String tableName = query.getTableName(); |         String tableName = query.getTableName(); | ||||||
|         if (StrUtil.isNotBlank(tableName)) { |         if (StrUtil.isNotBlank(tableName)) { | ||||||
| @@ -93,14 +93,13 @@ public class GeneratorServiceImpl implements GeneratorService { | |||||||
|                 .thenComparing(table -> Optional.ofNullable(table.getUpdateTime()).orElse(table.getCreateTime())) |                 .thenComparing(table -> Optional.ofNullable(table.getUpdateTime()).orElse(table.getCreateTime())) | ||||||
|                 .reversed()); |                 .reversed()); | ||||||
|         List<TableResp> tableRespList = BeanUtil.copyToList(tableList, TableResp.class); |         List<TableResp> tableRespList = BeanUtil.copyToList(tableList, TableResp.class); | ||||||
|         PageDataResp<TableResp> pageDataResp = |         PageResp<TableResp> pageResp = PageResp.build(pageQuery.getPage(), pageQuery.getSize(), tableRespList); | ||||||
|             PageDataResp.build(pageQuery.getPage(), pageQuery.getSize(), tableRespList); |         for (TableResp tableResp : pageResp.getList()) { | ||||||
|         for (TableResp tableResp : pageDataResp.getList()) { |  | ||||||
|             long count = genConfigMapper.selectCount( |             long count = genConfigMapper.selectCount( | ||||||
|                 Wrappers.lambdaQuery(GenConfigDO.class).eq(GenConfigDO::getTableName, tableResp.getTableName())); |                 Wrappers.lambdaQuery(GenConfigDO.class).eq(GenConfigDO::getTableName, tableResp.getTableName())); | ||||||
|             tableResp.setIsConfiged(count > 0); |             tableResp.setIsConfiged(count > 0); | ||||||
|         } |         } | ||||||
|         return pageDataResp; |         return pageResp; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|   | |||||||
| @@ -38,7 +38,7 @@ import top.charles7c.continew.admin.monitor.model.resp.SystemLogDetailResp; | |||||||
| import top.charles7c.continew.admin.monitor.model.resp.SystemLogResp; | import top.charles7c.continew.admin.monitor.model.resp.SystemLogResp; | ||||||
| import top.charles7c.continew.admin.monitor.service.LogService; | import top.charles7c.continew.admin.monitor.service.LogService; | ||||||
| import top.charles7c.continew.starter.extension.crud.model.query.PageQuery; | import top.charles7c.continew.starter.extension.crud.model.query.PageQuery; | ||||||
| import top.charles7c.continew.starter.extension.crud.model.resp.PageDataResp; | import top.charles7c.continew.starter.extension.crud.model.resp.PageResp; | ||||||
| import top.charles7c.continew.starter.extension.crud.model.resp.R; | import top.charles7c.continew.starter.extension.crud.model.resp.R; | ||||||
| import top.charles7c.continew.starter.log.common.annotation.Log; | import top.charles7c.continew.starter.log.common.annotation.Log; | ||||||
|  |  | ||||||
| @@ -59,24 +59,24 @@ public class LogController { | |||||||
|     @Log(module = "登录日志") |     @Log(module = "登录日志") | ||||||
|     @Operation(summary = "分页查询登录日志列表", description = "分页查询登录日志列表") |     @Operation(summary = "分页查询登录日志列表", description = "分页查询登录日志列表") | ||||||
|     @GetMapping("/login") |     @GetMapping("/login") | ||||||
|     public R<PageDataResp<LoginLogResp>> page(LoginLogQuery query, @Validated PageQuery pageQuery) { |     public R<PageResp<LoginLogResp>> page(LoginLogQuery query, @Validated PageQuery pageQuery) { | ||||||
|         PageDataResp<LoginLogResp> pageData = logService.page(query, pageQuery); |         PageResp<LoginLogResp> pageData = logService.page(query, pageQuery); | ||||||
|         return R.ok(pageData); |         return R.ok(pageData); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     @Log(module = "操作日志") |     @Log(module = "操作日志") | ||||||
|     @Operation(summary = "分页查询操作日志列表", description = "分页查询操作日志列表") |     @Operation(summary = "分页查询操作日志列表", description = "分页查询操作日志列表") | ||||||
|     @GetMapping("/operation") |     @GetMapping("/operation") | ||||||
|     public R<PageDataResp<OperationLogResp>> page(OperationLogQuery query, @Validated PageQuery pageQuery) { |     public R<PageResp<OperationLogResp>> page(OperationLogQuery query, @Validated PageQuery pageQuery) { | ||||||
|         PageDataResp<OperationLogResp> pageData = logService.page(query, pageQuery); |         PageResp<OperationLogResp> pageData = logService.page(query, pageQuery); | ||||||
|         return R.ok(pageData); |         return R.ok(pageData); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     @Log(module = "系统日志") |     @Log(module = "系统日志") | ||||||
|     @Operation(summary = "分页查询系统日志列表", description = "分页查询系统日志列表") |     @Operation(summary = "分页查询系统日志列表", description = "分页查询系统日志列表") | ||||||
|     @GetMapping("/system") |     @GetMapping("/system") | ||||||
|     public R<PageDataResp<SystemLogResp>> page(SystemLogQuery query, @Validated PageQuery pageQuery) { |     public R<PageResp<SystemLogResp>> page(SystemLogQuery query, @Validated PageQuery pageQuery) { | ||||||
|         PageDataResp<SystemLogResp> pageData = logService.page(query, pageQuery); |         PageResp<SystemLogResp> pageData = logService.page(query, pageQuery); | ||||||
|         return R.ok(pageData); |         return R.ok(pageData); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -34,7 +34,7 @@ import top.charles7c.continew.admin.auth.model.resp.OnlineUserResp; | |||||||
| import top.charles7c.continew.admin.auth.service.OnlineUserService; | import top.charles7c.continew.admin.auth.service.OnlineUserService; | ||||||
| import top.charles7c.continew.starter.core.util.validate.CheckUtils; | import top.charles7c.continew.starter.core.util.validate.CheckUtils; | ||||||
| import top.charles7c.continew.starter.extension.crud.model.query.PageQuery; | import top.charles7c.continew.starter.extension.crud.model.query.PageQuery; | ||||||
| import top.charles7c.continew.starter.extension.crud.model.resp.PageDataResp; | import top.charles7c.continew.starter.extension.crud.model.resp.PageResp; | ||||||
| import top.charles7c.continew.starter.extension.crud.model.resp.R; | import top.charles7c.continew.starter.extension.crud.model.resp.R; | ||||||
|  |  | ||||||
| /** | /** | ||||||
| @@ -54,8 +54,8 @@ public class OnlineUserController { | |||||||
|     @Operation(summary = "分页查询列表", description = "分页查询列表") |     @Operation(summary = "分页查询列表", description = "分页查询列表") | ||||||
|     @SaCheckPermission("monitor:online:user:list") |     @SaCheckPermission("monitor:online:user:list") | ||||||
|     @GetMapping |     @GetMapping | ||||||
|     public R<PageDataResp<OnlineUserResp>> page(OnlineUserQuery query, @Validated PageQuery pageQuery) { |     public R<PageResp<OnlineUserResp>> page(OnlineUserQuery query, @Validated PageQuery pageQuery) { | ||||||
|         PageDataResp<OnlineUserResp> pageData = onlineUserService.page(query, pageQuery); |         PageResp<OnlineUserResp> pageData = onlineUserService.page(query, pageQuery); | ||||||
|         return R.ok(pageData); |         return R.ok(pageData); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -35,7 +35,7 @@ import top.charles7c.continew.admin.system.model.resp.MessageUnreadResp; | |||||||
| import top.charles7c.continew.admin.system.service.MessageService; | import top.charles7c.continew.admin.system.service.MessageService; | ||||||
| import top.charles7c.continew.admin.system.service.MessageUserService; | import top.charles7c.continew.admin.system.service.MessageUserService; | ||||||
| import top.charles7c.continew.starter.extension.crud.model.query.PageQuery; | import top.charles7c.continew.starter.extension.crud.model.query.PageQuery; | ||||||
| import top.charles7c.continew.starter.extension.crud.model.resp.PageDataResp; | import top.charles7c.continew.starter.extension.crud.model.resp.PageResp; | ||||||
| import top.charles7c.continew.starter.extension.crud.model.resp.R; | import top.charles7c.continew.starter.extension.crud.model.resp.R; | ||||||
| import top.charles7c.continew.starter.log.common.annotation.Log; | import top.charles7c.continew.starter.log.common.annotation.Log; | ||||||
|  |  | ||||||
| @@ -56,9 +56,9 @@ public class MessageController { | |||||||
|  |  | ||||||
|     @Operation(summary = "分页查询列表", description = "分页查询列表") |     @Operation(summary = "分页查询列表", description = "分页查询列表") | ||||||
|     @GetMapping |     @GetMapping | ||||||
|     public R<PageDataResp<MessageResp>> page(MessageQuery query, @Validated PageQuery pageQuery) { |     public R<PageResp<MessageResp>> page(MessageQuery query, @Validated PageQuery pageQuery) { | ||||||
|         query.setUserId(LoginHelper.getUserId()); |         query.setUserId(LoginHelper.getUserId()); | ||||||
|         PageDataResp<MessageResp> pageData = baseService.page(query, pageQuery); |         PageResp<MessageResp> pageData = baseService.page(query, pageQuery); | ||||||
|         return R.ok(pageData); |         return R.ok(pageData); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -41,7 +41,7 @@ import top.charles7c.continew.admin.tool.service.GeneratorService; | |||||||
| import top.charles7c.continew.starter.core.autoconfigure.project.ProjectProperties; | import top.charles7c.continew.starter.core.autoconfigure.project.ProjectProperties; | ||||||
| import top.charles7c.continew.starter.core.util.validate.ValidationUtils; | import top.charles7c.continew.starter.core.util.validate.ValidationUtils; | ||||||
| import top.charles7c.continew.starter.extension.crud.model.query.PageQuery; | import top.charles7c.continew.starter.extension.crud.model.query.PageQuery; | ||||||
| import top.charles7c.continew.starter.extension.crud.model.resp.PageDataResp; | import top.charles7c.continew.starter.extension.crud.model.resp.PageResp; | ||||||
| import top.charles7c.continew.starter.extension.crud.model.resp.R; | import top.charles7c.continew.starter.extension.crud.model.resp.R; | ||||||
|  |  | ||||||
| /** | /** | ||||||
| @@ -63,7 +63,7 @@ public class GeneratorController { | |||||||
|     @Operation(summary = "分页查询数据表", description = "分页查询数据表") |     @Operation(summary = "分页查询数据表", description = "分页查询数据表") | ||||||
|     @SaCheckPermission("tool:generator:list") |     @SaCheckPermission("tool:generator:list") | ||||||
|     @GetMapping("/table") |     @GetMapping("/table") | ||||||
|     public R<PageDataResp<TableResp>> pageTable(TableQuery query, @Validated PageQuery pageQuery) throws SQLException { |     public R<PageResp<TableResp>> pageTable(TableQuery query, @Validated PageQuery pageQuery) throws SQLException { | ||||||
|         return R.ok(generatorService.pageTable(query, pageQuery)); |         return R.ok(generatorService.pageTable(query, pageQuery)); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user