接口規範
最新公司新的項目,使用spring boot,cloud,服務之間使用rest api進行調用,所有使用了restful 風格的接口
@RequestMapping(value = "/getByRegionId/{regionId}", method = RequestMethod.GET)
@ResponseBody
public ObjectRestResponse<List<RegionsDTO>> getByRegionId(@PathVariable("regionId") String regionId) {}
@RequestMapping(value = "/{id}/menu", method = RequestMethod.POST)
@ResponseBody
public ObjectRestResponse modifyMenuAuthority(@PathVariable String id) {}
restful 風格接口的利弊
其他方式:
http://www.xxx.com/getByRegionId?id=x232323