diff --git a/src/META-INF/MANIFEST.MF b/src/META-INF/MANIFEST.MF new file mode 100644 index 0000000..8254642 --- /dev/null +++ b/src/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Main-Class: com.mathpaper.main.Main + diff --git a/src/com/mathpaper/user/Account.java b/src/com/mathpaper/user/Account.java index 6c5cd7a..b765a13 100644 --- a/src/com/mathpaper/user/Account.java +++ b/src/com/mathpaper/user/Account.java @@ -1,5 +1,7 @@ package com.mathpaper.user; +import java.util.Set; + public class Account { private String username; private String password; @@ -7,6 +9,9 @@ public class Account { // 构造方法 public Account(String username, String password, String type) { + if (!Set.of("小学", "初中", "高中").contains(type)) { + throw new IllegalArgumentException("无效的学段类型"); + } this.username = username; this.password = password; this.type = type;