docs: update quick-start

This commit is contained in:
2025-11-14 15:35:15 +08:00
parent d1626c7884
commit 23c7283286
2 changed files with 11 additions and 2 deletions

View File

@@ -299,7 +299,12 @@ common {
// These key-values rules are applied when properties' keys exist.
keyValuesRules(
"some.key1" to ValueRule { if (it.contains("_")) it.replace("_", "-") else it },
"some.key2" to ValueRule { "$it-value" }
"some.key2" to ValueRule { "$it-value" },
// You can also specify the expected type class,
// the type you specify will be used during generation,
// and an exception will be thrown if the type cannot be converted correctly.
// If the [useTypeAutoConversion] is not enabled, this parameter will be ignored.
"some.key3" to ValueRule(Int::class)
)
// Set where to find properties' key-values.

View File

@@ -283,7 +283,11 @@ common {
// 当属性键存在时应用这些键值规则
keyValuesRules(
"some.key1" to ValueRule { if (it.contains("_")) it.replace("_", "-") else it },
"some.key2" to ValueRule { "$it-value" }
"some.key2" to ValueRule { "$it-value" },
// 你还可以指定期望的类型类,生成时将使用你指定的类型,
// 如果类型无法正确转换,将抛出异常
// 如果未启用 [useTypeAutoConversion],此参数将被忽略
"some.key3" to ValueRule(Int::class)
)
// 设置查找属性键值的位置