实体类的例子
@Data
public class User {
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
private String username;
// 忽略,不传到前端
@JsonIgnore
private String password;
private String nickname;
private String email;
private String phone;
private String address;
}
解决方式:
1.去数据库中删除不必要的数据
DELETE FROM table_name WHERE ID = 133427216;
2.使用以下代码将你的默认id值重置到你需要的数字值
ALTER TABLE table_name AUTO_INCREMENT = value;//(table_name 是你的表名,value是你要重置到的值)