package com.tsi.sig.server.controller;

import com.tsi.sig.server.objects.UserVO;
import com.tsi.sig.server.service.UserService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Locale;

@Controller
public class UserController {
    private final UserService userService;

    public UserController(UserService userService) {
        this.userService = userService;
    }

    @PostMapping({"/getUserList.do"})
    @ResponseBody
    public List<UserVO> getUserList(Locale locale, Model model, HttpServletRequest request, HttpServletResponse response) throws Exception {
        List<UserVO> users = this.userService.getUserList();
        return users;
    }
}
