【发布时间】:2019-05-09 05:02:57
【问题描述】:
我有三个具有以下结构的数据库表:
Country
id | name
State
id | name | country_id
City
id | name | state_id
这些的现有 REST 端点 URL 是:
/country For list of all countries
/country/{country_id} For a specific country
/country/{country_id}/state For list of all states in a country
/country/{country_id}/state/{state_id} For a specific state
/country/{country_id}/state/{state_id}/city For list of all the cities in a state of a country
/country/{country_id}/state/{state_id}/city/{city_id} For a specific city
现在我需要将一个城市从一个州移动到另一个州,我应该如何为这个操作设计 REST Endpoint?建议。
【问题讨论】:
标签: rest api url restful-url