package com.web.dao.impl; import java.util.ArrayList; import java.util.List; import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Repository; import com.web.dao.UserDao; import com.web.entity.User; @Repository public class UserDaoImpl implements UserDao{ @Override @Cacheable("users") public User get(String keyId) { User user=new User(); user.setId("1"); user.setName("xiaoming"); user.setPassword("322424"); try { Thread.sleep(3000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } return user; } @Override @Cacheable("userCache") public List<User> findAll() { List<User> list=new ArrayList<User>(); for(int i=0;i<5;i++){ User user=new User(); user.setId("0"+i); user.setName("xiaoming"+i); user.setPassword("ssd"+i); list.add(user); } return list; } }

yinyun1985 LV14
2022年6月14日
and123456 LV11
2022年4月5日
xiaot99 LV7
2021年12月25日
java_php LV11
2021年9月2日
xhmpmail LV17
2021年2月24日
goowel LV1
2020年11月18日
jammes LV3
2020年6月8日
longyin2018 LV14
2019年11月18日
fei6549 LV10
2019年9月24日
start111 LV9
2019年8月12日

hbsoft2008 LV16
2023年7月24日
yinyun1985 LV14
2022年6月14日
and123456 LV11
2022年4月5日
JoyKinG LV19
2022年2月23日
xiaot99 LV7
2021年12月25日
lvhaowen LV20
2021年11月5日
chendaochao
2021年7月20日
暂无贡献等级
huangxiaoke20 LV17
2021年7月7日
denliv_hui LV14
2021年6月21日
xhmpmail LV17
2021年2月24日