亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Spring Hateoas 忽略查詢參數

Spring Hateoas 忽略查詢參數

慕碼人8056858 2021-10-13 16:18:30
從您的 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;    }
查看完整描述

1 回答

?
精慕HU

TA貢獻1845條經驗 獲得超8個贊

免責聲明:從未使用過 Spring HATEOAS。

但乍一看,您似乎混淆了兩種 URL-Parameter 類型:

  • @PathVariable 對于路徑變量,如 .../teams/TEAM_ID

  • @RequestParam 對于查詢參數,如 .../teams?id=TEAM_ID


查看完整回答
反對 回復 2021-10-13
  • 1 回答
  • 0 關注
  • 159 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號