From bf940215b71ed724a56a6fee8dff17ff43cd08bc Mon Sep 17 00:00:00 2001 From: xRain Date: Tue, 25 Aug 2026 12:01:24 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=BA=90=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=90=8D=E6=94=B9=E4=B8=BA=E8=9B=87=E5=BD=A2=E5=91=BD=E5=90=8D?= =?UTF-8?q?(simapi=5Fserialization/annotations/json=5Fserializer=20?= =?UTF-8?q?=E7=AD=89),=20=E6=B6=88=E9=99=A4=20cjlint=20G.NAM.02=20?= =?UTF-8?q?=E8=AD=A6=E5=91=8A,=20=E7=89=88=E6=9C=AC=E5=8F=B7=201.2.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 22 +++++++++---------- cjpm.toml | 2 +- src/common/{Annotations.cj => annotations.cj} | 0 .../{NamingPolicy.cj => naming_policy.cj} | 0 ...ReflectionCache.cj => reflection_cache.cj} | 0 src/json/{JsonOption.cj => json_option.cj} | 0 src/json/{JsonReader.cj => json_reader.cj} | 0 .../{JsonSerializer.cj => json_serializer.cj} | 0 src/json/{JsonWriter.cj => json_writer.cj} | 0 ...entMacro.cj => serializer_parent_macro.cj} | 0 ...rialization.cj => simapi_serialization.cj} | 0 ...alizer_test.cj => json_serializer_test.cj} | 0 12 files changed, 12 insertions(+), 12 deletions(-) rename src/common/{Annotations.cj => annotations.cj} (100%) rename src/common/{NamingPolicy.cj => naming_policy.cj} (100%) rename src/common/{ReflectionCache.cj => reflection_cache.cj} (100%) rename src/json/{JsonOption.cj => json_option.cj} (100%) rename src/json/{JsonReader.cj => json_reader.cj} (100%) rename src/json/{JsonSerializer.cj => json_serializer.cj} (100%) rename src/json/{JsonWriter.cj => json_writer.cj} (100%) rename src/macros/{SerializerParentMacro.cj => serializer_parent_macro.cj} (100%) rename src/{SimApiSerialization.cj => simapi_serialization.cj} (100%) rename src/tests/{JsonSerializer_test.cj => json_serializer_test.cj} (100%) diff --git a/README.md b/README.md index beb99e7..40bc98f 100644 --- a/README.md +++ b/README.md @@ -19,14 +19,14 @@ SimApi 全反射 JSON 序列化库(仓颉版),对齐 .NET `System.Text.Jso ```toml [dependencies] -"simcu::serialization" = "1.2.0" +"simcu::serialization" = "1.2.1" ``` **方式二:Git 仓库** ```toml [dependencies] -"simcu::serialization" = { git = "https://gitcode.com/simcu/serialization-cj.git", version = "1.2.0" } +"simcu::serialization" = { git = "https://gitcode.com/simcu/serialization-cj.git", version = "1.2.1" } ``` > 本地开发也可用 path 依赖:`"simcu::serialization" = { path = "../simapi-serialization" }` @@ -227,19 +227,19 @@ JSON 数字 ↔ 字符串字段自动互转:`deserialize("42")` → `" ``` src/ -├── SimApiSerialization.cj // 根锚点:public import common.* + json.* +├── simapi_serialization.cj // 根锚点:public import common.* + json.* ├── common/ // XML/JSON 共用 -│ ├── Annotations.cj // @PropertyName / @Ignore / @NotRequired -│ ├── ReflectionCache.cj // 字段元数据 + 继承链缓存 -│ └── NamingPolicy.cj // PropertyNamingPolicy +│ ├── annotations.cj // @PropertyName / @Ignore / @NotRequired +│ ├── reflection_cache.cj // 字段元数据 + 继承链缓存 +│ └── naming_policy.cj // PropertyNamingPolicy ├── json/ // JSON 序列化 -│ ├── JsonSerializer.cj // 公开 API(含 TypeInfo 版 deserialize) -│ ├── JsonWriter.cj / JsonReader.cj -│ └── JsonOption.cj +│ ├── json_serializer.cj // 公开 API(含 TypeInfo 版 deserialize) +│ ├── json_writer.cj / json_reader.cj +│ └── json_option.cj ├── macros/ // @SerializerParent 宏 -│ └── SerializerParentMacro.cj +│ └── serializer_parent_macro.cj └── tests/ // 单元测试(独立子包) - └── JsonSerializer_test.cj // cjpm test,21 用例 + └── json_serializer_test.cj // cjpm test,21 用例 ``` ## 测试 diff --git a/cjpm.toml b/cjpm.toml index 2196452..7609fee 100644 --- a/cjpm.toml +++ b/cjpm.toml @@ -3,7 +3,7 @@ cjc-version = "1.1.3" name = "serialization" organization = "simcu" description = "SimApi 全反射 JSON 序列化库" -version = "1.2.0" +version = "1.2.1" target-dir = "" output-type = "static" diff --git a/src/common/Annotations.cj b/src/common/annotations.cj similarity index 100% rename from src/common/Annotations.cj rename to src/common/annotations.cj diff --git a/src/common/NamingPolicy.cj b/src/common/naming_policy.cj similarity index 100% rename from src/common/NamingPolicy.cj rename to src/common/naming_policy.cj diff --git a/src/common/ReflectionCache.cj b/src/common/reflection_cache.cj similarity index 100% rename from src/common/ReflectionCache.cj rename to src/common/reflection_cache.cj diff --git a/src/json/JsonOption.cj b/src/json/json_option.cj similarity index 100% rename from src/json/JsonOption.cj rename to src/json/json_option.cj diff --git a/src/json/JsonReader.cj b/src/json/json_reader.cj similarity index 100% rename from src/json/JsonReader.cj rename to src/json/json_reader.cj diff --git a/src/json/JsonSerializer.cj b/src/json/json_serializer.cj similarity index 100% rename from src/json/JsonSerializer.cj rename to src/json/json_serializer.cj diff --git a/src/json/JsonWriter.cj b/src/json/json_writer.cj similarity index 100% rename from src/json/JsonWriter.cj rename to src/json/json_writer.cj diff --git a/src/macros/SerializerParentMacro.cj b/src/macros/serializer_parent_macro.cj similarity index 100% rename from src/macros/SerializerParentMacro.cj rename to src/macros/serializer_parent_macro.cj diff --git a/src/SimApiSerialization.cj b/src/simapi_serialization.cj similarity index 100% rename from src/SimApiSerialization.cj rename to src/simapi_serialization.cj diff --git a/src/tests/JsonSerializer_test.cj b/src/tests/json_serializer_test.cj similarity index 100% rename from src/tests/JsonSerializer_test.cj rename to src/tests/json_serializer_test.cj