ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
## 代码 ~~~ package com.like.domain; public class User { private String username; private String password; private Account account; @Override public String toString() { return "User{" + "username='" + username + '\'' + ", password='" + password + '\'' + ", account=" + account + '}'; } 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 Account getAccount() { return account; } public void setAccount(Account account) { this.account = account; } } ~~~ ~~~ package com.like.domain; public class Account { private String nickname; private Double money; @Override public String toString() { return "Account{" + "nickname='" + nickname + '\'' + ", money=" + money + '}'; } public String getNickname() { return nickname; } public void setNickname(String nickname) { this.nickname = nickname; } public Double getMoney() { return money; } public void setMoney(Double money) { this.money = money; } } ~~~ ~~~ @RequestMapping(path = "/param") public String hello(User user) { System.out.println(user); return "success"; } ~~~ ![](https://box.kancloud.cn/4f5a85bc0ff54aef68344e1c0b15fbf7_1824x286.png) 结果: ``` User{username='jack', password='123', account=Account{nickname='superman', money=1000.0}} ```