学员真实学习时长记录

This commit is contained in:
none
2023-03-22 14:46:49 +08:00
parent 79297f7264
commit 39f46d5ace
16 changed files with 381 additions and 36 deletions

View File

@@ -6,8 +6,6 @@ import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
/**
@@ -26,13 +24,12 @@ public class UserLearnDurationRecord implements Serializable {
/**
*
*/
@JsonProperty("user_id")
private Integer userId;
/**
*
*/
private Date date;
private Date createdDate;
/**
* 已学习时长[微秒]
@@ -42,15 +39,23 @@ public class UserLearnDurationRecord implements Serializable {
/**
* 开始时间
*/
@JsonProperty("start_at")
private Date startAt;
/**
* 结束时间
*/
@JsonProperty("end_at")
private Date endAt;
/**
*
*/
private Integer courseId;
/**
*
*/
private Integer hourId;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
@@ -68,10 +73,12 @@ public class UserLearnDurationRecord implements Serializable {
UserLearnDurationRecord other = (UserLearnDurationRecord) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
&& (this.getDate() == null ? other.getDate() == null : this.getDate().equals(other.getDate()))
&& (this.getCreatedDate() == null ? other.getCreatedDate() == null : this.getCreatedDate().equals(other.getCreatedDate()))
&& (this.getDuration() == null ? other.getDuration() == null : this.getDuration().equals(other.getDuration()))
&& (this.getStartAt() == null ? other.getStartAt() == null : this.getStartAt().equals(other.getStartAt()))
&& (this.getEndAt() == null ? other.getEndAt() == null : this.getEndAt().equals(other.getEndAt()));
&& (this.getEndAt() == null ? other.getEndAt() == null : this.getEndAt().equals(other.getEndAt()))
&& (this.getCourseId() == null ? other.getCourseId() == null : this.getCourseId().equals(other.getCourseId()))
&& (this.getHourId() == null ? other.getHourId() == null : this.getHourId().equals(other.getHourId()));
}
@Override
@@ -80,10 +87,12 @@ public class UserLearnDurationRecord implements Serializable {
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
result = prime * result + ((getDate() == null) ? 0 : getDate().hashCode());
result = prime * result + ((getCreatedDate() == null) ? 0 : getCreatedDate().hashCode());
result = prime * result + ((getDuration() == null) ? 0 : getDuration().hashCode());
result = prime * result + ((getStartAt() == null) ? 0 : getStartAt().hashCode());
result = prime * result + ((getEndAt() == null) ? 0 : getEndAt().hashCode());
result = prime * result + ((getCourseId() == null) ? 0 : getCourseId().hashCode());
result = prime * result + ((getHourId() == null) ? 0 : getHourId().hashCode());
return result;
}
@@ -95,10 +104,12 @@ public class UserLearnDurationRecord implements Serializable {
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", userId=").append(userId);
sb.append(", date=").append(date);
sb.append(", createdDate=").append(createdDate);
sb.append(", duration=").append(duration);
sb.append(", startAt=").append(startAt);
sb.append(", endAt=").append(endAt);
sb.append(", courseId=").append(courseId);
sb.append(", hourId=").append(hourId);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();

View File

@@ -0,0 +1,85 @@
package xyz.playedu.api.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
*
* @TableName user_learn_duration_stats
*/
@TableName(value ="user_learn_duration_stats")
@Data
public class UserLearnDurationStats implements Serializable {
/**
*
*/
@TableId(type = IdType.AUTO)
private Integer id;
/**
*
*/
private Integer userId;
/**
*
*/
private Integer duration;
/**
*
*/
private Date createdDate;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
UserLearnDurationStats other = (UserLearnDurationStats) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
&& (this.getDuration() == null ? other.getDuration() == null : this.getDuration().equals(other.getDuration()))
&& (this.getCreatedDate() == null ? other.getCreatedDate() == null : this.getCreatedDate().equals(other.getCreatedDate()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
result = prime * result + ((getDuration() == null) ? 0 : getDuration().hashCode());
result = prime * result + ((getCreatedDate() == null) ? 0 : getCreatedDate().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", userId=").append(userId);
sb.append(", duration=").append(duration);
sb.append(", createdDate=").append(createdDate);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}