-
Notifications
You must be signed in to change notification settings - Fork 44
Dev 1.1 #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
li761747705
wants to merge
12
commits into
dotnet-easy:main
Choose a base branch
from
li761747705:dev-1.1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Dev 1.1 #59
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 重命名所有 NuGet 包为 Joce.EasyTool.* 前缀 - EasyTool.Core → Joce.EasyTool.Core - EasyTool.EmitMapper → Joce.EasyTool.EmitMapper - EasyTool.Web → Joce.EasyTool.Web - EasyTool.NPOI → Joce.EasyTool.NPOI - EasyTool.Image → Joce.EasyTool.Image - 更新所有项目版本号至 2026.0108.1 - 完善 NuGet 打包配置 - 为 EasyTool.Web 和 EasyTool.NPOI 添加完整的包元数据 - 统一所有项目的 PackageId、Authors、RepositoryUrl 等配置
## 主要更改 ### 标记 Obsolete 的方法 (~140+ 个) 将简单包装 .NET 内置 API 的方法标记为 [Obsolete],引导开发者直接使用内置 API: **IO/网络/运行时类:** - IoUtil.cs: 8 个 (File.ReadAllLines, ReadAllText, WriteAllLines 等) - URLUtil.cs: 5 个 (ExtractDomain, ExtractPath, ExtractQueryString 等) - RuntimeUtil.cs: 2 个 (GetDotNetVersion, GetOSVersion) - RegexUtil.cs: 2 个 (IsMatch, Replace) - TimerUtil.cs: 2 个 (StartNew, Wait) - TimestampUtil.cs: 6 个 (时间戳转换方法) **反射/类型/枚举类:** - TypeUtil.cs: 15 个 (IsEnum, GetProperties, GetMethods 等) - ReflectUtil.cs: 10 个 (GetType, GetAttribute, GetAssembly 等) - EnumUtil.cs: 7 个 (GetNames, GetValues, Parse 等) - ClassUtil.cs: 部分方法 **集合/列表/队列/栈类:** - ListUtil.cs: 13 个 (IndexOf, AddRange, ForEach, Sort 等) - QueueUtil.cs: 7 个 (Enqueue, Dequeue, Peek, Contains 等) - StackUtil.cs: 7 个 (Push, Pop, Peek, Contains 等) - LinkedListUtil.cs: 8 个 (AddFirst, AddLast, Remove 等) - IteratorUtil.cs: 7 个 (Filter, Map, Take, Skip 等 LINQ 包装) **工具类:** - ArrayUtil.cs: 部分方法 - StrUtil.cs: 部分方法 - HexUtil.cs: 部分方法 - ObjectUtil.cs: 多个方法 - FileUtil.cs: 部分方法 - EnvUtil.cs: 10 个 - EscapeUtil.cs: 5 个 - ProcessUtil.cs: 7 个 - DLLUtil.cs: 5 个 - MathUtil.cs: 1 个 (Average) - NumberUtil.cs: 1 个 (DecimalFormat) - Base64Util.cs: 2 个 (Encode, Decode) ### 新增扩展类文件 添加了多个独立的扩展类文件: - ArrayExtension.cs - 数组扩展 - ByteExtension.cs - 字节扩展 - ConvertExtension.cs - 转换扩展 - EnumExtension.cs - 枚举扩展 - ExceptionExtension.cs - 异常扩展 - FileSystemExtension.cs - 文件系统扩展 - StreamExtension.cs - 流扩展 - PropertyInfoExtension.cs - 属性信息扩展 - StringBuilderExtension.cs - 字符串构建器扩展 - StringComparisonExtension.cs - 字符串比较扩展 - TaskExtension.cs - 任务扩展 - TypeExtension.cs - 类型扩展 - GuidExtension.cs - GUID 扩展 - ObjectExtension.cs - 对象扩展 - DelegateExtension.cs - 委托扩展 - ColorExtension.cs - 颜色扩展 ### 删除文件 - Extension.Convert.cs - 合并到 ConvertExtension.cs ## 保持不变的文件 以下文件包含自定义业务逻辑,所有方法均保留: - IdUtil.cs (UUID/雪花ID生成) - AesUtil.cs, DesUtil.cs (加密算法) - Base32Util.cs, Base62Util.cs (编码算法) - ImgUtil.cs (图像处理) - NPOIUtil.cs (Excel 处理) - DateTimeUtil.cs, LunarCalendarUtil.cs (日期处理) - ZipUtil.cs, HashUtil.cs (压缩/哈希) - 等等... ## 兼容性 - 所有标记的方法仍可正常使用 - 使用 `false` 参数,仅警告不报错 - 保留向后兼容性 编译状态: ✅ 0 错误, 458 警告
- 删除 28 个冗余工具类(IoUtil, ObjectUtil, ArrayUtil 等) - 合并功能到对应扩展方法类(ObjectExtension, ArrayExtension 等) - 优化 StrUtil 和 PageUtil 中的字符串拼接,改用 StringBuilder - 移动 HashUtil, HexUtil, RandomUtil, RegexUtil, URLUtil 到正确类别 - 标记 DateTimeExtension 中 11 个包装方法为 Obsolete - 删除 CloneCategory 目录,功能已整合到 ObjectExtension 减少约 4000+ 行冗余代码,提升整体代码质量和性能
- 在AesUtil中新增字节数组版本的加密解密方法 - 在DesUtil中修复IV设置错误并添加字节数组版本方法 - 将多个工具类从Extension命名空间迁移到对应的功能分类命名空间 - 重命名CreditCodeUtil和DesensitizedUtil为静态类 - 添加新的SystemCategory.EnvUtil工具类 - 修复EncodingUtil中BASE32编码的位移计算错误 - 更新RandomUtil引用路径解决依赖问题 - 标记ConvertExtension中的ToHex方法为过时并提供替代方案
- 将 PropertyInfoExtension 和 TypeExtension 移动到 ReflectCategory,修正命名空间 - 将 StrExtension 移动到 TextCategory 并重命名为 StringExtension - 修复 HashUtil 命名空间为 EasyTool.CodeCategory - 改进代码组织,将相关功能归类到对应目录
- 将 CreditCodeUtil 移动到 SecurityCategory(业务验证工具) - 将 StringComparisonExtension 移动到 TextCategory(字符串相关) - 减少 ToolCategory 中不相关的文件数量 - 改进代码组织的逻辑性
- 将 IEnumerableExtensions.cs 移动到 CollectionsCategory - 删除空的 IEnumerableCategory 文件夹 - 统一集合相关扩展到同一分类目录
- 将 SimpleMapExtension 从 ToolCategory 移动到 DataCategory - 将 IdUtil 从 ToolCategory 移动到 DataCategory - 将 CreditCodeUtil 从 SecurityCategory 移动到 DataCategory - DataCategory 现在包含 4 个文件:PageUtil、SimpleMapExtension、IdUtil、CreditCodeUtil - 修复测试项目的命名空间引用
- 将 StringBuilderExtension 从 ToolCategory 移动到 TextCategory - 将 NumberExtension 从 ConvertCategory 移动到 MathCategory - 修复 FileSystemExtension 对 ToFileSize 的命名空间引用(ConvertCategory → MathCategory) - MathCategory 现在包含 4 个文件:MathUtil、PredictUtil、RandomUtil、NumberExtension - TextCategory 现在包含 7 个文件
- 创建新的 ImageCategory,将 ColorExtension 从 ConvertCategory 移入 - 将 EmojiUtil 从 EmojiCategory 移动到 TextCategory(表情符号是文本处理) - 将 DesensitizedUtil 从 SecurityCategory 移动到 TextCategory(脱敏是文本处理) - 删除空的 EmojiCategory 和 SecurityCategory 文件夹 - ImageCategory 现在包含 ColorExtension - TextCategory 现在包含 9 个文件(包含表情和脱敏) - ConvertCategory 减少到 3 个文件
- 标记 ByteExtension.ToHex/ToHexLower 为 Obsolete(与 HexUtil 重复) - 创建 IdentifierCategory,将 IdUtil 从 DataCategory 移入 - 创建 BusinessCategory,将 CreditCodeUtil 从 DataCategory 移入 - 将 SimpleMapExtension 移回 ToolCategory - 重命名 ImageCategory 为 ColorCategory(更准确) - 修复所有命名空间引用 - 修复测试项目的命名空间引用 最终分类结构: - CodeCategory(5), CollectionsCategory(7), ConvertCategory(3), DataCategory(2) - DateTimeCategory(4), ColorCategory(1), IOCategory(7), MathCategory(4) - NetCategory(3), ReflectCategory(3), Standardization(3), SystemCategory(2) - TextCategory(7), ToolCategory(7), IdentifierCategory(1), BusinessCategory(1)
- 删除 ConvertCategory/ByteExtension.cs(仅含 Obsolete 方法,与 HexUtil 重复) - 将 PageUtil 从 DataCategory 移动到 ToolCategory - 删除空的 DataCategory 文件夹 最终分类结构(15个分类,55个文件): - BusinessCategory(1), CodeCategory(5), CollectionsCategory(7), ColorCategory(1) - ConvertCategory(2), DateTimeCategory(4), IdentifierCategory(1), IOCategory(7) - MathCategory(4), NetCategory(3), ReflectCategory(3), Standardization(3) - SystemCategory(2), TextCategory(9), ToolCategory(8)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
完善分支的代码