문제

http://www.filesspecialtours.com/ER.png


To get "agrupaciones" I do:

GET /agrupaciones/

To get "asociados" I do:

GET /agrupaciones/asociados/

How to do to obtains the result of cross two resources?

agrupaciones., asociados.

Any common method for to do it?

도움이 되었습니까?

해결책

Not sure exactly what you are trying to do because my Spanish isn't great, but if you want all "asociados" returned then return them in the "agrupaciones" resource. For example

GET /agrupaciones

{
    nombre: "Movie Club",
    asociados [
        {
            url: "/agrupaciones/asociados/1"
            nombre: "Bob",
            archivo_esp: "blah",
            archivo_por: "blah blah",
            ...
        },
        {
            url: "/agrupaciones/asociados/2"
            nombre: "Sally",
            archivo_esp: "blah2",
            archivo_por: "blah2 blah2",
            ...
        }
        ...
    ]
}

If you don't want to return that much data in one go you can just use the URL

GET /agrupaciones

{
    nombre: "Movie Club",
    asociados [
        {
            url: "/agrupaciones/asociados/1"
            nombre: "Bob",
        },
        {
            url: "/agrupaciones/asociados/2"
            nombre: "Sally",
        }
        ...
    ]
}

and then the client can follow the URL if they want further information about the member.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top