從您的 json 數據中,您的 DTO 可能是PropertyDTO{ long userloginid; String propertyname; long propertyid;}所以你的 API 看起來像@RestController@RequestMapping(value = "/property")public class PropertyController{ @RequestMapping(method = RequestMethod.GET) public PropertyDTO get(){ return null; } @RequestMapping(method = RequestMethod.PUT) public Boolean update(@RequestBody PropertyDTO dto){ return true; } @RequestMapping(method = RequestMethod.POST) public Boolean insert(@RequestBody PropertyDTO dto){ return true; }
Spring Hateoas 忽略查詢參數
慕碼人8056858
2021-10-13 16:18:30