No constructor found in com.example.model.City matching [java.lang.Integer, java.lang.String, java.lang.String, java.lang.String]
看样子是构造函数的错误,添加新的构造函数即可
public City(Integer id, String name, String state, String country) {
this.id = id;
this.name = name;
this.state = state;
this.country = country;
}
原先写的构造函数是第一个参数为int型。莫非在依赖注入的过程中构造函数一定要是对象?