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; - } -}