Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

你这源码里只有UserDao接口,没有UserDao实现吗? #7

Open
ZhujingJava opened this issue Jul 20, 2018 · 3 comments
Open

Comments

@ZhujingJava
Copy link

很开心能学习到您的源码,
我是初学者,
UserServiceImpl类中 方法
public User login(User user) {
return userDao.login(user);
}
其中login(user)方法的实现类呢?
UserContrller类中
@RequestMapping(value = "/cookie", method = RequestMethod.POST)
@responsebody
public Result login(User user) {
System.out.println("进入 users/cookie方法");
try {
String MD5pwd = MD5Util.MD5Encode(user.getPassword(), "UTF-8");
user.setPassword(MD5pwd);
} catch (Exception e) {
user.setPassword("");
}

User resultUser = userService.login(user);
最后一行获取到的resultUser我想不明白从哪里获取而来,望解答,谢谢!

@ZHENFENG13
Copy link
Owner

mybatis了解一下

@ZhujingJava
Copy link
Author

ZhujingJava commented Jul 20, 2018

login(User user)方法的实现类不用写了吗?
我打印出来的resultUser为null,难道这样打印是不对的?

@ZHENFENG13
Copy link
Owner

在mapper文件里

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants