实现数据库查询用户,获取密码,编写了单元测试类

This commit is contained in:
F嘉阳
2018-01-30 15:47:30 +08:00
commit 91aba6a592
21 changed files with 818 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
package com.fjy.spring.controller;
import com.fjy.spring.domain.TbUser;
import com.fjy.spring.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
@Controller
public class LoginController {
@Autowired
private UserService userService;
@GetMapping("/index")
public String toLoginPage(){
return "login";
}
@PostMapping("/login/dologin")
public boolean doLogin(TbUser tbUser){
if (userService.doLoginService(tbUser.getColname(),tbUser.getColpassword())){
return true;
}
return false;
}
}