Skip to content
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

请问如何处理嵌套资源呢? #3

Closed
dearbird opened this issue Apr 5, 2016 · 3 comments
Closed

请问如何处理嵌套资源呢? #3

dearbird opened this issue Apr 5, 2016 · 3 comments

Comments

@dearbird
Copy link

dearbird commented Apr 5, 2016

我能想到的一个办法是转成查询参数,如
/users/:id/devices => /devices?id=###

@caoym
Copy link
Collaborator

caoym commented Apr 6, 2016

可以这么写
@route({"GET","\users*\devices "})
@param({"id", "$.path[1]"}) //$.path是一个数组,对应url path中的每级目录

2016-04-05 18:14 GMT+08:00 dearbird notifications@github.com:

我能想到的一个办法是转成查询参数,如
/users/:id/devices => /devices?id=###


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#3

@caoym
Copy link
Collaborator

caoym commented Apr 6, 2016

/**
_@route({"GET","\users_\devices "})
*@param({"id", "$.path[1]"}) //$.path是一个数组,对应url path中的每级目录,
如当前的内容是[users,id,devices]
*/
public function getDevices($id){
....
}

2016-04-06 9:29 GMT+08:00 曹阳敏 caoyangmin@gmail.com:

可以这么写
@route({"GET","\users*\devices "})
@param({"id", "$.path[1]"}) //$.path是一个数组,对应url path中的每级目录

2016-04-05 18:14 GMT+08:00 dearbird notifications@github.com:

我能想到的一个办法是转成查询参数,如
/users/:id/devices => /devices?id=###


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#3

@dearbird
Copy link
Author

dearbird commented Apr 6, 2016

Perfect, Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant