ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
## 代码 ~~~ package com.like.domain; import java.util.List; import java.util.Map; public class User { private String username; private String password; private List<Account> list; private Map<String, Account> map; @Override public String toString() { return "User{" + "username='" + username + '\'' + ", password='" + password + '\'' + ", list=" + list + ", map=" + map + '}'; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public List<Account> getList() { return list; } public void setList(List<Account> list) { this.list = list; } public Map<String, Account> getMap() { return map; } public void setMap(Map<String, Account> map) { this.map = map; } } ~~~ ![](https://box.kancloud.cn/6f61660d47b6fc2ed73fbffa501997bc_1852x658.png) 控制器: ~~~ @RequestMapping(path = "/param") public String hello(User user) { System.out.println(user); return "success"; } ~~~ 结果: ``` User{username='jack', password='123', list=[Account{nickname='superman', money=500.0}, Account{nickname=batman', money=1000.0}], map={one=Account{nickname='map0name', money=20000.0}, two=Account{nickname='map1name', money=30000.0}}} ```