admin
2021-02-06 cad915058c3c53bf328a8ae9ca9bc7de099caba7
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
package com.yeshi.buwan.domain.video;
 
import com.google.gson.annotations.Expose;
import com.yeshi.buwan.domain.VideoInfo;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.Transient;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
 
import java.util.Date;
 
/**
 * 视频观看记录
 */
@Document(collection = "videoWatchHistory")
public class VideoWatchHistory {
 
    @Expose
    @Id
    private String id;
    @Expose
    private String videoId;
 
    @Indexed
    private String device;
 
    private String uid;
 
    private Integer position;
 
    @Expose
    @Indexed
    private Date createTime;
 
 
    @Expose
    @Transient
    private VideoInfo video;
 
 
    /**
     * 生成主键
     *
     * @param device
     * @param videoId
     * @return
     */
    public static String createId(String device, String videoId) {
 
        return device + "_" + videoId;
    }
 
 
    public String getId() {
        return id;
    }
 
    public void setId(String id) {
        this.id = id;
    }
 
    public String getVideoId() {
        return videoId;
    }
 
    public void setVideoId(String videoId) {
        this.videoId = videoId;
    }
 
    public String getDevice() {
        return device;
    }
 
    public void setDevice(String device) {
        this.device = device;
    }
 
    public String getUid() {
        return uid;
    }
 
    public void setUid(String uid) {
        this.uid = uid;
    }
 
    public Date getCreateTime() {
        return createTime;
    }
 
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
 
 
    public VideoInfo getVideo() {
        return video;
    }
 
    public void setVideo(VideoInfo video) {
        this.video = video;
    }
 
 
    public Integer getPosition() {
        return position;
    }
 
    public void setPosition(Integer position) {
        this.position = position;
    }
}