parent
29d61590df
commit
953679bd61
@ -0,0 +1,36 @@
|
||||
public class User {
|
||||
private String username; // 用户名
|
||||
private String password; // 密码
|
||||
private String userType; //(小学/初中/高中)
|
||||
|
||||
public String getUsername(){
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username){
|
||||
this.username = username;
|
||||
}
|
||||
public String getPassword(){
|
||||
return password;
|
||||
}
|
||||
public void setPassword(String password){
|
||||
this.password = password;
|
||||
}
|
||||
public String getUserType(){
|
||||
return userType;
|
||||
}
|
||||
public void setUserType(String userType){
|
||||
this.userType = userType;
|
||||
}
|
||||
|
||||
public boolean validateCredentials(String inputUsername, String inputPassword) {
|
||||
// 验证用户名和密码是否匹配
|
||||
return this.username.equals(inputUsername) && this.password.equals(inputPassword);
|
||||
}
|
||||
|
||||
public User(String username,String password,String userType){
|
||||
this.username = username;
|
||||
this.password = password;
|
||||
this.userType = userType;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue