Codex Assistant
14 小时以前 c8dffd157cd8b62023b26e62a0b92c152d959423
backend/src/main/java/com/rongyichuang/player/dto/PromotableParticipantResponse.java
@@ -28,6 +28,7 @@
        this.id = activityPlayer.getId();
        this.playerName = activityPlayer.getPlayer() != null ? activityPlayer.getPlayer().getName() : "";
        this.projectName = activityPlayer.getProjectName();
        // 临时使用废弃的Player.phone字段,后续需要从服务层传入User的phone
        this.phone = activityPlayer.getPlayer() != null ? activityPlayer.getPlayer().getPhone() : "";
        this.averageScore = averageScore;
        this.ratingCount = ratingCount != null ? ratingCount : 0;
@@ -37,6 +38,20 @@
        this.playerId = activityPlayer.getPlayerId();
    }
    
    public PromotableParticipantResponse(ActivityPlayer activityPlayer, BigDecimal averageScore, Integer ratingCount, String userPhone) {
        this.id = activityPlayer.getId();
        this.playerName = activityPlayer.getPlayer() != null ? activityPlayer.getPlayer().getName() : "";
        this.projectName = activityPlayer.getProjectName();
        // 从参数获取User的phone
        this.phone = userPhone != null ? userPhone : "";
        this.averageScore = averageScore;
        this.ratingCount = ratingCount != null ? ratingCount : 0;
        this.applyTime = activityPlayer.getCreateTime() != null ?
            activityPlayer.getCreateTime().format(FORMATTER) : null;
        this.state = activityPlayer.getState();
        this.playerId = activityPlayer.getPlayerId();
    }
    // Getters and Setters
    
    public Long getId() {