postman測試Integer[]數組


背景說明:在做批量刪除列表數據的時候,前端發送數組格式給后端,后端使用數組格式(Integer[] ids)接受,需要使用postman測試結果。

@ApiOperation("管理系統-刪除系統日志")
@DeleteMapping("delete_system_log")
public Dto deleteSystemLog(@RequestBody Integer[] ids) {
    return systemLogService.deleteLogByIds(ids);
}

總結:@RequestBody自動轉成一個對象,這個對象有個屬性叫ids。不能寫成

{
"ids": [4,5,6]
}


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM