Skip to content

Commit

Permalink
feat: Add findUserList() to UserService
Browse files Browse the repository at this point in the history
- Find all users in user table.

Issue #49
  • Loading branch information
suhyunsim committed Jan 8, 2021
1 parent b184943 commit af051ed
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/java/com/poogle/phog/service/UserService.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@

import com.poogle.phog.domain.User;
import com.poogle.phog.domain.UserRepository;
import com.poogle.phog.web.admin.user.dto.ResponseDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Optional;

@Slf4j
@Service
public class UserService {

Expand All @@ -25,4 +29,10 @@ public void insertOrUpdate(User user) {
userRepository.save(user);
}
}

public ResponseDTO findUserList() {
List<User> users = userRepository.findAll();
log.debug("[*] users: {}", users);
return new ResponseDTO(200, "전체 유저 목록", users);
}
}

0 comments on commit af051ed

Please sign in to comment.