|
|
@ -1,5 +1,7 @@
|
|
|
|
package com.mathpaper.user;
|
|
|
|
package com.mathpaper.user;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.Set;
|
|
|
|
|
|
|
|
|
|
|
|
public class Account {
|
|
|
|
public class Account {
|
|
|
|
private String username;
|
|
|
|
private String username;
|
|
|
|
private String password;
|
|
|
|
private String password;
|
|
|
@ -7,6 +9,9 @@ public class Account {
|
|
|
|
|
|
|
|
|
|
|
|
// 构造方法
|
|
|
|
// 构造方法
|
|
|
|
public Account(String username, String password, String type) {
|
|
|
|
public Account(String username, String password, String type) {
|
|
|
|
|
|
|
|
if (!Set.of("小学", "初中", "高中").contains(type)) {
|
|
|
|
|
|
|
|
throw new IllegalArgumentException("无效的学段类型");
|
|
|
|
|
|
|
|
}
|
|
|
|
this.username = username;
|
|
|
|
this.username = username;
|
|
|
|
this.password = password;
|
|
|
|
this.password = password;
|
|
|
|
this.type = type;
|
|
|
|
this.type = type;
|
|
|
|