From 92eb80ae66b9f6d51fdd2f60281ed9455638f3d4 Mon Sep 17 00:00:00 2001
From: falcon <9504402@qq.com>
Date: Mon, 10 Apr 2023 18:21:55 +0800
Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E5=88=86=E9=A1=B5=E6=94=AF?=
=?UTF-8?q?=E6=8C=81=EF=BC=8C=E7=BB=9F=E4=B8=80=E4=BD=BF=E7=94=A8=E8=AF=B7?=
=?UTF-8?q?=E6=B1=82PageData=E5=AF=B9=E8=B1=A1=E5=92=8C=E8=BF=94=E5=9B=9EP?=
=?UTF-8?q?ageResult=E5=AF=B9=E8=B1=A1=EF=BC=8C=E5=B9=B6=E4=B8=94=E5=9C=A8?=
=?UTF-8?q?ApiResult=E4=B8=AD=E5=A2=9E=E5=8A=A0Paging=E5=B1=9E=E6=80=A7?=
=?UTF-8?q?=E8=A1=A8=E7=A4=BA=E5=88=86=E9=A1=B5=E7=BB=93=E6=9E=9C=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Falcon.SugarApi/ApiDefinistions/ApiResult.cs | 4 ++++
Falcon.SugarApi/ApiDefinistions/PageData.cs | 4 ++--
Falcon.SugarApi/ApiDefinistions/PageResult.cs | 21 +++++++++++++++++++
Falcon.SugarApi/DatabaseDefinitions/Paging.cs | 17 ---------------
4 files changed, 27 insertions(+), 19 deletions(-)
create mode 100644 Falcon.SugarApi/ApiDefinistions/PageResult.cs
delete mode 100644 Falcon.SugarApi/DatabaseDefinitions/Paging.cs
diff --git a/Falcon.SugarApi/ApiDefinistions/ApiResult.cs b/Falcon.SugarApi/ApiDefinistions/ApiResult.cs
index 18cde45..582ce0e 100644
--- a/Falcon.SugarApi/ApiDefinistions/ApiResult.cs
+++ b/Falcon.SugarApi/ApiDefinistions/ApiResult.cs
@@ -19,6 +19,10 @@ namespace Falcon.SugarApi.ApiDefinistions
[JsonPropertyName("msg")]
public string Msg { get; set; }
///
+ /// 分页结果。如果为null则为未分页
+ ///
+ public PageResult? Paging { get; set; }
+ ///
/// 携带数据
///
[JsonPropertyName("data")]
diff --git a/Falcon.SugarApi/ApiDefinistions/PageData.cs b/Falcon.SugarApi/ApiDefinistions/PageData.cs
index 385a2cb..b5cd61a 100644
--- a/Falcon.SugarApi/ApiDefinistions/PageData.cs
+++ b/Falcon.SugarApi/ApiDefinistions/PageData.cs
@@ -6,9 +6,9 @@
public class PageData
{
///
- /// 页号码
+ /// 页号码。从1开始
///
- public int Page { get; set; } = 0;
+ public int Page { get; set; } = 1;
///
/// 页大小
///
diff --git a/Falcon.SugarApi/ApiDefinistions/PageResult.cs b/Falcon.SugarApi/ApiDefinistions/PageResult.cs
new file mode 100644
index 0000000..d3ac196
--- /dev/null
+++ b/Falcon.SugarApi/ApiDefinistions/PageResult.cs
@@ -0,0 +1,21 @@
+namespace Falcon.SugarApi.ApiDefinistions
+{
+ ///
+ /// 数据分页结果
+ ///
+ public class PageResult {
+ ///
+ /// 页号码。从1开始
+ ///
+ public int Page { get; set; } = 1;
+ ///
+ /// 页大小
+ ///
+ public int PageSize { get; set; } = 50;
+ ///
+ /// 总数据数
+ ///
+ public int Count { get; set; } = 0;
+
+ }
+}
\ No newline at end of file
diff --git a/Falcon.SugarApi/DatabaseDefinitions/Paging.cs b/Falcon.SugarApi/DatabaseDefinitions/Paging.cs
deleted file mode 100644
index daa2341..0000000
--- a/Falcon.SugarApi/DatabaseDefinitions/Paging.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-namespace Falcon.SugarApi.DatabaseDefinitions
-{
- ///
- /// 对数据进行分页
- ///
- public class Paging
- {
- ///
- /// 每页大小
- ///
- public int PageSize { get; set; } = 100;
- ///
- /// 第几页。页码从1开始
- ///
- public int PageNo { get; set; } = 1;
- }
-}