class NewsController extends ControllerBase { private final NewsFacade facade; @RequestMapping(value = "/{id}/picks", method = GET, produces = ContentTypes.JSON, headers = Headers.API_VERSION_2) @ResponseBody public PageableCollectionDto<PickViewDtoV2> getPicks( @PathVariable Long id, @ModelAttribute PickSearchParams params) { return getPicks(id, params).map(PickViewDtoV2.mapper()); } @RequestMapping(value = "/{id}/picks", method = GET, produces = ContentTypes.JSON, headers = Headers.API_VERSION_3) @ResponseBody public PageableCollectionDto<PickViewDtoV3> getPicks( @PathVariable Long id, @ModelAttribute PickSearchParams params) { return getPicks(id, params).map(PickViewDtoV3.mapper()); } private PageableCollectionDto<PickDto> getPicks(Long id, PickSearchParams params) { return facade.getPicks(id, params.getSorting(), params.getPage()); } } /api/v2 はきっと来ない エンドポイント毎に 非互換なバージョンアップを可能にしたい