是否能够实现从两个表中获取结构化响应的过程功能
我有两个表:“公司”和“电话”
Company 包含公司,Phone 包含每个公司的电话号码。一家公司 --> 多部由 companyID 关联的电话
我需要这个结构:
{
"resource": [
{
"companyId": 1,
"companyName": "Apple",
"companySubject": "Security",
"phones": [
{
"name": "tel1",
"phone": "+178548555"
}
]
},
{
"companyId": 2,
"companyName": "Samsung",
"companySubject": "IT",
"phones": [
{
"name": "tel1",
"phone": "+178548555"
},
{
"name": "tel2",
"phone": "+178548555"
},
{
"name": "tel3",
"phone": "+178548555"
}
]
},
{
"companyId": 3,
"companyName": "LG",
"companySubject": "Accounting",
"phones": [
{
"name": "tel1",
"phone": "+178548555"
},
{
"name": "tel2",
"phone": "+178548555"
}
]
}
]
}
问题是它们在单独的表中,我不知道如何实现它。
我使用dreamfactory作为后端