RuoVea.ExDto 5.0.16.4

There is a newer version of this package available.
See the version list below for details.
dotnet add package RuoVea.ExDto --version 5.0.16.4
                    
NuGet\Install-Package RuoVea.ExDto -Version 5.0.16.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RuoVea.ExDto" Version="5.0.16.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RuoVea.ExDto" Version="5.0.16.4" />
                    
Directory.Packages.props
<PackageReference Include="RuoVea.ExDto" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add RuoVea.ExDto --version 5.0.16.4
                    
#r "nuget: RuoVea.ExDto, 5.0.16.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package RuoVea.ExDto@5.0.16.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=RuoVea.ExDto&version=5.0.16.4
                    
Install as a Cake Addin
#tool nuget:?package=RuoVea.ExDto&version=5.0.16.4
                    
Install as a Cake Tool

📋 RuoVea.ExDto 组件概览

RuoVea.ExDto 是一个包含常用常量、接口、实体模型和枚举的基础类库,为系统提供统一的数据传输对象和基础架构。

🏗️ 组件架构

1. 常量定义 (ClaimConst)

用户登录基本信息常量:

// 用户身份信息
CLAINM_USERID       // 用户Id
CLAINM_ACCOUNT      // 账号
CLAINM_NAME         // 名称
CLAINM_ROLEIDS      // 角色Id列表
CLAINM_ISADMIN      // 是否管理员
CLAINM_SUPERADMIN   // 是否超级管理员
TENANT_ID           // 租户Id

// 用户详细信息
RealName            // 真实姓名
NickName            // 昵称
AccountType         // 账号类型
OrgId               // 组织机构Id
OrgName             // 组织机构名称
OpenId              // 微信OpenId
LoginMode           // 登录模式(PC/APP)

2. 实体接口基类体系

🔗 接口继承关系
IDataEntity
├── IAuditableEntity    (审计信息)
├── IDeletedEntity      (逻辑删除)
└── IPrimaryKeyEntity   (主键标识)
📝 详细接口定义

IAuditableEntity - 审计实体接口

public interface IAuditableEntity
{
    DateTime? CreateTime { get; set; }    // 创建时间
    long? Creator { get; set; }           // 创建人ID
    DateTime? ModifyTime { get; set; }    // 修改时间
    long? Modifier { get; set; }          // 修改人ID
}

IDeletedEntity - 逻辑删除接口

public interface IDeletedEntity
{
    IsDelete? IsDelete { get; set; }      // 逻辑删除状态
}

IPrimaryKeyEntity - 主键实体接口

public interface IPrimaryKeyEntity
{
    long Id { get; set; }                 // 主键ID
}

IDataEntity - 完整数据实体接口

public interface IDataEntity : IAuditableEntity, IDeletedEntity, IPrimaryKeyEntity
{
    // 继承所有审计、删除、主键功能
}

ITenantEntity - 租户实体接口

public interface ITenantEntity
{
    long? TenantId { get; set; }          // 租户ID
}

3. 枚举类型系统

🔢 系统管理枚举

AdminType - 账号类型

// 定义不同的账号角色类型

BusinessType - 业务枚举

// 各种业务类型分类

CategoryEnum - 账号类别

// 账号分类枚举

CodeStatus - HTTP状态码

// 标准化HTTP状态码定义

DataOpType - 数据操作类型

// 增删改查等数据操作类型

DataScopeType - 数据范围

// 数据权限范围定义
⚠️ 错误状态枚举

ErrorEnum - 系统错误码

// 统一错误代码定义
// 示例:
// SUCCESS = 0,
// PARAM_ERROR = 1001,
// AUTH_FAILED = 2001,
// SYSTEM_ERROR = 5001
👥 基础数据枚举

Gender - 性别

// 男、女、未知等

IsDelete - 逻辑删除状态

// 示例:
// NotDeleted = 0,    // 未删除
// Deleted = 1        // 已删除

LoginType - 登陆类型

// 密码登录、短信登录、微信登录等

MenuType - 系统菜单类型

// 目录、菜单、按钮等
🔍 查询相关枚举

QueryTypeEnum - 查询类型

// 精确查询、模糊查询、范围查询等

RequestTypeEnum - HTTP请求类型

// GET、POST、PUT、DELETE等

SordEnum - 排序枚举

// 升序(ASC)、降序(DESC)
🏢 系统状态枚举

StatusEnum - 公共状态

// 启用、禁用、待审核等

TenantTypeEnum - 租户类型

// 平台租户、企业租户、个人租户等

YesOrNot - 是/否布尔枚举

// Yes = 1, No = 0

4. 核心接口定义

👤 用户上下文接口

ICurrentUser - 基础用户上下文

public interface ICurrentUser
{
    long UserId { get; }                  // 用户ID
    string Account { get; }               // 账号
    string Name { get; }                  // 姓名
    bool IsAdmin { get; }                 // 是否管理员
    bool IsSuperAdmin { get; }            // 是否超级管理员
    long? TenantId { get; }               // 租户ID
    // 其他用户信息获取方法...
}

ICurrentUser<TT> - 泛型用户上下文

public interface ICurrentUser<TT> : ICurrentUser
{
    // 支持特定类型的扩展用户信息
}
📦 统一返回接口

IRESTfulResult - RESTful结果接口

public interface IRESTfulResult
{
    int Code { get; set; }                // 状态码
    string Message { get; set; }          // 消息
    bool Success { get; }                 // 是否成功
}

5. 数据模型实体

📄 分页参数模型

PageParam - 基础分页参数

public class PageParam
{
    public int PageIndex { get; set; }    // 页码
    public int PageSize { get; set; }     // 页大小
    public string SortField { get; set; } // 排序字段
    public string SortOrder { get; set; } // 排序方式
}

PageParam<T> - 泛型分页参数

public class PageParam<T> : PageParam
{
    public T Search { get; set; }         // 查询条件
}

Pagination - 分页参数(备用)

// 提供另一种分页参数实现
📊 分页返回模型

PageResult<T> - 分页返回结果

public class PageResult<T>
{
    public int TotalCount { get; set; }   // 总记录数
    public List<T> Data { get; set; }     // 数据列表
    public int PageIndex { get; set; }    // 当前页码
    public int PageSize { get; set; }     // 页大小
    public int TotalPages { get; }        // 总页数(计算属性)
}
✅ 统一响应模型

RestfulResult - 基础RESTful响应

public class RestfulResult : IRESTfulResult
{
    public int Code { get; set; }         // 状态码
    public string Message { get; set; }   // 消息
    public bool Success => Code == 0;     // 成功状态
    public DateTime Timestamp { get; set; } = DateTime.Now; // 时间戳
}

RestfulResult<T> - 泛型RESTful响应

public class RestfulResult<T> : RestfulResult
{
    public T Data { get; set; }           // 响应数据
}

🚀 使用示例

1. 实体类实现

public class User : IDataEntity, ITenantEntity
{
    // IPrimaryKeyEntity
    public long Id { get; set; }
    
    // IAuditableEntity
    public DateTime? CreateTime { get; set; }
    public long? Creator { get; set; }
    public DateTime? ModifyTime { get; set; }
    public long? Modifier { get; set; }
    
    // IDeletedEntity
    public IsDelete? IsDelete { get; set; }
    
    // ITenantEntity
    public long? TenantId { get; set; }
    
    // 业务字段
    public string Name { get; set; }
    public string Account { get; set; }
    public Gender Gender { get; set; }
    public StatusEnum Status { get; set; }
}

2. 服务层使用

public class UserService
{
    private readonly ICurrentUser _currentUser;
    
    public UserService(ICurrentUser currentUser)
    {
        _currentUser = currentUser;
    }
    
    public RestfulResult<PageResult<User>> GetUsers(PageParam<UserSearch> param)
    {
        // 使用统一返回格式
        return new RestfulResult<PageResult<User>> 
        {
            Code = 0,
            Message = "查询成功",
            Data = new PageResult<User>
            {
                TotalCount = 100,
                Data = userList,
                PageIndex = param.PageIndex,
                PageSize = param.PageSize
            }
        };
    }
}

🎯 设计优势

  1. 标准化:统一的数据传输对象规范
  2. 可扩展:基于接口的设计,易于扩展
  3. 多租户支持:内置租户隔离机制
  4. 审计追踪:自动记录数据操作痕迹
  5. 逻辑删除:数据安全删除机制
  6. 统一响应:标准化的API响应格式
  7. 分页标准化:统一的分页查询规范

这个组件为整个系统提供了坚实的数据传输基础架构,确保各个模块之间的数据交互保持一致性和规范性。

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net5.0

    • No dependencies.

NuGet packages (7)

Showing the top 5 NuGet packages that depend on RuoVea.ExDto:

Package Downloads
RuoVea.ExSugar

Sqlsugar扩展 快速注入,支持简体中文、繁体中文、粤语、日语、法语、英语.使用方式:service.AddSqlsugar();继承RestFulLog 重写异常日志,操作日志,差异日志

RuoVea.ExFilter

注入 进行全局的异常日志收集、执行操作日志、参数验证,支持简体中文、繁体中文、粤语、日语、法语、英语. services.ExceptionSetup();// 注入 全局错误日志处 services.ExceptionSetup(ExceptionLog actionOptions);// 注入 全局错误日志处 services.ExceptionSetup(builder.Configuration.GetSection("AopOption:ExceptionLog"));// 注入 全局错误日志处 services.RequestActionSetup();// 注入 请求日志拦截 [执行操作日志、参数验证 ] services.RequestActionSetup(RequestLog actionOptions);// 注入 请求日志拦截 [执行操作日志、参数验证 ] services.RequestActionSetup(builder.Configuration.GetSection("AopOption:RequestLog"));// 注入 请求日志拦截 [执行操作日志、参数验证 ] services.ResourceSetup();//对资源型信息进行过滤 services.ResultSetup();//对结果进行统一 services.ApISafeSetup(AppSign actionOptions);//接口安全校验 services.ApISafeSetup(builder.Configuration.GetSection("AopOption:AppSign"));//接口安全校验 services.ApISignSetup(AppSign actionOptions);//签名验证 ( appKey + signKey + timeStamp + data ); services.ApISignSetup(builder.Configuration.GetSection("AopOption:AppSign"));//签名验证 ( appKey + signKey + timeStamp + data ); services.AddValidateSetup();//模型校验 services.AddUiFilesZipSetup();//将前端UI压缩文件进行解压 不进行接口安全校验 -> NonAplSafeAttribute 不签名验证 -> NonAplSignAttribute 不进行全局的异常日志收集 -> NonExceptionAttribute 不对资源型信息进行过滤 -> NonResourceAttribute 不对结果进行统一 -> NonRestfulResultAttribute

RuoVea.ExJwtBearer

Jwt 授权验证拓展插件。声名:IJwtHelper _jwtHelper,支持简体中文、繁体中文、粤语、日语、法语、英语. 添加验权:services.AddAuthenticationSetup(enableGlobalAuthorize: true); 添加鉴权:services.AddAuthorizationSetup.MyPermission.(enableGlobalAuthorize: true); 添加Jwt加密:services.AddJwtSetup();

RuoVea.ExWeb

CorsUrls、IPLimit、SafeIps、Jwt 配置

RuoVea.ExGlobal

web 注入 全局错误日志、操作日志记录

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
9.0.0.3 23 10/23/2025
9.0.0.2 18 10/23/2025
9.0.0.1 296 9/16/2025
9.0.0 504 7/25/2025
8.0.1.4 21 10/23/2025
8.0.1.3 16 10/23/2025
8.0.1.2 1,072 9/16/2025
8.0.1.1 3,871 9/22/2024
8.0.1 301 8/28/2024
8.0.0.2 205 8/25/2024
8.0.0.1 424 3/11/2024
8.0.0 286 11/24/2023
7.0.1.4 21 10/23/2025
7.0.1.3 16 10/23/2025
7.0.1.2 1,252 9/16/2025
7.0.1.1 4,583 9/22/2024
7.0.1 385 8/28/2024
7.0.0.1 205 8/25/2024
7.0.0 270 3/11/2024
6.0.12.4 20 10/23/2025
6.0.12.3 26 10/23/2025
6.0.12.2 1,515 9/16/2025
6.0.12.1 12,033 9/22/2024
6.0.12 414 8/28/2024
6.0.11.2 233 8/25/2024
6.0.11.1 904 3/11/2024
6.0.11 2,280 3/15/2023
6.0.10 453 3/12/2023
6.0.9 2,118 9/16/2022
6.0.8 531 9/16/2022
6.0.7 539 9/8/2022
6.0.6 539 8/18/2022
6.0.5 973 8/15/2022
6.0.4 1,237 3/10/2022
6.0.3 569 2/18/2022
6.0.2 570 2/16/2022
6.0.1 570 2/16/2022
6.0.0 2,341 2/9/2022
5.0.16.4 16 10/23/2025
5.0.16.3 17 10/23/2025
5.0.16.2 369 9/16/2025
5.0.16.1 552 9/22/2024
5.0.16 412 8/28/2024
5.0.15.2 200 8/25/2024
5.0.15.1 274 8/8/2024
5.0.15 2,599 11/26/2021
5.0.14 2,467 11/26/2021
5.0.13 545 11/22/2021
5.0.12 420 11/22/2021
5.0.11 761 11/19/2021
5.0.10 454 11/8/2021
5.0.9 1,221 11/5/2021
5.0.8 595 11/3/2021
5.0.7 449 11/3/2021
5.0.6 458 11/2/2021
5.0.5 451 11/2/2021
5.0.4 501 11/1/2021
5.0.3 471 10/12/2021
5.0.2 868 9/30/2021
5.0.1 446 9/29/2021
5.0.0 695 9/27/2021
2.1.1.4 12 10/23/2025
2.1.1.3 18 10/23/2025
2.1.1.2 288 9/16/2025
2.1.1.1 176 9/22/2024
2.1.1 176 8/28/2024
2.0.0.4 12 10/23/2025
2.0.0.2 15 10/23/2025
2.0.0.1 290 9/16/2025
2.0.0 182 9/22/2024