@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Accessors(chain = true)
@TableName("user")
@ApiModel(value = "User对象", description = "")
public class User implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
private String username;
private String password;
private String sex;
private Date birthday;
}
@Data
public class UserBookReq implements Serializable {
private static final long serialVersionUID = 1L;
// 用户名
private String username;
// 性别
private String sex;
// 书名
private String bookname;
// 作者
private String author;
// 价格
private BigDecimal price;
// 当前页
private int pageNum = 1;
// 每页条数
private int pageSize = 5;
}
public class TestAssembler {
public static void main(String[] args) {
UserBookReq userBookReq = new UserBookReq();
User user = new User();
}
}
- 选中
UserBookReq userBookReq
并复制
- 再选中
user
右键,选中Generate -> Vo2Dto
- 生成相应的代码