apijson-router 参数格式转换
Description
@TommyLemon 目前传递参数格式:
{
"Combine[].Combine.a": "1"
"Combine[].Combine.b!": "2",
"Combine[].Combine.c~": "3"
}
router json模版:
{
"Combine[]": {
"page": 0,
"count": 10,
"Combine": {
"@column": "a,b,c,d,e,f,g",
"@combine": "a | ((b!~ & c~)) | d!"
}
},
"format": false,
"@explain": true
}
将json调整为:
{
"a": "Combine[].Combine.a",
"b": "Combine[].Combine.b!",
"Combine[]": {
"page": 0,
"count": 10,
"Combine": {
"@column": "a,b,c,d,e,f,g",
"@combine": "a | ((b!~ & c~)) | d!"
}
},
"format": false,
"@explain": true
}
传递参数
{
"a": "1",
"b": "2"
}
功能我还没有测,或者抽象一个方法, 业务侧来实现
这样就不能直接自动生成文档了,需要定制下 APIAuto 或者要手动写注释

还不如用现有的引用赋值
{
"Combine[]": {
"page": 0,
"count": 10,
"Combine": {
"a@": "a",
"b!@": "b",
"@null": "a,b!",
"@column": "a,b,c,d,e,f,g",
"@combine": "a | ((b!~ & c~)) | d!"
}
},
"format": false,
"@explain": true
}
{
"a": "1",
"b": "2"
}
如果 a 值为 null,则直接返回空对象了,需要 @null,然后根据这个判断,AbstractObjectParser 这里跳过 return true
https://github.com/Tencent/APIJSON/blob/aaff2d3b25262e6ee61a4221b13176bfa47c8631/APIJSONORM/src/main/java/apijson/orm/AbstractObjectParser.java#L416-L419

@null 本身又会对应 IS NULL/IS NOT NULL 条件,如果又不想要这个条件,得新增一个关键词来判断,例如 @nullable
哈哈,是的, 这样直接引用进去, 更简单
TommyLemon @.***> 于2023年3月9日周四 21:53写道:
这样就不能直接生成文档了,需要定制下 APIAuto。 [image: image] https://user-images.githubusercontent.com/5738175/224046335-08ba4682-7bf6-421e-9354-651d4419f385.png
还不如
{ "Combine[]": { "page": 0, "count": 10, "Combine": { "a@": "a" "b!@": "b" @.": "a,b,c,d,e,f,g", @.": "a | ((b!~ & c~)) | d!" } }, "format": false, @.***": true }
{ "a": "1", "b": "2" }
— Reply to this email directly, view it on GitHub https://github.com/Tencent/APIJSON/issues/524#issuecomment-1462107141, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC5JNAN5S2EFFEHC74UOK33W3HOG3ANCNFSM6AAAAAAVU67VDE . You are receiving this because you authored the thread.Message ID: @.***>
-- tt
等我空了来测
@TommyLemon
突然想到一个场景, 请教一下, 结合apijson, 如何处理

可以在远程函数内发起第三方请求