Controller代码
package com.hlwxy.ssm.controller;
import com.hlwxy.ssm.mapper.CategoryMapper;
import com.hlwxy.ssm.mapper.UserMapper;
import com.hlwxy.ssm.model.Category;
import com.hlwxy.ssm.model.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Controller
public class UserController {
@Resource
UserMapper userMapper;
@RequestMapping("/login")
@ResponseBody
public Map<String,Object> listCategory(@RequestBody User user,HttpServletResponse response) throws Exception {
Integer integer=userMapper.findUser(user);