public User checkLogin(String phoneNumber, String loginPassword) { // TODO Auto-generated method stub User user = userMapper.selectByPrimaryKey(phoneNumber); if (user != null && user.getLoginPassword().equals(loginPassword)) { return user; } else { return null; } }
public User register(String phoneNumber, String loginPassword) { // TODO Auto-generated method stub int i = 0; User user = new User(); user.setPhoneNumber(phoneNumber); user.setLoginPassword(loginPassword); try { i = userMapper.insert(user); if (i == 1) { user = userMapper.selectByPrimaryKey(phoneNumber); return user; } } catch (Exception e) { // TODO: handle exception e.printStackTrace(); } return null; }