统一Page相关入参和出参

zw
lxw 6 months ago
parent 50abce00a2
commit a3f172c9bb

@ -1,157 +0,0 @@
using System.Linq.Expressions;
using SqlSugar;
namespace Entity.Base
{
/// <summary>
/// 分页泛型集合
/// </summary>
/// <typeparam name="TEntity"></typeparam>
public class SqlSugarPagedList<TEntity>
{
/// <summary>
/// 页码
/// </summary>
public int Page { get; set; }
/// <summary>
/// 页容量
/// </summary>
public int PageSize { get; set; }
/// <summary>
/// 总条数
/// </summary>
public int Total { get; set; }
/// <summary>
/// 总页数
/// </summary>
public int TotalPages { get; set; }
/// <summary>
/// 当前页集合
/// </summary>
public IEnumerable<TEntity> Items { get; set; }
/// <summary>
/// 是否有上一页
/// </summary>
public bool HasPrevPage { get; set; }
/// <summary>
/// 是否有下一页
/// </summary>
public bool HasNextPage { get; set; }
}
/// <summary>
/// 分页拓展类
/// </summary>
public static class SqlSugarPagedExtensions
{
/// <summary>
/// 分页拓展
/// </summary>
/// <param name="query"><see cref="ISugarQueryable{T}"/>对象</param>
/// <param name="pageIndex">当前页码从1开始</param>
/// <param name="pageSize">页码容量</param>
/// <param name="expression">查询结果 Select 表达式</param>
/// <returns></returns>
public static SqlSugarPagedList<TResult> ToPagedList<TEntity, TResult>(this ISugarQueryable<TEntity> query,
int pageIndex, int pageSize,
Expression<Func<TEntity, TResult>> expression)
{
var total = 0;
var items = query.ToPageList(pageIndex, pageSize, ref total, expression);
return CreateSqlSugarPagedList(items, total, pageIndex, pageSize);
}
/// <summary>
/// 分页拓展
/// </summary>
/// <param name="query"><see cref="ISugarQueryable{TEntity}"/>对象</param>
/// <param name="pageIndex">当前页码从1开始</param>
/// <param name="pageSize">页码容量</param>
/// <returns></returns>
public static SqlSugarPagedList<TEntity> ToPagedList<TEntity>(this ISugarQueryable<TEntity> query,
int pageIndex, int pageSize)
{
var total = 0;
var items = query.ToPageList(pageIndex, pageSize, ref total);
return CreateSqlSugarPagedList(items, total, pageIndex, pageSize);
}
/// <summary>
/// 分页拓展
/// </summary>
/// <param name="query"><see cref="ISugarQueryable{TEntity}"/>对象</param>
/// <param name="pageIndex">当前页码从1开始</param>
/// <param name="pageSize">页码容量</param>
/// <param name="expression">查询结果 Select 表达式</param>
/// <returns></returns>
public static async Task<SqlSugarPagedList<TResult>> ToPagedListAsync<TEntity, TResult>(
this ISugarQueryable<TEntity> query, int pageIndex, int pageSize,
Expression<Func<TEntity, TResult>> expression)
{
RefAsync<int> total = 0;
var items = await query.ToPageListAsync(pageIndex, pageSize, total, expression);
return CreateSqlSugarPagedList(items, total, pageIndex, pageSize);
}
/// <summary>
/// 分页拓展
/// </summary>
/// <param name="query"><see cref="ISugarQueryable{TEntity}"/>对象</param>
/// <param name="pageIndex">当前页码从1开始</param>
/// <param name="pageSize">页码容量</param>
/// <returns></returns>
public static async Task<SqlSugarPagedList<TEntity>> ToPagedListAsync<TEntity>(
this ISugarQueryable<TEntity> query, int pageIndex, int pageSize)
{
RefAsync<int> total = 0;
var items = await query.ToPageListAsync(pageIndex, pageSize, total);
return CreateSqlSugarPagedList(items, total, pageIndex, pageSize);
}
/// <summary>
/// 分页拓展
/// </summary>
/// <param name="list">集合对象</param>
/// <param name="pageIndex">当前页码从1开始</param>
/// <param name="pageSize">页码容量</param>
/// <returns></returns>
public static SqlSugarPagedList<TEntity> ToPagedList<TEntity>(this IEnumerable<TEntity> list, int pageIndex,
int pageSize)
{
var total = list.Count();
var items = list.Skip((pageIndex - 1) * pageSize).Take(pageSize).ToList();
return CreateSqlSugarPagedList(items, total, pageIndex, pageSize);
}
/// <summary>
/// 创建 <see cref="SqlSugarPagedList{TEntity}"/> 对象
/// </summary>
/// <typeparam name="TEntity"></typeparam>
/// <param name="items">分页内容的对象集合</param>
/// <param name="total">总条数</param>
/// <param name="pageIndex">当前页码从1开始</param>
/// <param name="pageSize">页码容量</param>
/// <returns></returns>
public static SqlSugarPagedList<TEntity> CreateSqlSugarPagedList<TEntity>(IEnumerable<TEntity> items, int total,
int pageIndex, int pageSize)
{
var totalPages = pageSize > 0 ? (int)Math.Ceiling(total / (double)pageSize) : 0;
return new SqlSugarPagedList<TEntity>
{
Page = pageIndex,
PageSize = pageSize,
Items = items,
Total = total,
TotalPages = totalPages,
HasNextPage = pageIndex < totalPages,
HasPrevPage = pageIndex - 1 > 0
};
}
}
}

@ -1,34 +0,0 @@
namespace Entity.Dto.Req
{
/// <summary>
/// 全局分页查询输入参数
/// </summary>
public class BasePageReq
{
/// <summary>
/// 当前页码
/// </summary>
public virtual int Page { get; set; } = 1;
/// <summary>
/// 页码容量
/// </summary>
//[Range(0, 100, ErrorMessage = "页码容量超过最大限制")]
public virtual int PageSize { get; set; } = 20;
/// <summary>
/// 排序字段
/// </summary>
public virtual string Field { get; set; } = "";
/// <summary>
/// 排序方向
/// </summary>
public virtual string OrderDirection { get; set; } = "Desc";
/// <summary>
/// 降序排序
/// </summary>
public virtual string DescStr { get; set; } = "descending";
}
}

@ -1,12 +1,12 @@
using Entity.DbModel.System;
using HybirdFrameworkCore.Entity;
namespace Entity.Dto.Req
{
public class ConfigReq : BaseIdReq
{
}
public class PageConfigReq : BasePageReq
public class PageConfigReq : QueryPageModel
{
/// <summary>
/// 名称

@ -1,12 +1,12 @@
using Entity.DbModel.Station;
using HybirdFrameworkCore.Entity;
namespace Entity.Dto.Req;
public class EquipInfoReq : BaseIdReq
{
}
public class PageEquipInfoReq : BasePageReq
public class PageEquipInfoReq : QueryPageModel
{
/// <summary>
/// 名称

@ -25,4 +25,10 @@
<ProjectReference Include="..\Common\Common.csproj" />
</ItemGroup>
<ItemGroup>
<Reference Include="HybirdFrameworkCore">
<HintPath>..\Common\lib\HybirdFrameworkCore.dll</HintPath>
</Reference>
</ItemGroup>
</Project>

@ -1,482 +0,0 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v6.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v6.0": {
"HybirdFrameworkCore/1.0.0": {
"dependencies": {
"AutoMapper": "12.0.1",
"Autofac": "7.0.1",
"Microsoft.Extensions.Configuration.Abstractions": "7.0.0",
"Microsoft.Extensions.Configuration.Json": "7.0.0",
"Newtonsoft.Json": "13.0.3",
"StackExchange.Redis": "2.7.33",
"log4net": "2.0.15"
},
"runtime": {
"HybirdFrameworkCore.dll": {}
}
},
"Autofac/7.0.1": {
"dependencies": {
"System.Diagnostics.DiagnosticSource": "4.7.1"
},
"runtime": {
"lib/net6.0/Autofac.dll": {
"assemblyVersion": "7.0.1.0",
"fileVersion": "7.0.1.0"
}
}
},
"AutoMapper/12.0.1": {
"dependencies": {
"Microsoft.CSharp": "4.7.0"
},
"runtime": {
"lib/netstandard2.1/AutoMapper.dll": {
"assemblyVersion": "12.0.0.0",
"fileVersion": "12.0.1.0"
}
}
},
"log4net/2.0.15": {
"dependencies": {
"System.Configuration.ConfigurationManager": "4.5.0"
},
"runtime": {
"lib/netstandard2.0/log4net.dll": {
"assemblyVersion": "2.0.15.0",
"fileVersion": "2.0.15.0"
}
}
},
"Microsoft.CSharp/4.7.0": {},
"Microsoft.Extensions.Configuration/7.0.0": {
"dependencies": {
"Microsoft.Extensions.Configuration.Abstractions": "7.0.0",
"Microsoft.Extensions.Primitives": "7.0.0"
},
"runtime": {
"lib/net6.0/Microsoft.Extensions.Configuration.dll": {
"assemblyVersion": "7.0.0.0",
"fileVersion": "7.0.22.51805"
}
}
},
"Microsoft.Extensions.Configuration.Abstractions/7.0.0": {
"dependencies": {
"Microsoft.Extensions.Primitives": "7.0.0"
},
"runtime": {
"lib/net6.0/Microsoft.Extensions.Configuration.Abstractions.dll": {
"assemblyVersion": "7.0.0.0",
"fileVersion": "7.0.22.51805"
}
}
},
"Microsoft.Extensions.Configuration.FileExtensions/7.0.0": {
"dependencies": {
"Microsoft.Extensions.Configuration": "7.0.0",
"Microsoft.Extensions.Configuration.Abstractions": "7.0.0",
"Microsoft.Extensions.FileProviders.Abstractions": "7.0.0",
"Microsoft.Extensions.FileProviders.Physical": "7.0.0",
"Microsoft.Extensions.Primitives": "7.0.0"
},
"runtime": {
"lib/net6.0/Microsoft.Extensions.Configuration.FileExtensions.dll": {
"assemblyVersion": "7.0.0.0",
"fileVersion": "7.0.22.51805"
}
}
},
"Microsoft.Extensions.Configuration.Json/7.0.0": {
"dependencies": {
"Microsoft.Extensions.Configuration": "7.0.0",
"Microsoft.Extensions.Configuration.Abstractions": "7.0.0",
"Microsoft.Extensions.Configuration.FileExtensions": "7.0.0",
"Microsoft.Extensions.FileProviders.Abstractions": "7.0.0",
"System.Text.Json": "7.0.0"
},
"runtime": {
"lib/net6.0/Microsoft.Extensions.Configuration.Json.dll": {
"assemblyVersion": "7.0.0.0",
"fileVersion": "7.0.22.51805"
}
}
},
"Microsoft.Extensions.FileProviders.Abstractions/7.0.0": {
"dependencies": {
"Microsoft.Extensions.Primitives": "7.0.0"
},
"runtime": {
"lib/net6.0/Microsoft.Extensions.FileProviders.Abstractions.dll": {
"assemblyVersion": "7.0.0.0",
"fileVersion": "7.0.22.51805"
}
}
},
"Microsoft.Extensions.FileProviders.Physical/7.0.0": {
"dependencies": {
"Microsoft.Extensions.FileProviders.Abstractions": "7.0.0",
"Microsoft.Extensions.FileSystemGlobbing": "7.0.0",
"Microsoft.Extensions.Primitives": "7.0.0"
},
"runtime": {
"lib/net6.0/Microsoft.Extensions.FileProviders.Physical.dll": {
"assemblyVersion": "7.0.0.0",
"fileVersion": "7.0.22.51805"
}
}
},
"Microsoft.Extensions.FileSystemGlobbing/7.0.0": {
"runtime": {
"lib/net6.0/Microsoft.Extensions.FileSystemGlobbing.dll": {
"assemblyVersion": "7.0.0.0",
"fileVersion": "7.0.22.51805"
}
}
},
"Microsoft.Extensions.Logging.Abstractions/6.0.0": {
"runtime": {
"lib/net6.0/Microsoft.Extensions.Logging.Abstractions.dll": {
"assemblyVersion": "6.0.0.0",
"fileVersion": "6.0.21.52210"
}
}
},
"Microsoft.Extensions.Primitives/7.0.0": {
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
},
"runtime": {
"lib/net6.0/Microsoft.Extensions.Primitives.dll": {
"assemblyVersion": "7.0.0.0",
"fileVersion": "7.0.22.51805"
}
}
},
"Microsoft.NETCore.Platforms/2.0.0": {},
"Newtonsoft.Json/13.0.3": {
"runtime": {
"lib/net6.0/Newtonsoft.Json.dll": {
"assemblyVersion": "13.0.0.0",
"fileVersion": "13.0.3.27908"
}
}
},
"Pipelines.Sockets.Unofficial/2.2.8": {
"dependencies": {
"System.IO.Pipelines": "5.0.1"
},
"runtime": {
"lib/net5.0/Pipelines.Sockets.Unofficial.dll": {
"assemblyVersion": "1.0.0.0",
"fileVersion": "2.2.8.1080"
}
}
},
"StackExchange.Redis/2.7.33": {
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "6.0.0",
"Pipelines.Sockets.Unofficial": "2.2.8"
},
"runtime": {
"lib/net6.0/StackExchange.Redis.dll": {
"assemblyVersion": "2.0.0.0",
"fileVersion": "2.7.33.41805"
}
}
},
"System.Configuration.ConfigurationManager/4.5.0": {
"dependencies": {
"System.Security.Cryptography.ProtectedData": "4.5.0",
"System.Security.Permissions": "4.5.0"
},
"runtime": {
"lib/netstandard2.0/System.Configuration.ConfigurationManager.dll": {
"assemblyVersion": "4.0.1.0",
"fileVersion": "4.6.26515.6"
}
}
},
"System.Diagnostics.DiagnosticSource/4.7.1": {},
"System.IO.Pipelines/5.0.1": {
"runtime": {
"lib/netcoreapp3.0/System.IO.Pipelines.dll": {
"assemblyVersion": "5.0.0.1",
"fileVersion": "5.0.120.57516"
}
}
},
"System.Runtime.CompilerServices.Unsafe/6.0.0": {},
"System.Security.AccessControl/4.5.0": {
"dependencies": {
"Microsoft.NETCore.Platforms": "2.0.0",
"System.Security.Principal.Windows": "4.5.0"
}
},
"System.Security.Cryptography.ProtectedData/4.5.0": {
"runtime": {
"lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll": {
"assemblyVersion": "4.0.3.0",
"fileVersion": "4.6.26515.6"
}
},
"runtimeTargets": {
"runtimes/win/lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll": {
"rid": "win",
"assetType": "runtime",
"assemblyVersion": "4.0.3.0",
"fileVersion": "4.6.26515.6"
}
}
},
"System.Security.Permissions/4.5.0": {
"dependencies": {
"System.Security.AccessControl": "4.5.0"
},
"runtime": {
"lib/netstandard2.0/System.Security.Permissions.dll": {
"assemblyVersion": "4.0.1.0",
"fileVersion": "4.6.26515.6"
}
}
},
"System.Security.Principal.Windows/4.5.0": {
"dependencies": {
"Microsoft.NETCore.Platforms": "2.0.0"
}
},
"System.Text.Encodings.Web/7.0.0": {
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
},
"runtime": {
"lib/net6.0/System.Text.Encodings.Web.dll": {
"assemblyVersion": "7.0.0.0",
"fileVersion": "7.0.22.51805"
}
},
"runtimeTargets": {
"runtimes/browser/lib/net6.0/System.Text.Encodings.Web.dll": {
"rid": "browser",
"assetType": "runtime",
"assemblyVersion": "7.0.0.0",
"fileVersion": "7.0.22.51805"
}
}
},
"System.Text.Json/7.0.0": {
"dependencies": {
"System.Runtime.CompilerServices.Unsafe": "6.0.0",
"System.Text.Encodings.Web": "7.0.0"
},
"runtime": {
"lib/net6.0/System.Text.Json.dll": {
"assemblyVersion": "7.0.0.0",
"fileVersion": "7.0.22.51805"
}
}
}
}
},
"libraries": {
"HybirdFrameworkCore/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
},
"Autofac/7.0.1": {
"type": "package",
"serviceable": true,
"sha512": "sha512-J9Iz0Q+YU3uf82i8Lee0NpQOlRYfwHxwVV26jdG3zH3LFE5Y9Rx97Mju7Nswwzh/C7kVJALkTL860Y7e+mcLaw==",
"path": "autofac/7.0.1",
"hashPath": "autofac.7.0.1.nupkg.sha512"
},
"AutoMapper/12.0.1": {
"type": "package",
"serviceable": true,
"sha512": "sha512-hvV62vl6Hp/WfQ24yzo3Co9+OPl8wH8hApwVtgWpiAynVJkUcs7xvehnSftawL8Pe8FrPffBRM3hwzLQqWDNjA==",
"path": "automapper/12.0.1",
"hashPath": "automapper.12.0.1.nupkg.sha512"
},
"log4net/2.0.15": {
"type": "package",
"serviceable": true,
"sha512": "sha512-GahnO9ZgFka+xYcFwAfIFjW+k86P2nxFoaEpH6t3v4hiGj7tv2ksVZphxCVIHmJxoySS0HeU3dgCW+bSCcfD0A==",
"path": "log4net/2.0.15",
"hashPath": "log4net.2.0.15.nupkg.sha512"
},
"Microsoft.CSharp/4.7.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA==",
"path": "microsoft.csharp/4.7.0",
"hashPath": "microsoft.csharp.4.7.0.nupkg.sha512"
},
"Microsoft.Extensions.Configuration/7.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-tldQUBWt/xeH2K7/hMPPo5g8zuLc3Ro9I5d4o/XrxvxOCA2EZBtW7bCHHTc49fcBtvB8tLAb/Qsmfrq+2SJ4vA==",
"path": "microsoft.extensions.configuration/7.0.0",
"hashPath": "microsoft.extensions.configuration.7.0.0.nupkg.sha512"
},
"Microsoft.Extensions.Configuration.Abstractions/7.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-f34u2eaqIjNO9YLHBz8rozVZ+TcFiFs0F3r7nUJd7FRkVSxk8u4OpoK226mi49MwexHOR2ibP9MFvRUaLilcQQ==",
"path": "microsoft.extensions.configuration.abstractions/7.0.0",
"hashPath": "microsoft.extensions.configuration.abstractions.7.0.0.nupkg.sha512"
},
"Microsoft.Extensions.Configuration.FileExtensions/7.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-xk2lRJ1RDuqe57BmgvRPyCt6zyePKUmvT6iuXqiHR+/OIIgWVR8Ff5k2p6DwmqY8a17hx/OnrekEhziEIeQP6Q==",
"path": "microsoft.extensions.configuration.fileextensions/7.0.0",
"hashPath": "microsoft.extensions.configuration.fileextensions.7.0.0.nupkg.sha512"
},
"Microsoft.Extensions.Configuration.Json/7.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-LDNYe3uw76W35Jci+be4LDf2lkQZe0A7EEYQVChFbc509CpZ4Iupod8li4PUXPBhEUOFI/rlQNf5xkzJRQGvtA==",
"path": "microsoft.extensions.configuration.json/7.0.0",
"hashPath": "microsoft.extensions.configuration.json.7.0.0.nupkg.sha512"
},
"Microsoft.Extensions.FileProviders.Abstractions/7.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-NyawiW9ZT/liQb34k9YqBSNPLuuPkrjMgQZ24Y/xXX1RoiBkLUdPMaQTmxhZ5TYu8ZKZ9qayzil75JX95vGQUg==",
"path": "microsoft.extensions.fileproviders.abstractions/7.0.0",
"hashPath": "microsoft.extensions.fileproviders.abstractions.7.0.0.nupkg.sha512"
},
"Microsoft.Extensions.FileProviders.Physical/7.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-K8D2MTR+EtzkbZ8z80LrG7Ur64R7ZZdRLt1J5cgpc/pUWl0C6IkAUapPuK28oionHueCPELUqq0oYEvZfalNdg==",
"path": "microsoft.extensions.fileproviders.physical/7.0.0",
"hashPath": "microsoft.extensions.fileproviders.physical.7.0.0.nupkg.sha512"
},
"Microsoft.Extensions.FileSystemGlobbing/7.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-2jONjKHiF+E92ynz2ZFcr9OvxIw+rTGMPEH+UZGeHTEComVav93jQUWGkso8yWwVBcEJGcNcZAaqY01FFJcj7w==",
"path": "microsoft.extensions.filesystemglobbing/7.0.0",
"hashPath": "microsoft.extensions.filesystemglobbing.7.0.0.nupkg.sha512"
},
"Microsoft.Extensions.Logging.Abstractions/6.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-/HggWBbTwy8TgebGSX5DBZ24ndhzi93sHUBDvP1IxbZD7FDokYzdAr6+vbWGjw2XAfR2EJ1sfKUotpjHnFWPxA==",
"path": "microsoft.extensions.logging.abstractions/6.0.0",
"hashPath": "microsoft.extensions.logging.abstractions.6.0.0.nupkg.sha512"
},
"Microsoft.Extensions.Primitives/7.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-um1KU5kxcRp3CNuI8o/GrZtD4AIOXDk+RLsytjZ9QPok3ttLUelLKpilVPuaFT3TFjOhSibUAso0odbOaCDj3Q==",
"path": "microsoft.extensions.primitives/7.0.0",
"hashPath": "microsoft.extensions.primitives.7.0.0.nupkg.sha512"
},
"Microsoft.NETCore.Platforms/2.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-VdLJOCXhZaEMY7Hm2GKiULmn7IEPFE4XC5LPSfBVCUIA8YLZVh846gtfBJalsPQF2PlzdD7ecX7DZEulJ402ZQ==",
"path": "microsoft.netcore.platforms/2.0.0",
"hashPath": "microsoft.netcore.platforms.2.0.0.nupkg.sha512"
},
"Newtonsoft.Json/13.0.3": {
"type": "package",
"serviceable": true,
"sha512": "sha512-HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==",
"path": "newtonsoft.json/13.0.3",
"hashPath": "newtonsoft.json.13.0.3.nupkg.sha512"
},
"Pipelines.Sockets.Unofficial/2.2.8": {
"type": "package",
"serviceable": true,
"sha512": "sha512-zG2FApP5zxSx6OcdJQLbZDk2AVlN2BNQD6MorwIfV6gVj0RRxWPEp2LXAxqDGZqeNV1Zp0BNPcNaey/GXmTdvQ==",
"path": "pipelines.sockets.unofficial/2.2.8",
"hashPath": "pipelines.sockets.unofficial.2.2.8.nupkg.sha512"
},
"StackExchange.Redis/2.7.33": {
"type": "package",
"serviceable": true,
"sha512": "sha512-2kCX5fvhEE824a4Ab5Imyi8DRuGuTxyklXV01kegkRpsWJcPmO6+GAQ+HegKxvXAxlXZ8yaRspvWJ8t3mMClfQ==",
"path": "stackexchange.redis/2.7.33",
"hashPath": "stackexchange.redis.2.7.33.nupkg.sha512"
},
"System.Configuration.ConfigurationManager/4.5.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-UIFvaFfuKhLr9u5tWMxmVoDPkFeD+Qv8gUuap4aZgVGYSYMdERck4OhLN/2gulAc0nYTEigWXSJNNWshrmxnng==",
"path": "system.configuration.configurationmanager/4.5.0",
"hashPath": "system.configuration.configurationmanager.4.5.0.nupkg.sha512"
},
"System.Diagnostics.DiagnosticSource/4.7.1": {
"type": "package",
"serviceable": true,
"sha512": "sha512-j81Lovt90PDAq8kLpaJfJKV/rWdWuEk6jfV+MBkee33vzYLEUsy4gXK8laa9V2nZlLM9VM9yA/OOQxxPEJKAMw==",
"path": "system.diagnostics.diagnosticsource/4.7.1",
"hashPath": "system.diagnostics.diagnosticsource.4.7.1.nupkg.sha512"
},
"System.IO.Pipelines/5.0.1": {
"type": "package",
"serviceable": true,
"sha512": "sha512-qEePWsaq9LoEEIqhbGe6D5J8c9IqQOUuTzzV6wn1POlfdLkJliZY3OlB0j0f17uMWlqZYjH7txj+2YbyrIA8Yg==",
"path": "system.io.pipelines/5.0.1",
"hashPath": "system.io.pipelines.5.0.1.nupkg.sha512"
},
"System.Runtime.CompilerServices.Unsafe/6.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==",
"path": "system.runtime.compilerservices.unsafe/6.0.0",
"hashPath": "system.runtime.compilerservices.unsafe.6.0.0.nupkg.sha512"
},
"System.Security.AccessControl/4.5.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-vW8Eoq0TMyz5vAG/6ce483x/CP83fgm4SJe5P8Tb1tZaobcvPrbMEL7rhH1DRdrYbbb6F0vq3OlzmK0Pkwks5A==",
"path": "system.security.accesscontrol/4.5.0",
"hashPath": "system.security.accesscontrol.4.5.0.nupkg.sha512"
},
"System.Security.Cryptography.ProtectedData/4.5.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-wLBKzFnDCxP12VL9ANydSYhk59fC4cvOr9ypYQLPnAj48NQIhqnjdD2yhP8yEKyBJEjERWS9DisKL7rX5eU25Q==",
"path": "system.security.cryptography.protecteddata/4.5.0",
"hashPath": "system.security.cryptography.protecteddata.4.5.0.nupkg.sha512"
},
"System.Security.Permissions/4.5.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-9gdyuARhUR7H+p5CjyUB/zPk7/Xut3wUSP8NJQB6iZr8L3XUXTMdoLeVAg9N4rqF8oIpE7MpdqHdDHQ7XgJe0g==",
"path": "system.security.permissions/4.5.0",
"hashPath": "system.security.permissions.4.5.0.nupkg.sha512"
},
"System.Security.Principal.Windows/4.5.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-U77HfRXlZlOeIXd//Yoj6Jnk8AXlbeisf1oq1os+hxOGVnuG+lGSfGqTwTZBoORFF6j/0q7HXIl8cqwQ9aUGqQ==",
"path": "system.security.principal.windows/4.5.0",
"hashPath": "system.security.principal.windows.4.5.0.nupkg.sha512"
},
"System.Text.Encodings.Web/7.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-OP6umVGxc0Z0MvZQBVigj4/U31Pw72ITihDWP9WiWDm+q5aoe0GaJivsfYGq53o6dxH7DcXWiCTl7+0o2CGdmg==",
"path": "system.text.encodings.web/7.0.0",
"hashPath": "system.text.encodings.web.7.0.0.nupkg.sha512"
},
"System.Text.Json/7.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-DaGSsVqKsn/ia6RG8frjwmJonfos0srquhw09TlT8KRw5I43E+4gs+/bZj4K0vShJ5H9imCuXupb4RmS+dBy3w==",
"path": "system.text.json/7.0.0",
"hashPath": "system.text.json.7.0.0.nupkg.sha512"
}
}
}

@ -1,8 +0,0 @@
// <auto-generated/>
global using global::System;
global using global::System.Collections.Generic;
global using global::System.IO;
global using global::System.Linq;
global using global::System.Net.Http;
global using global::System.Threading;
global using global::System.Threading.Tasks;

@ -1,9 +1,7 @@
using System.Reflection;
using Common.Const;
using Entity.Base;
using Entity.Dto.Req;
using Mapster;
using MapsterMapper;
using HybirdFrameworkCore.Entity;
using SqlSugar;
namespace Repository
@ -33,8 +31,9 @@ namespace Repository
{
return db.Updateable(entity).AS().ReSetValue(x => { x.IsDelete = true; })
.IgnoreColumns(ignoreAllNullColumns: true)
.EnableDiffLogEvent() // 记录差异日志
.UpdateColumns(x => new { x.IsDelete, x.UpdateTime, x.UpdateUserId }) // 允许更新的字段-AOP拦截自动设置UpdateTime、UpdateUserId
.EnableDiffLogEvent() // 记录差异日志
.UpdateColumns(x => new
{ x.IsDelete, x.UpdateTime, x.UpdateUserId }) // 允许更新的字段-AOP拦截自动设置UpdateTime、UpdateUserId
.ExecuteCommand();
}
@ -61,8 +60,9 @@ namespace Repository
{
return db.Updateable(entity).AS().ReSetValue(x => { x.IsDelete = true; })
.IgnoreColumns(ignoreAllNullColumns: true)
.EnableDiffLogEvent() // 记录差异日志
.UpdateColumns(x => new { x.IsDelete, x.UpdateTime, x.UpdateUserId }) // 允许更新的字段-AOP拦截自动设置UpdateTime、UpdateUserId
.EnableDiffLogEvent() // 记录差异日志
.UpdateColumns(x => new
{ x.IsDelete, x.UpdateTime, x.UpdateUserId }) // 允许更新的字段-AOP拦截自动设置UpdateTime、UpdateUserId
.ExecuteCommand();
}
@ -73,7 +73,8 @@ namespace Repository
/// <param name="repository"></param>
/// <param name="entity"></param>
/// <returns></returns>
public static Task<int> FakeDeleteAsync<T>(this ISugarRepository repository, T entity) where T : EntityBase, new()
public static Task<int> FakeDeleteAsync<T>(this ISugarRepository repository, T entity)
where T : EntityBase, new()
{
return repository.Context.FakeDeleteAsync(entity);
}
@ -89,8 +90,9 @@ namespace Repository
{
return db.Updateable(entity).AS().ReSetValue(x => { x.IsDelete = true; })
.IgnoreColumns(ignoreAllNullColumns: true)
.EnableDiffLogEvent() // 记录差异日志
.UpdateColumns(x => new { x.IsDelete, x.UpdateTime, x.UpdateUserId }) // 允许更新的字段-AOP拦截自动设置UpdateTime、UpdateUserId
.EnableDiffLogEvent() // 记录差异日志
.UpdateColumns(x => new
{ x.IsDelete, x.UpdateTime, x.UpdateUserId }) // 允许更新的字段-AOP拦截自动设置UpdateTime、UpdateUserId
.ExecuteCommandAsync();
}
@ -101,7 +103,8 @@ namespace Repository
/// <param name="repository"></param>
/// <param name="entity"></param>
/// <returns></returns>
public static Task<int> FakeDeleteAsync<T>(this ISugarRepository repository, List<T> entity) where T : EntityBase, new()
public static Task<int> FakeDeleteAsync<T>(this ISugarRepository repository, List<T> entity)
where T : EntityBase, new()
{
return repository.Context.FakeDeleteAsync(entity);
}
@ -117,8 +120,9 @@ namespace Repository
{
return db.Updateable(entity).AS().ReSetValue(x => { x.IsDelete = true; })
.IgnoreColumns(ignoreAllNullColumns: true)
.EnableDiffLogEvent() // 记录差异日志
.UpdateColumns(x => new { x.IsDelete, x.UpdateTime, x.UpdateUserId }) // 允许更新的字段-AOP拦截自动设置UpdateTime、UpdateUserId
.EnableDiffLogEvent() // 记录差异日志
.UpdateColumns(x => new
{ x.IsDelete, x.UpdateTime, x.UpdateUserId }) // 允许更新的字段-AOP拦截自动设置UpdateTime、UpdateUserId
.ExecuteCommandAsync();
}
@ -131,23 +135,14 @@ namespace Repository
/// <param name="defaultSortField"> 默认排序字段 </param>
/// <param name="descSort"> 是否降序 </param>
/// <returns> </returns>
public static ISugarQueryable<T> OrderBuilder<T>(this ISugarQueryable<T> queryable, BasePageReq pageInput, string prefix = "", string defaultSortField = "Id", bool descSort = true)
public static ISugarQueryable<T> OrderBuilder<T>(this ISugarQueryable<T> queryable, QueryPageModel pageInput,
string prefix = "", string defaultSortField = "Id", bool descSort = true)
{
// 约定默认每张表都有Id排序
var orderStr = string.IsNullOrWhiteSpace(defaultSortField) ? "" : $"{prefix}{defaultSortField}" + (descSort ? " Desc" : " Asc");
TypeAdapterConfig typeAdapterConfig = new();
typeAdapterConfig.ForType<T, BasePageReq>().IgnoreNullValues(true);
Mapper mapper = new(typeAdapterConfig); // 务必将mapper设为单实例
var nowPagerInput = mapper.Map<BasePageReq>(pageInput);
// 排序是否可用-排序字段和排序顺序都为非空才启用排序
if (!string.IsNullOrEmpty(nowPagerInput.Field) && !string.IsNullOrEmpty(nowPagerInput.OrderDirection))
{
var col = queryable.Context.EntityMaintenance.GetEntityInfo<T>().Columns.FirstOrDefault(u => u.PropertyName.Equals(nowPagerInput.Field, StringComparison.CurrentCultureIgnoreCase));
orderStr = col != null
? $"{prefix}{col.DbColumnName} {(nowPagerInput.OrderDirection == nowPagerInput.DescStr ? "Desc" : "Asc")}"
: $"{prefix}{nowPagerInput.Field} {(nowPagerInput.OrderDirection == nowPagerInput.DescStr ? "Desc" : "Asc")}";
}
var orderStr = string.IsNullOrWhiteSpace(defaultSortField)
? ""
: $"{prefix}{defaultSortField}" + (descSort ? " Desc" : " Asc");
return queryable.OrderByIF(!string.IsNullOrWhiteSpace(orderStr), orderStr);
}
@ -159,7 +154,8 @@ namespace Repository
/// <param name="entity"></param>
/// <param name="ignoreAllNullColumns"></param>
/// <returns></returns>
public static int UpdateWithDiffLog<T>(this ISugarRepository repository, T entity, bool ignoreAllNullColumns = true) where T : EntityBase, new()
public static int UpdateWithDiffLog<T>(this ISugarRepository repository, T entity,
bool ignoreAllNullColumns = true) where T : EntityBase, new()
{
return repository.Context.UpdateWithDiffLog(entity, ignoreAllNullColumns);
}
@ -172,7 +168,8 @@ namespace Repository
/// <param name="entity"></param>
/// <param name="ignoreAllNullColumns"></param>
/// <returns></returns>
public static int UpdateWithDiffLog<T>(this ISqlSugarClient db, T entity, bool ignoreAllNullColumns = true) where T : EntityBase, new()
public static int UpdateWithDiffLog<T>(this ISqlSugarClient db, T entity, bool ignoreAllNullColumns = true)
where T : EntityBase, new()
{
return db.Updateable(entity).AS()
.IgnoreColumns(ignoreAllNullColumns: ignoreAllNullColumns)
@ -188,7 +185,8 @@ namespace Repository
/// <param name="entity"></param>
/// <param name="ignoreAllNullColumns"></param>
/// <returns></returns>
public static Task<int> UpdateWithDiffLogAsync<T>(this ISugarRepository repository, T entity, bool ignoreAllNullColumns = true) where T : EntityBase, new()
public static Task<int> UpdateWithDiffLogAsync<T>(this ISugarRepository repository, T entity,
bool ignoreAllNullColumns = true) where T : EntityBase, new()
{
return repository.Context.UpdateWithDiffLogAsync(entity, ignoreAllNullColumns);
}
@ -201,7 +199,8 @@ namespace Repository
/// <param name="entity"></param>
/// <param name="ignoreAllNullColumns"></param>
/// <returns></returns>
public static Task<int> UpdateWithDiffLogAsync<T>(this ISqlSugarClient db, T entity, bool ignoreAllNullColumns = true) where T : EntityBase, new()
public static Task<int> UpdateWithDiffLogAsync<T>(this ISqlSugarClient db, T entity,
bool ignoreAllNullColumns = true) where T : EntityBase, new()
{
return db.Updateable(entity)
.IgnoreColumns(ignoreAllNullColumns: ignoreAllNullColumns)
@ -240,7 +239,8 @@ namespace Repository
/// <param name="repository"></param>
/// <param name="entity"></param>
/// <returns></returns>
public static Task<int> InsertWithDiffLogAsync<T>(this ISugarRepository repository, T entity) where T : EntityBase, new()
public static Task<int> InsertWithDiffLogAsync<T>(this ISugarRepository repository, T entity)
where T : EntityBase, new()
{
return repository.Context.InsertWithDiffLogAsync(entity);
}
@ -379,7 +379,8 @@ namespace Repository
/// <param name="isWhere"></param>
/// <param name="whereExpression"></param>
/// <returns></returns>
public static List<T> WhereIF<T>(this T thisValue, bool isWhere, Func<T, bool> whereExpression) where T : class, new()
public static List<T> WhereIF<T>(this T thisValue, bool isWhere, Func<T, bool> whereExpression)
where T : class, new()
{
return new List<T>() { thisValue };
}
@ -391,7 +392,8 @@ namespace Repository
/// <typeparam name="R"></typeparam>
/// <param name="updateable"></param>
/// <returns></returns>
public static IUpdateable<T> OnlyUpdateColumn<T, R>(this IUpdateable<T> updateable) where T : EntityBase, new() where R : class, new()
public static IUpdateable<T> OnlyUpdateColumn<T, R>(this IUpdateable<T> updateable)
where T : EntityBase, new() where R : class, new()
{
if (updateable.UpdateBuilder.UpdateColumns == null)
updateable.UpdateBuilder.UpdateColumns = new List<string>();
@ -402,7 +404,8 @@ namespace Repository
if (typeof(T).GetProperty(info.Name) != null)
updateable.UpdateBuilder.UpdateColumns.Add(info.Name);
}
return updateable;
}
}
}
}

@ -25,15 +25,21 @@ public class EquipInfoService : BaseServices<EquipInfo>
/// </summary>
/// <param name="input">查询参数</param>
/// <returns>分页列表</returns>
public async Task<SqlSugarPagedList<EquipInfo>> Page(PageEquipInfoReq input)
public async Task<PageResult<EquipInfo>> Page(PageEquipInfoReq input)
{
RefAsync<int> total = 0;
var items = await _equipInfoRepository.EquipInfoQueryPageAsync(
!string.IsNullOrEmpty(input.Name), u => u.Name.Contains(input.Name),
!string.IsNullOrEmpty(input.Code), u => u.Code.Contains(input.Code),
input.Status != null, (u => input.Status != null && u.Status.Equals(input.Status.Value)),
input.Page, input.PageSize, total, input);
return SqlSugarPagedExtensions.CreateSqlSugarPagedList(items, total, input.Page, input.PageSize);
input.PageNum, input.PageSize, total, input);
return new PageResult<EquipInfo>()
{
PageNum = input.PageNum,
PageSize = input.PageSize,
ToTal = total,
Rows = items,
};
}
/// <summary>

@ -9,6 +9,7 @@ using Entity.DbModel.System;
using Entity.Dto.Req;
using HybirdFrameworkCore.Autofac;
using HybirdFrameworkCore.Autofac.Attribute;
using HybirdFrameworkCore.Entity;
using HybirdFrameworkCore.Redis;
using Mapster;
using Microsoft.AspNetCore.Http;
@ -38,15 +39,21 @@ namespace Service.System
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public async Task<SqlSugarPagedList<SysConfig>> Page(PageConfigReq input)
public async Task<PageResult<SysConfig>> Page(PageConfigReq input)
{
RefAsync<int> total = 0;
var items = await _sysConfigRep.SysConfigQueryPageAsync(
!string.IsNullOrEmpty(input.Name), u => u.Name.Contains(input.Name),
!string.IsNullOrEmpty(input.Code), u => u.Code.Contains(input.Code),
!string.IsNullOrEmpty(input.GroupCode), u => u.GroupCode.Equals(input.GroupCode),
input.Page, input.PageSize, total, input);
return SqlSugarPagedExtensions.CreateSqlSugarPagedList(items, total, input.Page, input.PageSize);
input.PageNum, input.PageSize, total, input);
return new PageResult<SysConfig>()
{
PageNum = input.PageNum,
PageSize = input.PageSize,
ToTal = total,
Rows = items,
};
}
/// <summary>

@ -27,7 +27,7 @@ public class EquipInfoController
/// <returns>充电模式分页列表</returns>
[HttpPost]
[Route("/api/equipInfo/page")]
public async Task<SqlSugarPagedList<EquipInfo>> Page(PageEquipInfoReq input)
public async Task<PageResult<EquipInfo>> Page(PageEquipInfoReq input)
{
return await _equipInfoService.Page(input);
}

@ -2,6 +2,7 @@
using Entity.Base;
using Entity.DbModel.System;
using Entity.Dto.Req;
using HybirdFrameworkCore.Entity;
using Microsoft.AspNetCore.Mvc;
using Service.System;
@ -19,7 +20,7 @@ namespace WebStarter.Controllers.System
[HttpPost]
[Route("/api/sysConfig/page")]
public async Task<SqlSugarPagedList<SysConfig>> Page(PageConfigReq input)
public async Task<PageResult<SysConfig>> Page(PageConfigReq input)
{
return await _sysConfigService.Page(input);
}

@ -1,32 +1,179 @@
<?xml version="1.0" encoding="utf-8"?>
<log4net>
<!-- 控制台日志配置 -->
<appender name="Console" type="log4net.Appender.ConsoleAppender">
<!-- 日志输出格式 -->
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %5level [%thread] (%file:%line) - %message%newline"/>
<conversionPattern value="%date %5level [%thread] (%file:%line) - %message%newline" />
</layout>
</appender>
<!-- 文件存储日志配置 -->
<appender name="RollingFile" type="log4net.Appender.RollingFileAppender">
<!-- 保存文件的名称 -->
<file value="logs\WebApi.log"/>
<appendToFile value="true"/>
<file value="logs\WebApi.log" />
<appendToFile value="true" />
<!-- 文件的编码方式 -->
<param name="Encoding" value="UTF-8"/>
<param name="Encoding" value="UTF-8" />
<!-- 每个文件的大小 -->
<maximumFileSize value="100MB"/>
<maximumFileSize value="100MB" />
<!-- 保存文件数量 -->
<maxSizeRollBackups value="2"/>
<lockingModel type="log4net.Appender.FileAppender+MinimalLock"/>
<maxSizeRollBackups value="2" />
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
<!-- 日志输出格式 -->
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %level %thread %logger - %message%newline"/>
<conversionPattern value="%date %level %thread %logger - %message%newline" />
</layout>
</appender>
<logger name="Charger1" additivity="false">
<level value="ALL" />
<appender-ref ref="Charger1" />
</logger>
<appender name="Charger1" type="log4net.Appender.RollingFileAppender">
<param name="File" value="logs\Charger\" />
<param name="AppendToFile" value="true" />
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
<Encoding value="UTF-8" />
<param name="StaticLogFileName" value="false" />
<param name="RollingStyle" value="Composite" />
<param name="DatePattern" value="yyyyMMdd/HH&quot;Charger1.log&quot;" />
<param name="maximumFileSize" value="200MB" />
<param name="MaxSizeRollBackups" value="5" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %level %thread %logger - %message%newline" />
</layout>
</appender>
<logger name="Charger2" additivity="false">
<level value="ALL" />
<appender-ref ref="Charger2" />
</logger>
<appender name="Charger2" type="log4net.Appender.RollingFileAppender">
<param name="File" value="logs\Charger\" />
<param name="AppendToFile" value="true" />
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
<Encoding value="UTF-8" />
<param name="StaticLogFileName" value="false" />
<param name="RollingStyle" value="Composite" />
<param name="DatePattern" value="yyyyMMdd/HH&quot;Charger2.log&quot;" />
<param name="maximumFileSize" value="200MB" />
<param name="MaxSizeRollBackups" value="5" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %level %thread %logger - %message%newline" />
</layout>
</appender>
<logger name="Charger3" additivity="false">
<level value="ALL" />
<appender-ref ref="Charger3" />
</logger>
<appender name="Charger3" type="log4net.Appender.RollingFileAppender">
<param name="File" value="logs\Charger\" />
<param name="AppendToFile" value="true" />
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
<Encoding value="UTF-8" />
<param name="StaticLogFileName" value="false" />
<param name="RollingStyle" value="Composite" />
<param name="DatePattern" value="yyyyMMdd/HH&quot;Charger3.log&quot;" />
<param name="maximumFileSize" value="200MB" />
<param name="MaxSizeRollBackups" value="5" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %level %thread %logger - %message%newline" />
</layout>
</appender>
<logger name="Charger4" additivity="false">
<level value="ALL" />
<appender-ref ref="Charger4" />
</logger>
<appender name="Charger4" type="log4net.Appender.RollingFileAppender">
<param name="File" value="logs\Charger\" />
<param name="AppendToFile" value="true" />
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
<Encoding value="UTF-8" />
<param name="StaticLogFileName" value="false" />
<param name="RollingStyle" value="Composite" />
<param name="DatePattern" value="yyyyMMdd/HH&quot;Charger4.log&quot;" />
<param name="maximumFileSize" value="200MB" />
<param name="MaxSizeRollBackups" value="5" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %level %thread %logger - %message%newline" />
</layout>
</appender>
<logger name="Charger5" additivity="false">
<level value="ALL" />
<appender-ref ref="Charger5" />
</logger>
<appender name="Charger5" type="log4net.Appender.RollingFileAppender">
<param name="File" value="logs\Charger\" />
<param name="AppendToFile" value="true" />
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
<Encoding value="UTF-8" />
<param name="StaticLogFileName" value="false" />
<param name="RollingStyle" value="Composite" />
<param name="DatePattern" value="yyyyMMdd/HH&quot;Charger5.log&quot;" />
<param name="maximumFileSize" value="200MB" />
<param name="MaxSizeRollBackups" value="5" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %level %thread %logger - %message%newline" />
</layout>
</appender>
<logger name="Charger6" additivity="false">
<level value="ALL" />
<appender-ref ref="Charger6" />
</logger>
<appender name="Charger6" type="log4net.Appender.RollingFileAppender">
<param name="File" value="logs\Charger\" />
<param name="AppendToFile" value="true" />
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
<Encoding value="UTF-8" />
<param name="StaticLogFileName" value="false" />
<param name="RollingStyle" value="Composite" />
<param name="DatePattern" value="yyyyMMdd/HH&quot;Charger6.log&quot;" />
<param name="maximumFileSize" value="200MB" />
<param name="MaxSizeRollBackups" value="5" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %level %thread %logger - %message%newline" />
</layout>
</appender>
<logger name="Charger7" additivity="false">
<level value="ALL" />
<appender-ref ref="Charger7" />
</logger>
<appender name="Charger7" type="log4net.Appender.RollingFileAppender">
<param name="File" value="logs\Charger\" />
<param name="AppendToFile" value="true" />
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
<Encoding value="UTF-8" />
<param name="StaticLogFileName" value="false" />
<param name="RollingStyle" value="Composite" />
<param name="DatePattern" value="yyyyMMdd/HH&quot;Charger7.log&quot;" />
<param name="maximumFileSize" value="200MB" />
<param name="MaxSizeRollBackups" value="5" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %level %thread %logger - %message%newline" />
</layout>
</appender>
<logger name="Charger8" additivity="false">
<level value="ALL" />
<appender-ref ref="Charger8" />
</logger>
<appender name="Charger8" type="log4net.Appender.RollingFileAppender">
<param name="File" value="logs\Charger\" />
<param name="AppendToFile" value="true" />
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
<Encoding value="UTF-8" />
<param name="StaticLogFileName" value="false" />
<param name="RollingStyle" value="Composite" />
<param name="DatePattern" value="yyyyMMdd/HH&quot;Charger8.log&quot;" />
<param name="maximumFileSize" value="200MB" />
<param name="MaxSizeRollBackups" value="5" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %level %thread %logger - %message%newline" />
</layout>
</appender>
<root>
<level value="ALL"/>
<appender-ref ref="Console"/>
<appender-ref ref="RollingFile"/>
<level value="ALL" />
<appender-ref ref="Console" />
<appender-ref ref="RollingFile" />
</root>
</log4net>
</log4net>

Loading…
Cancel
Save