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;
|
}
|
}
|