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

3

4
import com.yingjun.ssm.entity.User;
Y
yingjun 已提交
5 6 7
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
8
import org.springframework.web.bind.annotation.ModelAttribute;
Y
yingjun 已提交
9 10
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
11
import org.springframework.web.bind.annotation.ResponseBody;
12

Y
yingjun 已提交
13

14 15 16 17
/**
 * 用户
 * @author 包
 */
Y
yingjun 已提交
18 19 20 21 22
@Controller
@RequestMapping("/user")
public class UserController {

	private final Logger LOG = LoggerFactory.getLogger(this.getClass());
23

24 25 26 27
    /**
     * 用户登录
     * @return
     */
28 29
    @ResponseBody
	@RequestMapping(value = "/userLogin",produces="text/html;charset=UTF-8")
30 31
	public String userLogin(@ModelAttribute User user) {
		LOG.info("表单提交的用户信息:" + user.toString());
32
		return "登录成功";
33
	}
34 35 36 37 38

    /**
     * 用户注册
     * @return
     */
39
	@RequestMapping(value = "/userRegister", method = RequestMethod.GET)
40 41
	public String userRegister() {
		LOG.info("用户注册");
42
		return "/user/userResgiter";
Y
yingjun 已提交
43 44
	}
}