From 58d9f460b2f8c34430285115e2557d18333c5cab Mon Sep 17 00:00:00 2001
From: Codex Assistant <codex@example.com>
Date: 星期三, 08 十月 2025 14:16:55 +0800
Subject: [PATCH] feat: 修复Player实体phone字段数据冗余问题并优化小程序报名逻辑

---
 backend/src/main/java/com/rongyichuang/player/entity/Player.java |   42 ++++++++++++++++++++++++++++--------------
 1 files changed, 28 insertions(+), 14 deletions(-)

diff --git a/backend/src/main/java/com/rongyichuang/player/entity/Player.java b/backend/src/main/java/com/rongyichuang/player/entity/Player.java
index 0fc4492..a60dacd 100644
--- a/backend/src/main/java/com/rongyichuang/player/entity/Player.java
+++ b/backend/src/main/java/com/rongyichuang/player/entity/Player.java
@@ -2,6 +2,7 @@
 
 import com.rongyichuang.common.entity.BaseEntity;
 import jakarta.persistence.*;
+import org.hibernate.annotations.Where;
 
 import java.math.BigDecimal;
 
@@ -11,6 +12,7 @@
  */
 @Entity
 @Table(name = "t_player")
+@Where(clause = "state = 1")
 public class Player extends BaseEntity {
 
     /**
@@ -21,7 +23,9 @@
 
     /**
      * 鎵嬫満鍙�
+     * @deprecated 姝ゅ瓧娈靛凡搴熷純锛岃浣跨敤鍏宠仈User瀹炰綋鐨刾hone瀛楁
      */
+    @Deprecated
     @Column(name = "phone", length = 32, nullable = false, unique = true)
     private String phone;
 
@@ -55,11 +59,7 @@
     @Column(name = "introduction", columnDefinition = "TEXT")
     private String introduction;
 
-    /**
-     * 瀹℃牳鐘舵�侊細0-绛夊緟瀹℃牳锛�1-瀹℃牳閫氳繃锛�2-涓嶉�氳繃
-     */
-    @Column(name = "audit_state", nullable = false)
-    private Integer auditState;
+
 
     /**
      * 椹冲洖鍘熷洜
@@ -79,14 +79,19 @@
     @Column(name = "user_id", nullable = false)
     private Long userId;
 
+    /**
+     * 鐘舵�侊細1-姝e父锛�0-鍒犻櫎
+     */
+    @Column(name = "state", nullable = false)
+    private Integer state = 1;
+
     // 鏋勯�犲嚱鏁�
     public Player() {}
 
-    public Player(String name, String phone, Long roleId, Integer auditState, Long userId) {
+    public Player(String name, String phone, Long roleId, Long userId) {
         this.name = name;
         this.phone = phone;
         this.roleId = roleId;
-        this.auditState = auditState;
         this.userId = userId;
     }
 
@@ -99,10 +104,18 @@
         this.name = name;
     }
 
+    /**
+     * @deprecated 姝ゆ柟娉曞凡搴熷純锛岃浣跨敤鍏宠仈User瀹炰綋鐨刾hone瀛楁
+     */
+    @Deprecated
     public String getPhone() {
         return phone;
     }
 
+    /**
+     * @deprecated 姝ゆ柟娉曞凡搴熷純锛岃浣跨敤鍏宠仈User瀹炰綋鐨刾hone瀛楁
+     */
+    @Deprecated
     public void setPhone(String phone) {
         this.phone = phone;
     }
@@ -147,13 +160,7 @@
         this.introduction = introduction;
     }
 
-    public Integer getAuditState() {
-        return auditState;
-    }
 
-    public void setAuditState(Integer auditState) {
-        this.auditState = auditState;
-    }
 
     public String getRejectReason() {
         return rejectReason;
@@ -179,6 +186,14 @@
         this.userId = userId;
     }
 
+    public Integer getState() {
+        return state;
+    }
+
+    public void setState(Integer state) {
+        this.state = state;
+    }
+
     @Override
     public String toString() {
         return "Player{" +
@@ -186,7 +201,6 @@
                 ", name='" + name + '\'' +
                 ", phone='" + phone + '\'' +
                 ", roleId=" + roleId +
-                ", auditState=" + auditState +
                 ", userId=" + userId +
                 '}';
     }

--
Gitblit v1.8.0