LivePool.java
2.81 KB
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
134
135
136
137
138
139
140
141
142
package cn.fw.freya.model.data.pool;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.*;
import java.util.Date;
import java.util.Objects;
/**
* @author unknown
* @version 1.0
* @date 2021/12/13 16:04
* @Description 直播池
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder(toBuilder = true)
@Entity
@Table(name = "live_pool", uniqueConstraints = @UniqueConstraint(columnNames = {"reportDate", "type", "accountNo", "roomId"}))
public class LivePool {
/**
* 主键id
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
/**
* 类型(1:快手, 2:抖音, 3:懂车帝, 4:Bilibili)
*/
private Integer type;
/**
* 账户号
*/
private String accountNo;
/**
* 数据上报日期
*/
@Column(columnDefinition = "date")
@Temporal(TemporalType.DATE)
private Date reportDate;
/**
* 评论人数
*/
private Integer commentUserCnt;
/**
* 付费人数
*/
private Integer consumeUserCnt;
/**
* 直播时长(分钟)
*/
private Double duration;
/**
* 直播收益(元)
*/
private Double income;
/**
* 新增粉丝数
*/
private Integer newFansUserCnt;
/**
* 开播时间
*/
@Column(columnDefinition = "datetime")
private Date openTime;
/**
* 下播时间
*/
@Column(columnDefinition = "datetime")
private Date endTime;
/**
* 直播间封面图
*/
@Column(length = 1024)
private String roomCoverImage;
/**
* 直播回放地址
*/
@Column(length = 1024)
private String playbackUrl;
/**
* 获取直播回放失败次数
*/
private Integer getPlaybackFailTimes = 0;
/**
* 直播间id
*/
private String roomId;
/**
* 直播间名称
*/
private String roomName;
/**
* 收获音浪
*/
private Integer score;
/**
* 观看次数
*/
private Integer watchCnt;
/**
* 在线人数峰值
*/
private Integer watchPeakUserCnt;
/**
* 观看用户数
*/
private Integer watchUserCnt;
// 快手专有参数
/**
* 分享数
*/
private Integer shareCnt;
/**
* 点赞数
*/
private Integer likeCnt;
// 其他参数
/**
* 用户昵称
*/
private String userNick;
/**
* 重写get方法
*
* @return
*/
public Date getLiveEndTime() {
if (Objects.nonNull(this.endTime))
return this.getEndTime();
if (Objects.isNull(this.openTime) || Objects.isNull(this.duration))
return null;
return new Date((long) (this.openTime.getTime() + this.duration * 60 * 1000L));
}
}