2020java框架教程之spring的RESTful的CRUD实现
1.创建实体类
2.创建dao
@Repository
public class UsersDao {
private static Map<Integer, User> map=null;
static{
map=new HashMap<Integer, User>();
map.put(1,new User(1,"admin","admin",25,"admin@qq.com",
new Address(1,"ah","000")));
map.put(2,new User(2,"admin2","admin2",11,"admin2@qq.com",
new Address(2,"ah2","002")));
map.put(3,new User(3,"admin3","admin3",11,"admin3@qq.com",
new Address(3,"ah3","003")));
map.put(4,new User(4,"admin4","admin4",11,"admin4@qq.com",
new Address(4,"ah4","004")));
}
(more…)