package com.zhy.minion.controller; import java.util.HashMap; import java.util.Map; 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.ResponseBody; import com.zhy.minion.model.User; import com.zhy.minion.service.UserService; /** * @ClassName: UserController * @Description: TODO(这里用一句话描述这个类的作用) * @author Administrator * @date 2016年4月21日 下午1:06:34 * @Copyright © 2016上海通善互联网金融信息服务有限公司 */ @Controller @RequestMapping({ "/user" }) public class UserController { @Autowired private UserService userService; @ResponseBody @RequestMapping(value = "/login") public Object findUser(Model model) { User user = userService.selectUserById(1); Map map = new HashMap(); map.put("user", user); return map; } }