Codex Assistant
6 小时以前 c8dffd157cd8b62023b26e62a0b92c152d959423
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
package com.rongyichuang.player.dto;
 
import com.rongyichuang.player.entity.ActivityPlayer;
 
import java.math.BigDecimal;
import java.time.format.DateTimeFormatter;
 
/**
 * 可晋级参赛者响应类
 */
public class PromotableParticipantResponse {
    
    private Long id;
    private String playerName;
    private String projectName;
    private String phone;
    private BigDecimal averageScore;
    private Integer ratingCount;
    private String applyTime;
    private Integer state;
    private Long playerId;
    
    private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
    
    public PromotableParticipantResponse() {}
    
    public PromotableParticipantResponse(ActivityPlayer activityPlayer, BigDecimal averageScore, Integer ratingCount) {
        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;
        this.applyTime = activityPlayer.getCreateTime() != null ? 
            activityPlayer.getCreateTime().format(FORMATTER) : null;
        this.state = activityPlayer.getState();
        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() {
        return id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }
    
    public String getPlayerName() {
        return playerName;
    }
    
    public void setPlayerName(String playerName) {
        this.playerName = playerName;
    }
    
    public String getProjectName() {
        return projectName;
    }
    
    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }
    
    public String getPhone() {
        return phone;
    }
    
    public void setPhone(String phone) {
        this.phone = phone;
    }
    
    public BigDecimal getAverageScore() {
        return averageScore;
    }
    
    public void setAverageScore(BigDecimal averageScore) {
        this.averageScore = averageScore;
    }
    
    public Integer getRatingCount() {
        return ratingCount;
    }
    
    public void setRatingCount(Integer ratingCount) {
        this.ratingCount = ratingCount;
    }
    
    public String getApplyTime() {
        return applyTime;
    }
    
    public void setApplyTime(String applyTime) {
        this.applyTime = applyTime;
    }
    
    public Integer getState() {
        return state;
    }
    
    public void setState(Integer state) {
        this.state = state;
    }
    
    public Long getPlayerId() {
        return playerId;
    }
    
    public void setPlayerId(Long playerId) {
        this.playerId = playerId;
    }
}