-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
如果系统中的表是分库的,这样能支持吗? #313
Comments
或者我应该说得详细一点,就是说我目前用户单独起了一个服务在管理user-center,组也是一个单独的服务group-center,组用到用户的信息都是去user-center取的,假如说APIJSON能够从另外一个APIJSON服务拿数据那就太棒了。 |
另外还有个区别就是,我去user-center拿数据是批量拿回来,再合并到组的数据里面的,主要是考虑效率问题,如果APIJSON也能考虑这种情况就更好了。 |
可以通过 @datasource/@database/@Schema 指定不同数据源来支持。 {
"@datasource": "DRUID",
"User": {
"id": 82001,
"@datasource": "HIKARICP",
"@database": "POSTGRESQL"
},
"[]": {
"Comment": {
"userId@": "User/id"
},
"Moment": {
"@datasource": "DRUID",
"id@": "/Comment/momentId"
}
},
"@explain": true
} “自动给每一个对象加一个字段owner” 前端在参数 group 对象里传参 owner 对象引用赋值就行了。 {
"[]": {
"Comment": {
"User": {
"id@": "/userId",
"@column": "id,name"
}
}
}
} {
"Comment[]": {
"Comment": {
"User": {
"id@": "/userId",
"@column": "id,name"
}
}
}
} {
"[]": {
"Comment": {},
"User": {
"id@": "/Comment/userId",
"@column": "id,name"
}
}
} |
https://github.com/Tencent/APIJSON/blob/master/Document.md#3.2 |
假如我现在有两张表,
user
和group
,group
有一个字段owner_id
关联到user
表的id
,但是这两张表是在两个数据库中的,这时候我还能使用APIJSON吗?我希望在查询
group
列表的时候,会自动给每一个对象加一个字段owner
,就是当前group
关联的user
对象的信息。我该怎么做呢?
The text was updated successfully, but these errors were encountered: