Package cc.concurrent.config.server.service

Source Code of cc.concurrent.config.server.service.UserService

package cc.concurrent.config.server.service;

import cc.concurrent.config.server.dao.UserDao;
import cc.concurrent.config.server.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import static com.google.common.base.Preconditions.*;

/**
* User: yanghe.liang
* Date: 13-10-20
* Time: 下午9:30
*/
@Component
public class UserService {

    @Autowired
    UserDao userDao;

    public boolean login(String username, String passward) {
        checkNotNull(username);
        checkNotNull(passward);
        User user = userDao.getUser(username);
        return user != null ? passward.equals(user.getPassword()) : false;
    }

}
TOP

Related Classes of cc.concurrent.config.server.service.UserService

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.