lrj
11 小时以前 bec58fa7fe4fae2deac88200d8d939e12ec8a08f
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
129
130
131
132
133
package com.rongyichuang.player.dto;
 
import com.rongyichuang.activity.entity.Activity;
 
import java.time.format.DateTimeFormatter;
 
/**
 * 比赛晋级列表响应类
 */
public class PromotionCompetitionResponse {
    
    private Long id;
    private Long competitionId;
    private String competitionName;
    private String stageName;
    private Integer maxParticipants;
    private Integer currentCount;
    private Integer status;
    private String startTime;
    private String endTime;
    private Integer sortOrder;
    private Integer state;
    
    private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
    
    public PromotionCompetitionResponse() {}
    
    public PromotionCompetitionResponse(Activity competition, Activity stage, Integer currentCount) {
        this.id = stage.getId();
        this.competitionId = competition.getId();
        this.competitionName = competition.getName();
        this.stageName = stage.getName();
        this.maxParticipants = stage.getPlayerMax();
        this.currentCount = currentCount != null ? currentCount : 0;
        this.status = stage.getState();
        this.startTime = stage.getMatchTime() != null ? stage.getMatchTime().format(FORMATTER) : null;
        this.endTime = stage.getSignupDeadline() != null ? stage.getSignupDeadline().format(FORMATTER) : null;
        this.sortOrder = stage.getSortOrder();
        this.state = stage.getState();
    }
    
 
    
    // Getters and Setters
    
    public Long getId() {
        return id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }
    
    public Long getCompetitionId() {
        return competitionId;
    }
    
    public void setCompetitionId(Long competitionId) {
        this.competitionId = competitionId;
    }
    
    public String getCompetitionName() {
        return competitionName;
    }
    
    public void setCompetitionName(String competitionName) {
        this.competitionName = competitionName;
    }
    
    public String getStageName() {
        return stageName;
    }
    
    public void setStageName(String stageName) {
        this.stageName = stageName;
    }
    
    public Integer getMaxParticipants() {
        return maxParticipants;
    }
    
    public void setMaxParticipants(Integer maxParticipants) {
        this.maxParticipants = maxParticipants;
    }
    
    public Integer getCurrentCount() {
        return currentCount;
    }
    
    public void setCurrentCount(Integer currentCount) {
        this.currentCount = currentCount;
    }
    
    public Integer getStatus() {
        return status;
    }
    
    public void setStatus(Integer status) {
        this.status = status;
    }
    
    public String getStartTime() {
        return startTime;
    }
    
    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }
    
    public String getEndTime() {
        return endTime;
    }
    
    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }
    
    public Integer getSortOrder() {
        return sortOrder;
    }
    
    public void setSortOrder(Integer sortOrder) {
        this.sortOrder = sortOrder;
    }
    
    public Integer getState() {
        return state;
    }
    
    public void setState(Integer state) {
        this.state = state;
    }
}