User Service API 구현


User Service API 구현

1. User 도메인 클래스 생성 아직 JPA와 연동하지 않고 간단하게 설계하겠습니다. DB를 사용하지 않고 List에 저장하여 가져오는 식으로 설계합니다. 고정적으로 List에 저장할 User 3개를 만들어준다. findAll() method: List에 있는 모든 User들을 반환한다. save() method: List<User>에 user를 저장한다. findOne() method: id의 일치 여부를 확인해 확인된 id를 가진 user를 반환한다. @Service public class UserDaoService { private static List<User> users = new ArrayList<>(); private static int usersCount = 3; // 고정적으로 List에 저장할 User 3개를 만들어준다. static { users.add(new User(1, "Euics", new Date())); users.add(new User(2, "Boo...



원문링크 : User Service API 구현