package com.itclass.services;

import java.util.HashMap;
import java.util.Map;

import com.itclass.model.*;

public class UserService {

	private static Map<String, User> users = new HashMap<>();
	
	static {
		User user1 = new User("nesterione@gmail.com", "123", Role.USER);
		users.put(user1.getEmail(), user1);
		
		User user2 = new User("admin@gmail.com", "123", Role.ADMIN);
		users.put(user2.getEmail(), user2);
	}
	
	public User getUserByEmail(String email) {
		return UserService.users.get(email);
	}
	
	public boolean checkUserPassword(String email, String password) {
		
		User user = UserService.users.get(email);
		if(user!=null) {
			return user.getPassword().equals(password);
		}
		
		return false;
	}
	
	public synchronized  boolean addUser(User user) {
	
	}
	}
}
@@ -765,14 +765,27 @@
 r) %7B%0A%09%0A%09
-%7D
+%09return false;
 %0A%09%7D%0A%7D

fix bug