diff --git a/server/.idea/workspace.xml b/server/.idea/workspace.xml
index 0528177c..b18400a3 100644
--- a/server/.idea/workspace.xml
+++ b/server/.idea/workspace.xml
@@ -145,7 +145,7 @@
-
+
diff --git a/server/src/main/java/self/cases/teams/entity/STjiao.java b/server/src/main/java/self/cases/teams/entity/STjiao.java
new file mode 100644
index 00000000..100dd5a1
--- /dev/null
+++ b/server/src/main/java/self/cases/teams/entity/STjiao.java
@@ -0,0 +1,97 @@
+package self.cases.teams.entity;
+
+import java.util.Date;
+
+public class STjiao {
+ private String id;
+ private String clubName;
+ private String memberName;
+ private double amount;
+ private Date paymentDate;
+ private String paymentMethod;
+ private String transactionId;
+ private boolean isPaid;
+ private Date createdAt;
+ private Date updatedAt;
+
+ // Getters and Setters
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getClubName() {
+ return clubName;
+ }
+
+ public void setClubName(String clubName) {
+ this.clubName = clubName;
+ }
+
+ public String getMemberName() {
+ return memberName;
+ }
+
+ public void setMemberName(String memberName) {
+ this.memberName = memberName;
+ }
+
+ public double getAmount() {
+ return amount;
+ }
+
+ public void setAmount(double amount) {
+ this.amount = amount;
+ }
+
+ public Date getPaymentDate() {
+ return paymentDate;
+ }
+
+ public void setPaymentDate(Date paymentDate) {
+ this.paymentDate = paymentDate;
+ }
+
+ public String getPaymentMethod() {
+ return paymentMethod;
+ }
+
+ public void setPaymentMethod(String paymentMethod) {
+ this.paymentMethod = paymentMethod;
+ }
+
+ public String getTransactionId() {
+ return transactionId;
+ }
+
+ public void setTransactionId(String transactionId) {
+ this.transactionId = transactionId;
+ }
+
+ public boolean isPaid() {
+ return isPaid;
+ }
+
+ public void setPaid(boolean paid) {
+ isPaid = paid;
+ }
+
+ public Date getCreatedAt() {
+ return createdAt;
+ }
+
+ public void setCreatedAt(Date createdAt) {
+ this.createdAt = createdAt;
+ }
+
+ public Date getUpdatedAt() {
+ return updatedAt;
+ }
+
+ public void setUpdatedAt(Date updatedAt) {
+ this.updatedAt = updatedAt;
+ }
+}
diff --git a/server/src/main/java/self/cases/teams/entity/STm.java b/server/src/main/java/self/cases/teams/entity/STm.java
new file mode 100644
index 00000000..88da2523
--- /dev/null
+++ b/server/src/main/java/self/cases/teams/entity/STm.java
@@ -0,0 +1,4 @@
+package self.cases.teams.entity;
+
+public class STm {
+}
diff --git a/server/src/main/java/self/cases/teams/teaa/ManagSTexiu.java b/server/src/main/java/self/cases/teams/teaa/ManagSTexiu.java
new file mode 100644
index 00000000..2e8953b1
--- /dev/null
+++ b/server/src/main/java/self/cases/teams/teaa/ManagSTexiu.java
@@ -0,0 +1,161 @@
+package self.cases.teams.teaa;
+import java.util.ArrayList;
+import java.util.List;
+
+// 定义用户类
+class User {
+ private String userId;
+ private String name;
+ private String email;
+ private String phoneNumber;
+
+ public User(String userId, String name, String email, String phoneNumber) {
+ this.userId = userId;
+ this.name = name;
+ this.email = email;
+ this.phoneNumber = phoneNumber;
+ }
+
+ public String getUserId() {
+ return userId;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ public String getPhoneNumber() {
+ return phoneNumber;
+ }
+
+ public void setPhoneNumber(String phoneNumber) {
+ this.phoneNumber = phoneNumber;
+ }
+
+ @Override
+ public String toString() {
+ return "User{" +
+ "userId='" + userId + '\\' +
+ ", name='" + name + '\\' +
+ ", email='" + email + '\\' +
+ ", phoneNumber='" + phoneNumber + '\\' +
+ '}';
+ }
+}
+
+// 管理员类
+public class ManagSTexiu {
+ // 模拟数据库
+ private List users = new ArrayList<>();
+
+ // 添加用户
+ public boolean addUser(User user) {
+ if (findUserById(user.getUserId()) == null) {
+ users.add(user);
+ System.out.println("用户添加成功: " + user);
+ return true;
+ } else {
+ System.out.println("用户ID已存在,无法添加: " + user.getUserId());
+ return false;
+ }
+ }
+
+ // 删除用户
+ public boolean deleteUser(String userId) {
+ User userToRemove = findUserById(userId);
+ if (userToRemove != null) {
+ users.remove(userToRemove);
+ System.out.println("用户删除成功: " + userToRemove);
+ return true;
+ } else {
+ System.out.println("未找到用户ID: " + userId);
+ return false;
+ }
+ }
+
+ // 更新用户信息
+ public boolean updateUser(String userId, String field, String newValue) {
+ User userToUpdate = findUserById(userId);
+ if (userToUpdate != null) {
+ switch (field.toLowerCase()) {
+ case "name":
+ userToUpdate.setName(newValue);
+ break;
+ case "email":
+ userToUpdate.setEmail(newValue);
+ break;
+ case "phonenumber":
+ userToUpdate.setPhoneNumber(newValue);
+ break;
+ default:
+ System.out.println("无效字段: " + field);
+ return false;
+ }
+ System.out.println("用户信息更新成功: " + userToUpdate);
+ return true;
+ } else {
+ System.out.println("未找到用户ID: " + userId);
+ return false;
+ }
+ }
+
+ // 查询用户信息
+ public User findUserById(String userId) {
+ for (User user : users) {
+ if (user.getUserId().equals(userId)) {
+ System.out.println("用户信息查询成功: " + user);
+ return user;
+ }
+ }
+ System.out.println("未找到用户ID: " + userId);
+ return null;
+ }
+
+ // 显示所有用户
+ public void displayAllUsers() {
+ if (users.isEmpty()) {
+ System.out.println("当前没有用户记录");
+ } else {
+ System.out.println("所有用户信息:");
+ for (User user : users) {
+ System.out.println(user);
+ }
+ }
+ }
+
+ // 主方法演示功能
+ public static void main(String[] args) {
+ Managexiu manager = new Managexiu();
+
+ // 添加用户
+ manager.addUser(new User("U001", "张三", "zhangsan@example.com", "1234567890"));
+ manager.addUser(new User("U002", "李四", "lisi@example.com", "0987654321"));
+
+ // 显示所有用户
+ manager.displayAllUsers();
+
+ // 查询用户
+ manager.findUserById(Integer.parseInt("U001"));
+
+ // 更新用户信息
+ manager.updateUser("U001", "email", "zhangsan_new@example.com");
+
+ // 删除用户
+ manager.deleteUser("U002");
+
+ // 再次显示所有用户
+ manager.displayAllUsers();
+ }
+}
diff --git a/server/src/main/java/self/cases/teams/teaa/Managexiu.java b/server/src/main/java/self/cases/teams/teaa/Managexiu.java
index 62c69cc3..72f26033 100644
--- a/server/src/main/java/self/cases/teams/teaa/Managexiu.java
+++ b/server/src/main/java/self/cases/teams/teaa/Managexiu.java
@@ -12,6 +12,18 @@ public class Managexiu {
users = new HashMap<>();
}
+ public void addUser(self.cases.teams.teaa.User user) {
+ }
+
+ public void displayAllUsers() {
+ }
+
+ public void updateUser(String u001, String email, String mail) {
+ }
+
+ public void deleteUser(String u002) {
+ }
+
// Inner class to represent a User
public static class User {
private int userId;
diff --git a/server/src/main/java/self/cases/teams/teaa/STcy.java b/server/src/main/java/self/cases/teams/teaa/STcy.java
new file mode 100644
index 00000000..13d0ef16
--- /dev/null
+++ b/server/src/main/java/self/cases/teams/teaa/STcy.java
@@ -0,0 +1,245 @@
+package self.cases.teams.teaa;
+
+import java.util.ArrayList;
+import java.util.List;
+
+// 定义社团成员信息类
+class MemberInfo {
+ private String memberId;
+ private String name;
+ private String gender;
+ private int age;
+ private String contact;
+ private String joinDate;
+ private String role; // "leader", "member", "guest"
+ private double duesPaid; // 缴纳会费
+
+ public MemberInfo(String memberId, String name, String gender, int age, String contact, String joinDate, String role, double duesPaid) {
+ this.memberId = memberId;
+ this.name = name;
+ this.gender = gender;
+ this.age = age;
+ this.contact = contact;
+ this.joinDate = joinDate;
+ this.role = role;
+ this.duesPaid = duesPaid;
+ }
+
+ public String getMemberId() {
+ return memberId;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getGender() {
+ return gender;
+ }
+
+ public void setGender(String gender) {
+ this.gender = gender;
+ }
+
+ public int getAge() {
+ return age;
+ }
+
+ public void setAge(int age) {
+ this.age = age;
+ }
+
+ public String getContact() {
+ return contact;
+ }
+
+ public void setContact(String contact) {
+ this.contact = contact;
+ }
+
+ public String getJoinDate() {
+ return joinDate;
+ }
+
+ public void setJoinDate(String joinDate) {
+ this.joinDate = joinDate;
+ }
+
+ public String getRole() {
+ return role;
+ }
+
+ public void setRole(String role) {
+ this.role = role;
+ }
+
+ public double getDuesPaid() {
+ return duesPaid;
+ }
+
+ public void setDuesPaid(double duesPaid) {
+ this.duesPaid = duesPaid;
+ }
+
+ @Override
+ public String toString() {
+ return "MemberInfo{" +
+ "memberId='" + memberId + '\\' +
+ ", name='" + name + '\\' +
+ ", gender='" + gender + '\\' +
+ ", age=" + age +
+ ", contact='" + contact + '\\' +
+ ", joinDate='" + joinDate + '\\' +
+ ", role='" + role + '\\' +
+ ", duesPaid=" + duesPaid +
+ '}';
+ }
+}
+
+// 社团管理系统社团成员信息管理类
+public class STcy {
+ // 模拟数据库
+ private List memberInfos = new ArrayList<>();
+
+ // 添加成员信息
+ public boolean addMemberInfo(MemberInfo memberInfo) {
+ if (findMemberInfoById(memberInfo.getMemberId()) == null) {
+ memberInfos.add(memberInfo);
+ System.out.println("成员信息添加成功: " + memberInfo);
+ return true;
+ } else {
+ System.out.println("成员ID已存在,无法添加: " + memberInfo.getMemberId());
+ return false;
+ }
+ }
+
+ // 删除成员信息
+ public boolean deleteMemberInfo(String memberId) {
+ MemberInfo memberInfoToRemove = findMemberInfoById(memberId);
+ if (memberInfoToRemove != null) {
+ memberInfos.remove(memberInfoToRemove);
+ System.out.println("成员信息删除成功: " + memberInfoToRemove);
+ return true;
+ } else {
+ System.out.println("未找到成员ID: " + memberId);
+ return false;
+ }
+ }
+
+ // 更新成员信息
+ public boolean updateMemberInfo(String memberId, String field, Object newValue) {
+ MemberInfo memberInfoToUpdate = findMemberInfoById(memberId);
+ if (memberInfoToUpdate != null) {
+ switch (field.toLowerCase()) {
+ case "name":
+ memberInfoToUpdate.setName(newValue.toString());
+ break;
+ case "gender":
+ memberInfoToUpdate.setGender(newValue.toString());
+ break;
+ case "age":
+ try {
+ memberInfoToUpdate.setAge(Integer.parseInt(newValue.toString()));
+ } catch (NumberFormatException e) {
+ System.out.println("无效年龄: " + newValue);
+ return false;
+ }
+ break;
+ case "contact":
+ memberInfoToUpdate.setContact(newValue.toString());
+ break;
+ case "role":
+ memberInfoToUpdate.setRole(newValue.toString());
+ break;
+ case "duespaid":
+ try {
+ memberInfoToUpdate.setDuesPaid(Double.parseDouble(newValue.toString()));
+ } catch (NumberFormatException e) {
+ System.out.println("无效会费金额: " + newValue);
+ return false;
+ }
+ break;
+ default:
+ System.out.println("无效字段: " + field);
+ return false;
+ }
+ System.out.println("成员信息更新成功: " + memberInfoToUpdate);
+ return true;
+ } else {
+ System.out.println("未找到成员ID: " + memberId);
+ return false;
+ }
+ }
+
+ // 查询成员信息
+ public MemberInfo findMemberInfoById(String memberId) {
+ for (MemberInfo memberInfo : memberInfos) {
+ if (memberInfo.getMemberId().equals(memberId)) {
+ System.out.println("成员信息查询成功: " + memberInfo);
+ return memberInfo;
+ }
+ }
+ System.out.println("未找到成员ID: " + memberId);
+ return null;
+ }
+
+ // 显示所有成员信息
+ public void displayAllMemberInfos() {
+ if (memberInfos.isEmpty()) {
+ System.out.println("当前没有成员信息记录");
+ } else {
+ System.out.println("所有成员信息:");
+ for (MemberInfo memberInfo : memberInfos) {
+ System.out.println(memberInfo);
+ }
+ }
+ }
+
+ // 处理新成员加入
+ public boolean addNewMember(String memberId, String name, String gender, int age, String contact, String joinDate, String role, double duesPaid) {
+ MemberInfo newMember = new MemberInfo(memberId, name, gender, age, contact, joinDate, role, duesPaid);
+ return addMemberInfo(newMember);
+ }
+
+ // 生成唯一的ID
+ private String generateUniqueId() {
+ return "MEM" + System.currentTimeMillis();
+ }
+
+ // 主方法演示功能
+ public static void main(String[] args) {
+ STcy manager = new STcy();
+
+ // 添加成员信息
+ manager.addNewMember("MEM001", "张三", "男", 25, "1234567890", "2023-11-01", "leader", 100.0);
+ manager.addNewMember("MEM002", "李四", "女", 22, "0987654321", "2023-11-02", "member", 50.0);
+
+ // 显示所有成员信息
+ manager.displayAllMemberInfos();
+
+ // 处理新成员加入
+ manager.addNewMember("MEM003", "王五", "男", 23, "1122334455", "2023-11-03", "guest", 0.0);
+
+ // 再次显示所有成员信息
+ manager.displayAllMemberInfos();
+
+ // 更新成员信息
+ manager.updateMemberInfo("MEM001", "age", 26);
+ manager.updateMemberInfo("MEM002", "role", "leader");
+ manager.updateMemberInfo("MEM003", "duespaid", 20.0);
+
+ // 再次显示所有成员信息
+ manager.displayAllMemberInfos();
+
+ // 删除成员信息
+ manager.deleteMemberInfo("MEM002");
+
+ // 再次显示所有成员信息
+ manager.displayAllMemberInfos();
+ }
+}
+
diff --git a/server/src/main/java/self/cases/teams/teaa/STgeren.java b/server/src/main/java/self/cases/teams/teaa/STgeren.java
new file mode 100644
index 00000000..f3f5a8c8
--- /dev/null
+++ b/server/src/main/java/self/cases/teams/teaa/STgeren.java
@@ -0,0 +1,189 @@
+package self.cases.teams.teaa;
+import java.util.ArrayList;
+import java.util.List;
+
+// 定义社团成员类
+class Member {
+ private String memberId;
+ private String name;
+ private String email;
+ private String phoneNumber;
+ private String position;
+ private String department;
+
+ public Member(String memberId, String name, String email, String phoneNumber, String position, String department) {
+ this.memberId = memberId;
+ this.name = name;
+ this.email = email;
+ this.phoneNumber = phoneNumber;
+ this.position = position;
+ this.department = department;
+ }
+
+ public String getMemberId() {
+ return memberId;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ public String getPhoneNumber() {
+ return phoneNumber;
+ }
+
+ public void setPhoneNumber(String phoneNumber) {
+ this.phoneNumber = phoneNumber;
+ }
+
+ public String getPosition() {
+ return position;
+ }
+
+ public void setPosition(String position) {
+ this.position = position;
+ }
+
+ public String getDepartment() {
+ return department;
+ }
+
+ public void setDepartment(String department) {
+ this.department = department;
+ }
+
+ @Override
+ public String toString() {
+ return "Member{" +
+ "memberId='" + memberId + '\\' +
+ ", name='" + name + '\\' +
+ ", email='" + email + '\\' +
+ ", phoneNumber='" + phoneNumber + '\\' +
+ ", position='" + position + '\\' +
+ ", department='" + department + '\\' +
+ '}';
+ }
+}
+
+// 社团管理系统个人资料管理类
+public class STgeren {
+ // 模拟数据库
+ private List members = new ArrayList<>();
+
+ // 添加成员
+ public boolean addMember(Member member) {
+ if (findMemberById(member.getMemberId()) == null) {
+ members.add(member);
+ System.out.println("成员添加成功: " + member);
+ return true;
+ } else {
+ System.out.println("成员ID已存在,无法添加: " + member.getMemberId());
+ return false;
+ }
+ }
+
+ // 删除成员
+ public boolean deleteMember(String memberId) {
+ Member memberToRemove = findMemberById(memberId);
+ if (memberToRemove != null) {
+ members.remove(memberToRemove);
+ System.out.println("成员删除成功: " + memberToRemove);
+ return true;
+ } else {
+ System.out.println("未找到成员ID: " + memberId);
+ return false;
+ }
+ }
+
+ // 更新成员信息
+ public boolean updateMember(String memberId, String field, String newValue) {
+ Member memberToUpdate = findMemberById(memberId);
+ if (memberToUpdate != null) {
+ switch (field.toLowerCase()) {
+ case "name":
+ memberToUpdate.setName(newValue);
+ break;
+ case "email":
+ memberToUpdate.setEmail(newValue);
+ break;
+ case "phonenumber":
+ memberToUpdate.setPhoneNumber(newValue);
+ break;
+ case "position":
+ memberToUpdate.setPosition(newValue);
+ break;
+ case "department":
+ memberToUpdate.setDepartment(newValue);
+ break;
+ default:
+ System.out.println("无效字段: " + field);
+ return false;
+ }
+ System.out.println("成员信息更新成功: " + memberToUpdate);
+ return true;
+ } else {
+ System.out.println("未找到成员ID: " + memberId);
+ return false;
+ }
+ }
+
+ // 查询成员信息
+ public Member findMemberById(String memberId) {
+ for (Member member : members) {
+ if (member.getMemberId().equals(memberId)) {
+ System.out.println("成员信息查询成功: " + member);
+ return member;
+ }
+ }
+ System.out.println("未找到成员ID: " + memberId);
+ return null;
+ }
+
+ // 显示所有成员
+ public void displayAllMembers() {
+ if (members.isEmpty()) {
+ System.out.println("当前没有成员记录");
+ } else {
+ System.out.println("所有成员信息:");
+ for (Member member : members) {
+ System.out.println(member);
+ }
+ }
+ }
+
+ // 主方法演示功能
+ public static void main(String[] args) {
+ STgeren manager = new STgeren();
+
+ // 添加成员
+ manager.addMember(new Member("M001", "张三", "zhangsan@example.com", "1234567890", "主席", "行政部"));
+ manager.addMember(new Member("M002", "李四", "lisi@example.com", "0987654321", "秘书", "财务部"));
+
+ // 显示所有成员
+ manager.displayAllMembers();
+
+ // 查询成员
+ manager.findMemberById("M001");
+
+ // 更新成员信息
+ manager.updateMember("M001", "email", "zhangsan_new@example.com");
+
+ // 删除成员
+ manager.deleteMember("M002");
+
+ // 再次显示所有成员
+ manager.displayAllMembers();
+ }
+}
diff --git a/server/src/main/java/self/cases/teams/teaa/STjf.java b/server/src/main/java/self/cases/teams/teaa/STjf.java
new file mode 100644
index 00000000..58c97366
--- /dev/null
+++ b/server/src/main/java/self/cases/teams/teaa/STjf.java
@@ -0,0 +1,194 @@
+package self.cases.teams.teaa;
+
+import java.util.ArrayList;
+import java.util.List;
+
+// 定义缴费信息类
+class PaymentInfo {
+ private String paymentId;
+ private String participantId;
+ private double amount;
+ private String paymentDate;
+ private String status; // "paid", "pending", "refunded"
+
+ public PaymentInfo(String paymentId, String participantId, double amount, String paymentDate, String status) {
+ this.paymentId = paymentId;
+ this.participantId = participantId;
+ this.amount = amount;
+ this.paymentDate = paymentDate;
+ this.status = status;
+ }
+
+ public String getPaymentId() {
+ return paymentId;
+ }
+
+ public String getParticipantId() {
+ return participantId;
+ }
+
+ public void setParticipantId(String participantId) {
+ this.participantId = participantId;
+ }
+
+ public double getAmount() {
+ return amount;
+ }
+
+ public void setAmount(double amount) {
+ this.amount = amount;
+ }
+
+ public String getPaymentDate() {
+ return paymentDate;
+ }
+
+ public void setPaymentDate(String paymentDate) {
+ this.paymentDate = paymentDate;
+ }
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
+ @Override
+ public String toString() {
+ return "PaymentInfo{" +
+ "paymentId='" + paymentId + '\\' +
+ ", participantId='" + participantId + '\\' +
+ ", amount=" + amount +
+ ", paymentDate='" + paymentDate + '\\' +
+ ", status='" + status + '\\' +
+ '}';
+ }
+}
+
+// 社团管理系统缴费信息管理类
+public class STjf {
+ // 模拟数据库
+ private List paymentInfos = new ArrayList<>();
+
+ // 添加缴费信息
+ public boolean addPaymentInfo(PaymentInfo paymentInfo) {
+ if (findPaymentInfoById(paymentInfo.getPaymentId()) == null) {
+ paymentInfos.add(paymentInfo);
+ System.out.println("缴费信息添加成功: " + paymentInfo);
+ return true;
+ } else {
+ System.out.println("缴费信息ID已存在,无法添加: " + paymentInfo.getPaymentId());
+ return false;
+ }
+ }
+
+ // 删除缴费信息
+ public boolean deletePaymentInfo(String paymentId) {
+ PaymentInfo paymentInfoToRemove = findPaymentInfoById(paymentId);
+ if (paymentInfoToRemove != null) {
+ paymentInfos.remove(paymentInfoToRemove);
+ System.out.println("缴费信息删除成功: " + paymentInfoToRemove);
+ return true;
+ } else {
+ System.out.println("未找到缴费信息ID: " + paymentId);
+ return false;
+ }
+ }
+
+ // 更新缴费信息
+ public boolean updatePaymentInfo(String paymentId, String field, Object newValue) {
+ PaymentInfo paymentInfoToUpdate = findPaymentInfoById(paymentId);
+ if (paymentInfoToUpdate != null) {
+ switch (field.toLowerCase()) {
+ case "amount":
+ try {
+ paymentInfoToUpdate.setAmount(Double.parseDouble(newValue.toString()));
+ } catch (NumberFormatException e) {
+ System.out.println("无效金额: " + newValue);
+ return false;
+ }
+ break;
+ case "status":
+ paymentInfoToUpdate.setStatus(newValue.toString());
+ break;
+ default:
+ System.out.println("无效字段: " + field);
+ return false;
+ }
+ System.out.println("缴费信息更新成功: " + paymentInfoToUpdate);
+ return true;
+ } else {
+ System.out.println("未找到缴费信息ID: " + paymentId);
+ return false;
+ }
+ }
+
+ // 查询缴费信息
+ public PaymentInfo findPaymentInfoById(String paymentId) {
+ for (PaymentInfo paymentInfo : paymentInfos) {
+ if (paymentInfo.getPaymentId().equals(paymentId)) {
+ System.out.println("缴费信息查询成功: " + paymentInfo);
+ return paymentInfo;
+ }
+ }
+ System.out.println("未找到缴费信息ID: " + paymentId);
+ return null;
+ }
+
+ // 显示所有缴费信息
+ public void displayAllPaymentInfos() {
+ if (paymentInfos.isEmpty()) {
+ System.out.println("当前没有缴费信息记录");
+ } else {
+ System.out.println("所有缴费信息:");
+ for (PaymentInfo paymentInfo : paymentInfos) {
+ System.out.println(paymentInfo);
+ }
+ }
+ }
+
+ // 处理参与者缴费
+ public boolean processPayment(String participantId, double amount, String paymentDate) {
+ PaymentInfo paymentInfo = new PaymentInfo(generateUniqueId(), participantId, amount, paymentDate, "paid");
+ return addPaymentInfo(paymentInfo);
+ }
+
+ // 生成唯一的ID
+ private String generateUniqueId() {
+ return "PMT" + System.currentTimeMillis();
+ }
+
+ // 主方法演示功能
+ public static void main(String[] args) {
+ STjf manager = new STjf();
+
+ // 添加缴费信息
+ manager.addPaymentInfo(new PaymentInfo("PMT001", "P001", 50.0, "2023-11-01", "paid"));
+ manager.addPaymentInfo(new PaymentInfo("PMT002", "P002", 30.0, "2023-11-02", "pending"));
+
+ // 显示所有缴费信息
+ manager.displayAllPaymentInfos();
+
+ // 处理参与者缴费
+ manager.processPayment("P003", 70.0, "2023-11-03");
+
+ // 再次显示所有缴费信息
+ manager.displayAllPaymentInfos();
+
+ // 更新缴费信息
+ manager.updatePaymentInfo("PMT001", "amount", 60.0);
+ manager.updatePaymentInfo("PMT002", "status", "paid");
+
+ // 再次显示所有缴费信息
+ manager.displayAllPaymentInfos();
+
+ // 删除缴费信息
+ manager.deletePaymentInfo("PMT002");
+
+ // 再次显示所有缴费信息
+ manager.displayAllPaymentInfos();
+ }
+}
+
diff --git a/server/src/main/java/self/cases/teams/teaa/STjh.java b/server/src/main/java/self/cases/teams/teaa/STjh.java
new file mode 100644
index 00000000..8cf49137
--- /dev/null
+++ b/server/src/main/java/self/cases/teams/teaa/STjh.java
@@ -0,0 +1,385 @@
+package self.cases.teams.teaa;
+
+import java.util.ArrayList;
+import java.util.List;
+
+// 定义活动类
+class Activity {
+ private String activityId;
+ private String name;
+ private String description;
+ private String organizer;
+ private String location;
+ private String startDate;
+ private String endDate;
+ private int maxParticipants;
+
+ public Activity(String activityId, String name, String description, String organizer, String location, String startDate, String endDate, int maxParticipants) {
+ this.activityId = activityId;
+ this.name = name;
+ this.description = description;
+ this.organizer = organizer;
+ this.location = location;
+ this.startDate = startDate;
+ this.endDate = endDate;
+ this.maxParticipants = maxParticipants;
+ }
+
+ public String getActivityId() {
+ return activityId;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public String getOrganizer() {
+ return organizer;
+ }
+
+ public String getLocation() {
+ return location;
+ }
+
+ public String getStartDate() {
+ return startDate;
+ }
+
+ public String getEndDate() {
+ return endDate;
+ }
+
+ public int getMaxParticipants() {
+ return maxParticipants;
+ }
+
+ public void setMaxParticipants(int maxParticipants) {
+ this.maxParticipants = maxParticipants;
+ }
+
+ @Override
+ public String toString() {
+ return "Activity{" +
+ "activityId='" + activityId + '\\' +
+ ", name='" + name + '\\' +
+ ", description='" + description + '\\' +
+ ", organizer='" + organizer + '\\' +
+ ", location='" + location + '\\' +
+ ", startDate='" + startDate + '\\' +
+ ", endDate='" + endDate + '\\' +
+ ", maxParticipants=" + maxParticipants +
+ '}';
+ }
+
+ public void setName(String newValue) {
+ }
+
+ public void setDescription(String newValue) {
+ }
+
+ public void setOrganizer(String newValue) {
+ }
+
+ public void setLocation(String newValue) {
+ }
+
+ public void setStartDate(String newValue) {
+ }
+
+ public void setEndDate(String newValue) {
+ }
+}
+
+// 定义参与者类
+class Participant {
+ private String participantId;
+ private String name;
+ private String email;
+ private String phoneNumber;
+ private String reason;
+
+ public Participant(String participantId, String name, String email, String phoneNumber, String reason) {
+ this.participantId = participantId;
+ this.name = name;
+ this.email = email;
+ this.phoneNumber = phoneNumber;
+ this.reason = reason;
+ }
+
+ public String getParticipantId() {
+ return participantId;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ public String getPhoneNumber() {
+ return phoneNumber;
+ }
+
+ public void setPhoneNumber(String phoneNumber) {
+ this.phoneNumber = phoneNumber;
+ }
+
+ public String getReason() {
+ return reason;
+ }
+
+ public void setReason(String reason) {
+ this.reason = reason;
+ }
+
+ @Override
+ public String toString() {
+ return "Participant{" +
+ "participantId='" + participantId + '\\' +
+ ", name='" + name + '\\' +
+ ", email='" + email + '\\' +
+ ", phoneNumber='" + phoneNumber + '\\' +
+ ", reason='" + reason + '\\' +
+ '}';
+ }
+}
+
+// 社团管理系统加入活动类
+public class STjh {
+ // 模拟数据库
+ private List activities = new ArrayList<>();
+ private List participants = new ArrayList<>();
+
+ // 添加活动
+ public boolean addActivity(Activity activity) {
+ if (findActivityById(activity.getActivityId()) == null) {
+ activities.add(activity);
+ System.out.println("活动添加成功: " + activity);
+ return true;
+ } else {
+ System.out.println("活动ID已存在,无法添加: " + activity.getActivityId());
+ return false;
+ }
+ }
+
+ // 删除活动
+ public boolean deleteActivity(String activityId) {
+ Activity activityToRemove = findActivityById(activityId);
+ if (activityToRemove != null) {
+ activities.remove(activityToRemove);
+ System.out.println("活动删除成功: " + activityToRemove);
+ return true;
+ } else {
+ System.out.println("未找到活动ID: " + activityId);
+ return false;
+ }
+ }
+
+ // 更新活动信息
+ public boolean updateActivity(String activityId, String field, String newValue) {
+ Activity activityToUpdate = findActivityById(activityId);
+ if (activityToUpdate != null) {
+ switch (field.toLowerCase()) {
+ case "name":
+ activityToUpdate.setName(newValue);
+ break;
+ case "description":
+ activityToUpdate.setDescription(newValue);
+ break;
+ case "organizer":
+ activityToUpdate.setOrganizer(newValue);
+ break;
+ case "location":
+ activityToUpdate.setLocation(newValue);
+ break;
+ case "startdate":
+ activityToUpdate.setStartDate(newValue);
+ break;
+ case "enddate":
+ activityToUpdate.setEndDate(newValue);
+ break;
+ case "maxparticipants":
+ try {
+ activityToUpdate.setMaxParticipants(Integer.parseInt(newValue));
+ } catch (NumberFormatException e) {
+ System.out.println("无效的最大参与人数: " + newValue);
+ return false;
+ }
+ break;
+ default:
+ System.out.println("无效字段: " + field);
+ return false;
+ }
+ System.out.println("活动信息更新成功: " + activityToUpdate);
+ return true;
+ } else {
+ System.out.println("未找到活动ID: " + activityId);
+ return false;
+ }
+ }
+
+ // 查询活动信息
+ public Activity findActivityById(String activityId) {
+ for (Activity activity : activities) {
+ if (activity.getActivityId().equals(activityId)) {
+ System.out.println("活动信息查询成功: " + activity);
+ return activity;
+ }
+ }
+ System.out.println("未找到活动ID: " + activityId);
+ return null;
+ }
+
+ // 显示所有活动
+ public void displayAllActivities() {
+ if (activities.isEmpty()) {
+ System.out.println("当前没有活动记录");
+ } else {
+ System.out.println("所有活动信息:");
+ for (Activity activity : activities) {
+ System.out.println(activity);
+ }
+ }
+ }
+
+ // 添加参与者
+ public boolean addParticipant(Participant participant) {
+ if (findParticipantById(participant.getParticipantId()) == null) {
+ participants.add(participant);
+ System.out.println("参与者添加成功: " + participant);
+ return true;
+ } else {
+ System.out.println("参与者ID已存在,无法添加: " + participant.getParticipantId());
+ return false;
+ }
+ }
+
+ // 删除参与者
+ public boolean deleteParticipant(String participantId) {
+ Participant participantToRemove = findParticipantById(participantId);
+ if (participantToRemove != null) {
+ participants.remove(participantToRemove);
+ System.out.println("参与者删除成功: " + participantToRemove);
+ return true;
+ } else {
+ System.out.println("未找到参与者ID: " + participantId);
+ return false;
+ }
+ }
+
+ // 更新参与者信息
+ public boolean updateParticipant(String participantId, String field, String newValue) {
+ Participant participantToUpdate = findParticipantById(participantId);
+ if (participantToUpdate != null) {
+ switch (field.toLowerCase()) {
+ case "name":
+ participantToUpdate.setName(newValue);
+ break;
+ case "email":
+ participantToUpdate.setEmail(newValue);
+ break;
+ case "phonenumber":
+ participantToUpdate.setPhoneNumber(newValue);
+ break;
+ case "reason":
+ participantToUpdate.setReason(newValue);
+ break;
+ default:
+ System.out.println("无效字段: " + field);
+ return false;
+ }
+ System.out.println("参与者信息更新成功: " + participantToUpdate);
+ return true;
+ } else {
+ System.out.println("未找到参与者ID: " + participantId);
+ return false;
+ }
+ }
+
+ // 查询参与者信息
+ public Participant findParticipantById(String participantId) {
+ for (Participant participant : participants) {
+ if (participant.getParticipantId().equals(participantId)) {
+ System.out.println("参与者信息查询成功: " + participant);
+ return participant;
+ }
+ }
+ System.out.println("未找到参与者ID: " + participantId);
+ return null;
+ }
+
+ // 显示所有参与者
+ public void displayAllParticipants() {
+ if (participants.isEmpty()) {
+ System.out.println("当前没有参与者记录");
+ } else {
+ System.out.println("所有参与者信息:");
+ for (Participant participant : participants) {
+ System.out.println(participant);
+ }
+ }
+ }
+
+ // 处理参与者加入活动
+ public boolean joinActivity(String participantId, String activityId) {
+ Participant participant = findParticipantById(participantId);
+ Activity activity = findActivityById(activityId);
+
+ if (participant == null || activity == null) {
+ System.out.println("参与者或活动不存在");
+ return false;
+ }
+
+ if (activity.getMaxParticipants() <= 0) {
+ System.out.println("活动已满员,无法接受新参与者");
+ return false;
+ }
+
+ activity.setMaxParticipants(activity.getMaxParticipants() - 1);
+ System.out.println("参与者成功加入活动: " + participant.getName() + " 加入了活动 " + activity.getName());
+ return true;
+ }
+
+ // 主方法演示功能
+ public static void main(String[] args) {
+ STjh manager = new STjh();
+
+ // 添加活动
+ manager.addActivity(new Activity("A001", "编程竞赛", "编程技能提升比赛", "王五", "教学楼A101", "2023-11-01", "2023-11-02", 50));
+ manager.addActivity(new Activity("A002", "舞蹈比赛", "舞蹈技巧展示比赛", "赵六", "礼堂B201", "2023-11-05", "2023-11-06", 30));
+
+ // 显示所有活动
+ manager.displayAllActivities();
+
+ // 添加参与者
+ manager.addParticipant(new Participant("P001", "张三", "zhangsan@example.com", "1234567890", "对编程感兴趣"));
+ manager.addParticipant(new Participant("P002", "李四", "lisi@example.com", "0987654321", "喜欢跳舞"));
+
+ // 显示所有参与者
+ manager.displayAllParticipants();
+
+ // 处理参与者加入活动
+ manager.joinActivity("P001", "A001");
+
+ // 再次显示所有活动
+ manager.displayAllActivities();
+
+ // 再次显示所有参与者
+ manager.displayAllParticipants();
+ }
+}
+
diff --git a/server/src/main/java/self/cases/teams/teaa/STjr.java b/server/src/main/java/self/cases/teams/teaa/STjr.java
new file mode 100644
index 00000000..1ec70daf
--- /dev/null
+++ b/server/src/main/java/self/cases/teams/teaa/STjr.java
@@ -0,0 +1,345 @@
+package self.cases.teams.teaa;
+
+import java.util.ArrayList;
+import java.util.List;
+
+// 定义社团类
+class Club {
+ private String clubId;
+ private String name;
+ private String description;
+ private String president;
+ private int maxMembers;
+
+ public Club(String clubId, String name, String description, String president, int maxMembers) {
+ this.clubId = clubId;
+ this.name = name;
+ this.description = description;
+ this.president = president;
+ this.maxMembers = maxMembers;
+ }
+
+ public String getClubId() {
+ return clubId;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public String getPresident() {
+ return president;
+ }
+
+ public int getMaxMembers() {
+ return maxMembers;
+ }
+
+ public void setMaxMembers(int maxMembers) {
+ this.maxMembers = maxMembers;
+ }
+
+ @Override
+ public String toString() {
+ return "Club{" +
+ "clubId='" + clubId + '\\' +
+ ", name='" + name + '\\' +
+ ", description='" + description + '\\' +
+ ", president='" + president + '\\' +
+ ", maxMembers=" + maxMembers +
+ '}';
+ }
+
+ public void setName(String newValue) {
+ }
+
+ public void setDescription(String newValue) {
+ }
+
+ public void setPresident(String newValue) {
+ }
+}
+
+// 定义申请者类
+class Applicant {
+ private String applicantId;
+ private String name;
+ private String email;
+ private String phoneNumber;
+ private String reason;
+
+ public Applicant(String applicantId, String name, String email, String phoneNumber, String reason) {
+ this.applicantId = applicantId;
+ this.name = name;
+ this.email = email;
+ this.phoneNumber = phoneNumber;
+ this.reason = reason;
+ }
+
+ public String getApplicantId() {
+ return applicantId;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ public String getPhoneNumber() {
+ return phoneNumber;
+ }
+
+ public void setPhoneNumber(String phoneNumber) {
+ this.phoneNumber = phoneNumber;
+ }
+
+ public String getReason() {
+ return reason;
+ }
+
+ public void setReason(String reason) {
+ this.reason = reason;
+ }
+
+ @Override
+ public String toString() {
+ return "Applicant{" +
+ "applicantId='" + applicantId + '\\' +
+ ", name='" + name + '\\' +
+ ", email='" + email + '\\' +
+ ", phoneNumber='" + phoneNumber + '\\' +
+ ", reason='" + reason + '\\' +
+ '}';
+ }
+}
+
+// 社团管理系统申请加入社团类
+public class STjr {
+ // 模拟数据库
+ private List clubs = new ArrayList<>();
+ private List applicants = new ArrayList<>();
+
+ // 添加社团
+ public boolean addClub(Club club) {
+ if (findClubById(club.getClubId()) == null) {
+ clubs.add(club);
+ System.out.println("社团添加成功: " + club);
+ return true;
+ } else {
+ System.out.println("社团ID已存在,无法添加: " + club.getClubId());
+ return false;
+ }
+ }
+
+ // 删除社团
+ public boolean deleteClub(String clubId) {
+ Club clubToRemove = findClubById(clubId);
+ if (clubToRemove != null) {
+ clubs.remove(clubToRemove);
+ System.out.println("社团删除成功: " + clubToRemove);
+ return true;
+ } else {
+ System.out.println("未找到社团ID: " + clubId);
+ return false;
+ }
+ }
+
+ // 更新社团信息
+ public boolean updateClub(String clubId, String field, String newValue) {
+ Club clubToUpdate = findClubById(clubId);
+ if (clubToUpdate != null) {
+ switch (field.toLowerCase()) {
+ case "name":
+ clubToUpdate.setName(newValue);
+ break;
+ case "description":
+ clubToUpdate.setDescription(newValue);
+ break;
+ case "president":
+ clubToUpdate.setPresident(newValue);
+ break;
+ case "maxmembers":
+ try {
+ clubToUpdate.setMaxMembers(Integer.parseInt(newValue));
+ } catch (NumberFormatException e) {
+ System.out.println("无效的最大成员数: " + newValue);
+ return false;
+ }
+ break;
+ default:
+ System.out.println("无效字段: " + field);
+ return false;
+ }
+ System.out.println("社团信息更新成功: " + clubToUpdate);
+ return true;
+ } else {
+ System.out.println("未找到社团ID: " + clubId);
+ return false;
+ }
+ }
+
+ // 查询社团信息
+ public Club findClubById(String clubId) {
+ for (Club club : clubs) {
+ if (club.getClubId().equals(clubId)) {
+ System.out.println("社团信息查询成功: " + club);
+ return club;
+ }
+ }
+ System.out.println("未找到社团ID: " + clubId);
+ return null;
+ }
+
+ // 显示所有社团
+ public void displayAllClubs() {
+ if (clubs.isEmpty()) {
+ System.out.println("当前没有社团记录");
+ } else {
+ System.out.println("所有社团信息:");
+ for (Club club : clubs) {
+ System.out.println(club);
+ }
+ }
+ }
+
+ // 添加申请者
+ public boolean addApplicant(Applicant applicant) {
+ if (findApplicantById(applicant.getApplicantId()) == null) {
+ applicants.add(applicant);
+ System.out.println("申请者添加成功: " + applicant);
+ return true;
+ } else {
+ System.out.println("申请者ID已存在,无法添加: " + applicant.getApplicantId());
+ return false;
+ }
+ }
+
+ // 删除申请者
+ public boolean deleteApplicant(String applicantId) {
+ Applicant applicantToRemove = findApplicantById(applicantId);
+ if (applicantToRemove != null) {
+ applicants.remove(applicantToRemove);
+ System.out.println("申请者删除成功: " + applicantToRemove);
+ return true;
+ } else {
+ System.out.println("未找到申请者ID: " + applicantId);
+ return false;
+ }
+ }
+
+ // 更新申请者信息
+ public boolean updateApplicant(String applicantId, String field, String newValue) {
+ Applicant applicantToUpdate = findApplicantById(applicantId);
+ if (applicantToUpdate != null) {
+ switch (field.toLowerCase()) {
+ case "name":
+ applicantToUpdate.setName(newValue);
+ break;
+ case "email":
+ applicantToUpdate.setEmail(newValue);
+ break;
+ case "phonenumber":
+ applicantToUpdate.setPhoneNumber(newValue);
+ break;
+ case "reason":
+ applicantToUpdate.setReason(newValue);
+ break;
+ default:
+ System.out.println("无效字段: " + field);
+ return false;
+ }
+ System.out.println("申请者信息更新成功: " + applicantToUpdate);
+ return true;
+ } else {
+ System.out.println("未找到申请者ID: " + applicantId);
+ return false;
+ }
+ }
+
+ // 查询申请者信息
+ public Applicant findApplicantById(String applicantId) {
+ for (Applicant applicant : applicants) {
+ if (applicant.getApplicantId().equals(applicantId)) {
+ System.out.println("申请者信息查询成功: " + applicant);
+ return applicant;
+ }
+ }
+ System.out.println("未找到申请者ID: " + applicantId);
+ return null;
+ }
+
+ // 显示所有申请者
+ public void displayAllApplicants() {
+ if (applicants.isEmpty()) {
+ System.out.println("当前没有申请者记录");
+ } else {
+ System.out.println("所有申请者信息:");
+ for (Applicant applicant : applicants) {
+ System.out.println(applicant);
+ }
+ }
+ }
+
+ // 处理申请
+ public boolean processApplication(String applicantId, String clubId) {
+ Applicant applicant = findApplicantById(applicantId);
+ Club club = findClubById(clubId);
+
+ if (applicant == null || club == null) {
+ System.out.println("申请者或社团不存在");
+ return false;
+ }
+
+ if (club.getMaxMembers() <= 0) {
+ System.out.println("社团已满员,无法接受新成员");
+ return false;
+ }
+
+ club.setMaxMembers(club.getMaxMembers() - 1);
+ System.out.println("申请成功: " + applicant.getName() + " 已加入社团 " + club.getName());
+ return true;
+ }
+
+ // 主方法演示功能
+ public static void main(String[] args) {
+ STjr manager = new STjr();
+
+ // 添加社团
+ manager.addClub(new Club("C001", "编程俱乐部", "专注于编程学习和项目开发", "王五", 20));
+ manager.addClub(new Club("C002", "舞蹈俱乐部", "提供各种舞蹈课程和表演机会", "赵六", 15));
+
+ // 显示所有社团
+ manager.displayAllClubs();
+
+ // 添加申请者
+ manager.addApplicant(new Applicant("A001", "张三", "zhangsan@example.com", "1234567890", "对编程感兴趣"));
+ manager.addApplicant(new Applicant("A002", "李四", "lisi@example.com", "0987654321", "喜欢跳舞"));
+
+ // 显示所有申请者
+ manager.displayAllApplicants();
+
+ // 处理申请
+ manager.processApplication("A001", "C001");
+
+ // 再次显示所有社团
+ manager.displayAllClubs();
+
+ // 再次显示所有申请者
+ manager.displayAllApplicants();
+ }
+}
diff --git a/server/src/main/java/self/cases/teams/teaa/STxtgl.java b/server/src/main/java/self/cases/teams/teaa/STxtgl.java
new file mode 100644
index 00000000..82860185
--- /dev/null
+++ b/server/src/main/java/self/cases/teams/teaa/STxtgl.java
@@ -0,0 +1,268 @@
+package self.cases.teams.teaa;
+
+import java.util.ArrayList;
+import java.util.List;
+
+// 定义用户信息类
+class UserInfo {
+ private String userId;
+ private String username;
+ private String password;
+ private String email;
+ private String phone;
+ private String role; // "admin", "moderator", "user"
+ private boolean isActive;
+
+ public UserInfo(String userId, String username, String password, String email, String phone, String role, boolean isActive) {
+ this.userId = userId;
+ this.username = username;
+ this.password = password;
+ this.email = email;
+ this.phone = phone;
+ this.role = role;
+ this.isActive = isActive;
+ }
+
+ public String getUserId() {
+ return userId;
+ }
+
+ 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 getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public String getRole() {
+ return role;
+ }
+
+ public void setRole(String role) {
+ this.role = role;
+ }
+
+ public boolean isActive() {
+ return isActive;
+ }
+
+ public void setActive(boolean active) {
+ isActive = active;
+ }
+
+ @Override
+ public String toString() {
+ return "UserInfo{" +
+ "userId='" + userId + '\\' +
+ ", username='" + username + '\\' +
+ ", password='" + password + '\\' +
+ ", email='" + email + '\\' +
+ ", phone='" + phone + '\\' +
+ ", role='" + role + '\\' +
+ ", isActive=" + isActive +
+ '}';
+ }
+}
+
+// 社团管理系统社团系统用户管理类
+public class STxtgl {
+ // 模拟数据库
+ private List userInfos = new ArrayList<>();
+
+ // 注册新用户
+ public boolean registerUser(String username, String password, String email, String phone, String role) {
+ if (findUserByUsername(username) == null) {
+ String userId = generateUniqueId();
+ UserInfo newUser = new UserInfo(userId, username, password, email, phone, role, true);
+ userInfos.add(newUser);
+ System.out.println("用户注册成功: " + newUser);
+ return true;
+ } else {
+ System.out.println("用户名已存在,无法注册: " + username);
+ return false;
+ }
+ }
+
+ // 登录用户
+ public boolean login(String username, String password) {
+ UserInfo userToLogin = findUserByUsernameAndPassword(username, password);
+ if (userToLogin != null && userToLogin.isActive()) {
+ System.out.println("用户登录成功: " + userToLogin);
+ return true;
+ } else {
+ System.out.println("用户名或密码错误,登录失败");
+ return false;
+ }
+ }
+
+ // 查找用户
+ private UserInfo findUserByUsername(String username) {
+ for (UserInfo userInfo : userInfos) {
+ if (userInfo.getUsername().equals(username)) {
+ System.out.println("用户查找成功: " + userInfo);
+ return userInfo;
+ }
+ }
+ System.out.println("未找到用户: " + username);
+ return null;
+ }
+
+ private UserInfo findUserByUsernameAndPassword(String username, String password) {
+ for (UserInfo userInfo : userInfos) {
+ if (userInfo.getUsername().equals(username) && userInfo.getPassword().equals(password)) {
+ return userInfo;
+ }
+ }
+ System.out.println("未找到用户或密码错误");
+ return null;
+ }
+
+ // 删除用户
+ public boolean deleteUser(String userId) {
+ UserInfo userToRemove = findUserById(userId);
+ if (userToRemove != null) {
+ userInfos.remove(userToRemove);
+ System.out.println("用户删除成功: " + userToRemove);
+ return true;
+ } else {
+ System.out.println("未找到用户ID: " + userId);
+ return false;
+ }
+ }
+
+ // 更新用户信息
+ public boolean updateUser(String userId, String field, Object newValue) {
+ UserInfo userToUpdate = findUserById(userId);
+ if (userToUpdate != null) {
+ switch (field.toLowerCase()) {
+ case "username":
+ userToUpdate.setUsername(newValue.toString());
+ break;
+ case "password":
+ userToUpdate.setPassword(newValue.toString());
+ break;
+ case "email":
+ userToUpdate.setEmail(newValue.toString());
+ break;
+ case "phone":
+ userToUpdate.setPhone(newValue.toString());
+ break;
+ case "role":
+ userToUpdate.setRole(newValue.toString());
+ break;
+ case "active":
+ try {
+ userToUpdate.setActive(Boolean.parseBoolean(newValue.toString()));
+ } catch (Exception e) {
+ System.out.println("无效的活动状态: " + newValue);
+ return false;
+ }
+ break;
+ default:
+ System.out.println("无效字段: " + field);
+ return false;
+ }
+ System.out.println("用户信息更新成功: " + userToUpdate);
+ return true;
+ } else {
+ System.out.println("未找到用户ID: " + userId);
+ return false;
+ }
+ }
+
+ // 查询用户
+ public UserInfo findUserById(String userId) {
+ for (UserInfo userInfo : userInfos) {
+ if (userInfo.getUserId().equals(userId)) {
+ System.out.println("用户查找成功: " + userInfo);
+ return userInfo;
+ }
+ }
+ System.out.println("未找到用户ID: " + userId);
+ return null;
+ }
+
+ // 显示所有用户信息
+ public void displayAllUsers() {
+ if (userInfos.isEmpty()) {
+ System.out.println("当前没有用户信息记录");
+ } else {
+ System.out.println("所有用户信息:");
+ for (UserInfo userInfo : userInfos) {
+ System.out.println(userInfo);
+ }
+ }
+ }
+
+ // 处理新用户注册
+ public boolean addNewUser(String username, String password, String email, String phone, String role) {
+ return registerUser(username, password, email, phone, role);
+ }
+
+ // 生成唯一的ID
+ private String generateUniqueId() {
+ return "USR" + System.currentTimeMillis();
+ }
+
+ // 主方法演示功能
+ public static void main(String[] args) {
+ STxtgl manager = new STxtgl();
+
+ // 注册新用户
+ manager.addNewUser("zhangsan", "123456", "zhangsan@example.com", "1234567890", "user");
+ manager.addNewUser("lisi", "abcdef", "lisi@example.com", "0987654321", "moderator");
+
+ // 显示所有用户信息
+ manager.displayAllUsers();
+
+ // 处理新用户注册
+ manager.addNewUser("wangwu", "qwerty", "wangwu@example.com", "1122334455", "admin");
+
+ // 再次显示所有用户信息
+ manager.displayAllUsers();
+
+ // 登录用户
+ manager.login("zhangsan", "123456");
+ manager.login("lisi", "abcdef");
+ manager.login("wangwu", "qwerty");
+
+ // 更新用户信息
+ manager.updateUser("USR1", "username", "zhangsan_new");
+ manager.updateUser("USR2", "role", "admin");
+ manager.updateUser("USR3", "active", false);
+
+ // 再次显示所有用户信息
+ manager.displayAllUsers();
+
+ // 删除用户
+ manager.deleteUser("USR2");
+
+ // 再次显示所有用户信息
+ manager.displayAllUsers();
+ }
+}
diff --git a/server/target/classes/self/cases/teams/entity/Clubshenqing.class b/server/target/classes/self/cases/teams/entity/Clubshenqing.class
new file mode 100644
index 00000000..ba14af0f
Binary files /dev/null and b/server/target/classes/self/cases/teams/entity/Clubshenqing.class differ
diff --git a/server/target/classes/self/cases/teams/entity/STjiao.class b/server/target/classes/self/cases/teams/entity/STjiao.class
new file mode 100644
index 00000000..62aa4f44
Binary files /dev/null and b/server/target/classes/self/cases/teams/entity/STjiao.class differ
diff --git a/server/target/classes/self/cases/teams/entity/STm.class b/server/target/classes/self/cases/teams/entity/STm.class
new file mode 100644
index 00000000..a4ade926
Binary files /dev/null and b/server/target/classes/self/cases/teams/entity/STm.class differ
diff --git a/server/target/classes/self/cases/teams/msg/R.class b/server/target/classes/self/cases/teams/msg/R.class
index aff6c3a2..272084b5 100644
Binary files a/server/target/classes/self/cases/teams/msg/R.class and b/server/target/classes/self/cases/teams/msg/R.class differ
diff --git a/server/target/classes/self/cases/teams/teaa/Activity.class b/server/target/classes/self/cases/teams/teaa/Activity.class
new file mode 100644
index 00000000..15b8fcf7
Binary files /dev/null and b/server/target/classes/self/cases/teams/teaa/Activity.class differ
diff --git a/server/target/classes/self/cases/teams/teaa/Applicant.class b/server/target/classes/self/cases/teams/teaa/Applicant.class
new file mode 100644
index 00000000..8f6de343
Binary files /dev/null and b/server/target/classes/self/cases/teams/teaa/Applicant.class differ
diff --git a/server/target/classes/self/cases/teams/teaa/Club.class b/server/target/classes/self/cases/teams/teaa/Club.class
new file mode 100644
index 00000000..80b6aaea
Binary files /dev/null and b/server/target/classes/self/cases/teams/teaa/Club.class differ
diff --git a/server/target/classes/self/cases/teams/teaa/ManagSTexiu.class b/server/target/classes/self/cases/teams/teaa/ManagSTexiu.class
new file mode 100644
index 00000000..bd610b3d
Binary files /dev/null and b/server/target/classes/self/cases/teams/teaa/ManagSTexiu.class differ
diff --git a/server/target/classes/self/cases/teams/teaa/Managexiu$User.class b/server/target/classes/self/cases/teams/teaa/Managexiu$User.class
index ec5bde04..67ff2d2b 100644
Binary files a/server/target/classes/self/cases/teams/teaa/Managexiu$User.class and b/server/target/classes/self/cases/teams/teaa/Managexiu$User.class differ
diff --git a/server/target/classes/self/cases/teams/teaa/Managexiu.class b/server/target/classes/self/cases/teams/teaa/Managexiu.class
index 197a4504..4e99681d 100644
Binary files a/server/target/classes/self/cases/teams/teaa/Managexiu.class and b/server/target/classes/self/cases/teams/teaa/Managexiu.class differ
diff --git a/server/target/classes/self/cases/teams/teaa/Member.class b/server/target/classes/self/cases/teams/teaa/Member.class
new file mode 100644
index 00000000..8c30bbdd
Binary files /dev/null and b/server/target/classes/self/cases/teams/teaa/Member.class differ
diff --git a/server/target/classes/self/cases/teams/teaa/Participant.class b/server/target/classes/self/cases/teams/teaa/Participant.class
new file mode 100644
index 00000000..5af84ec7
Binary files /dev/null and b/server/target/classes/self/cases/teams/teaa/Participant.class differ
diff --git a/server/target/classes/self/cases/teams/teaa/PaymentInfo.class b/server/target/classes/self/cases/teams/teaa/PaymentInfo.class
new file mode 100644
index 00000000..cf5105b4
Binary files /dev/null and b/server/target/classes/self/cases/teams/teaa/PaymentInfo.class differ
diff --git a/server/target/classes/self/cases/teams/teaa/STgeren.class b/server/target/classes/self/cases/teams/teaa/STgeren.class
new file mode 100644
index 00000000..7d3aacc1
Binary files /dev/null and b/server/target/classes/self/cases/teams/teaa/STgeren.class differ
diff --git a/server/target/classes/self/cases/teams/teaa/STjf.class b/server/target/classes/self/cases/teams/teaa/STjf.class
new file mode 100644
index 00000000..46ada1fe
Binary files /dev/null and b/server/target/classes/self/cases/teams/teaa/STjf.class differ
diff --git a/server/target/classes/self/cases/teams/teaa/STjh.class b/server/target/classes/self/cases/teams/teaa/STjh.class
new file mode 100644
index 00000000..448101b9
Binary files /dev/null and b/server/target/classes/self/cases/teams/teaa/STjh.class differ
diff --git a/server/target/classes/self/cases/teams/teaa/STjr.class b/server/target/classes/self/cases/teams/teaa/STjr.class
new file mode 100644
index 00000000..f01273d6
Binary files /dev/null and b/server/target/classes/self/cases/teams/teaa/STjr.class differ
diff --git a/server/target/classes/self/cases/teams/teaa/SheYuan$Member.class b/server/target/classes/self/cases/teams/teaa/SheYuan$Member.class
new file mode 100644
index 00000000..7c8ccfe2
Binary files /dev/null and b/server/target/classes/self/cases/teams/teaa/SheYuan$Member.class differ
diff --git a/server/target/classes/self/cases/teams/teaa/SheYuan.class b/server/target/classes/self/cases/teams/teaa/SheYuan.class
new file mode 100644
index 00000000..66acf1d6
Binary files /dev/null and b/server/target/classes/self/cases/teams/teaa/SheYuan.class differ
diff --git a/server/target/classes/self/cases/teams/teaa/SheZhangManage$Member.class b/server/target/classes/self/cases/teams/teaa/SheZhangManage$Member.class
new file mode 100644
index 00000000..21d94e9b
Binary files /dev/null and b/server/target/classes/self/cases/teams/teaa/SheZhangManage$Member.class differ
diff --git a/server/target/classes/self/cases/teams/teaa/SheZhangManage.class b/server/target/classes/self/cases/teams/teaa/SheZhangManage.class
new file mode 100644
index 00000000..6f038b06
Binary files /dev/null and b/server/target/classes/self/cases/teams/teaa/SheZhangManage.class differ
diff --git a/server/target/classes/self/cases/teams/teaa/User.class b/server/target/classes/self/cases/teams/teaa/User.class
new file mode 100644
index 00000000..771c1702
Binary files /dev/null and b/server/target/classes/self/cases/teams/teaa/User.class differ
diff --git a/server/target/classes/self/cases/teams/utils/IDUtil.class b/server/target/classes/self/cases/teams/utils/IDUtil.class
new file mode 100644
index 00000000..c4ec8248
Binary files /dev/null and b/server/target/classes/self/cases/teams/utils/IDUtil.class differ