-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
查询调用远程函数各种使用场景说明 #467
Comments
赞,感谢分享~ |
{
"id@-()": "getCurrentUserId()", // 会得到 "id@": 1 这样
"User": {
"id@": "/id" // 引用不到
}
} 这种写法看起来有问题,应该去掉多余的 @ ,改为 {
"id-()": "getCurrentUserId()", // 会得到 "id": 1 这样的
"User": {
"id@": "/id" // 可以引用到
}
} |
能引用到,哈哈 |
确实可以,这是个 bug,别这么用,修复后就这种写法就不行了。 |
暂时没看出来是哪里的问题。 话说最近 Idea 默认把 tab 缩进等效 4 个空格改成了 2 个,导致不少新增代码的缩进和之前对不上,挺乱的。 https://github.com/Tencent/APIJSON/blob/master/APIJSONORM/src/main/java/apijson/orm/AbstractObjectParser.java#L735-L747 |
@TommyLemon |
目前仅支持 账号及密码、Cookie 的复用。 |
另外也支持导入 Postman, Swagger, YApi, Rap 等接口请求及文档 |
@cloudAndMonkey |
@cloudAndMonkey 解决了代码编辑框使用快捷键的问题,现在可以正常用了 |
已部署到 |
收到 |
比如获取当前用户 函数, 示例代码已经有了

1、新增function
/***
* 获取当前用户id
* @param current
* @return
*/
public String getCurrentUserId(@NotNull JSONObject current) {
return FormVerifier.getVisitorId(getSession());
}
2、配置数据库function权限
3、GET调用远程函数
独立调用远程函数
{
"name": "jerry",
"aaa":"demoa",
"id()": "sayHello(name)"
}
获取当前用户id
{
"id()": "getCurrentUserId()"
}
# 简化版调用
{
"id@-()": "getCurrentUserId()",
"User": {
"id@": "/id"
},
"tag": "User",
"@Explain": true
}
查询引用
{
"func": {
"@name": "23",
"id()": "sayHello(@name)"
},
"User": {
"id@": "/func/id"
},
"tag": "User"
}
获取当前用户详细信息
{
"func": {
"id()": "getCurrentUserId()"
},
"User:data": {
"id@": "/func/id"
},
"tag": "User",
"@Explain": true
}
# 子查询引用(注意路径,/ 开头是查询 /sql@/xxx, func/xxx 从顶层查询)
{
"func": {
"@name": "23",
"id()": "sayHello(@name)"
},
"sql@": {
"with": true,
"from": "Sys_user_role",
"Sys_user_role": {
"@column": "role_id",
"user_id@": "func/id"
}
},
"Sys_role[]": {
"Sys_role": {
"id{}@": "sql"
},
"page": 0,
"count": 10
},
"@Explain": true
}
inner join引用
{
"@show_reponse": true,
//"@show_reponse_keys": "func,data",
//"@show_reponse_exclude_keys": "func,tag",
"id@-()": "getCurrentUserId()",
"User[]": {
"User": {
"@from@": {
"from": "User_address",
"join": "&/User/id@",
"User_address": {
"user_id@": "id",
"@column": "id:addr_id,user_id,addr"
},
"User": {
"id@": "/User_address/user_id",
"@column": "id,username"
}
}
}
},
"@Explain": true
}
分组引用
The text was updated successfully, but these errors were encountered: