package io.prlab.prule.controllers;

import io.prlab.prule.entity.AppUser;
import io.prlab.prule.repositories.AppUserRepository;
import io.prlab.prule.services.DatabaseUserDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {
    @Autowired
    public DatabaseUserDetailsService databaseUserDetailsService;
    @Autowired
    private final AppUserRepository repository;

    public UserController(AppUserRepository repository) {
        this.repository = repository;
    }

    @GetMapping("/users")
    public Iterable<AppUser> getUsers() {
        return repository.findAll();
    }
}