UserController.java 1.1 KB
Newer Older
Y
yingjun 已提交
1 2
package com.yingjun.ssm.web;

Y
yingjun 已提交
3 4
import com.yingjun.ssm.entity.User;
import com.yingjun.ssm.service.UserService;
Y
yingjun 已提交
5 6 7 8 9 10 11 12
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

Y
yingjun 已提交
13
import java.util.List;
Y
yingjun 已提交
14 15 16 17 18 19 20 21 22 23 24 25 26

@Controller
@RequestMapping("/user")
public class UserController {

	private final Logger LOG = LoggerFactory.getLogger(this.getClass());
	
	@Autowired
	private UserService userService;

	@RequestMapping(value = "/list", method = RequestMethod.GET)
	public String list(Model model, Integer offset, Integer limit) {
		LOG.info("invoke----------/user/list");
27 28 29 30
//		offset = offset == null ? 0 : offset;//默认便宜0
//		limit = limit == null ? 50 : limit;//默认展示50条
//		List<User> list = userService.getUserList(offset, limit);
//		model.addAttribute("userlist", list);
Y
yingjun 已提交
31 32 33 34
		return "userlist";
	}

}