mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-07-25 02:39:31 +08:00
学员学习记录表
This commit is contained in:
parent
71fcb008ed
commit
84bd4fdb55
@ -53,9 +53,9 @@ public class CourseController {
|
||||
Course course = courseService.findOrFail(id);
|
||||
|
||||
HashMap<String, Object> data = new HashMap<>();
|
||||
data.put("course", course);//线上课
|
||||
data.put("chapters", chapterService.getChaptersByCourseId(course.getId()));//章节
|
||||
data.put("hours", hourService.getHoursByCourseId(course.getId()).stream().collect(Collectors.groupingBy(CourseHour::getChapterId)));//课时
|
||||
data.put("course", course);
|
||||
data.put("chapters", chapterService.getChaptersByCourseId(course.getId()));
|
||||
data.put("hours", hourService.getHoursByCourseId(course.getId()).stream().collect(Collectors.groupingBy(CourseHour::getChapterId)));
|
||||
|
||||
return JsonResponse.data(data);
|
||||
}
|
||||
|
153
src/main/java/xyz/playedu/api/domain/UserCourseHourRecord.java
Normal file
153
src/main/java/xyz/playedu/api/domain/UserCourseHourRecord.java
Normal file
@ -0,0 +1,153 @@
|
||||
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 com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @TableName user_course_hour_records
|
||||
*/
|
||||
@TableName(value = "user_course_hour_records")
|
||||
@Data
|
||||
public class UserCourseHourRecord implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@JsonProperty("user_id")
|
||||
private Integer userId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@JsonProperty("course_id")
|
||||
private Integer courseId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@JsonProperty("hour_id")
|
||||
private Integer hourId;
|
||||
|
||||
/**
|
||||
* 总时长
|
||||
*/
|
||||
@JsonProperty("total_duration")
|
||||
private Integer totalDuration;
|
||||
|
||||
/**
|
||||
* 已完成时长
|
||||
*/
|
||||
@JsonProperty("finished_duration")
|
||||
private Integer finishedDuration;
|
||||
|
||||
/**
|
||||
* 实际观看时长
|
||||
*/
|
||||
@JsonProperty("real_duration")
|
||||
private Integer realDuration;
|
||||
|
||||
/**
|
||||
* 是否看完[1:是,0:否]
|
||||
*/
|
||||
@JsonProperty("is_finished")
|
||||
private Integer isFinished;
|
||||
|
||||
/**
|
||||
* 看完时间
|
||||
*/
|
||||
@JsonProperty("finished_at")
|
||||
private Date finishedAt;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@JsonProperty("created_at")
|
||||
private Date createdAt;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@JsonProperty("updated_at")
|
||||
private Date updatedAt;
|
||||
|
||||
@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;
|
||||
}
|
||||
UserCourseHourRecord other = (UserCourseHourRecord) 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.getCourseId() == null ? other.getCourseId() == null : this.getCourseId().equals(other.getCourseId()))
|
||||
&& (this.getHourId() == null ? other.getHourId() == null : this.getHourId().equals(other.getHourId()))
|
||||
&& (this.getTotalDuration() == null ? other.getTotalDuration() == null : this.getTotalDuration().equals(other.getTotalDuration()))
|
||||
&& (this.getFinishedDuration() == null ? other.getFinishedDuration() == null : this.getFinishedDuration().equals(other.getFinishedDuration()))
|
||||
&& (this.getRealDuration() == null ? other.getRealDuration() == null : this.getRealDuration().equals(other.getRealDuration()))
|
||||
&& (this.getIsFinished() == null ? other.getIsFinished() == null : this.getIsFinished().equals(other.getIsFinished()))
|
||||
&& (this.getFinishedAt() == null ? other.getFinishedAt() == null : this.getFinishedAt().equals(other.getFinishedAt()))
|
||||
&& (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()))
|
||||
&& (this.getUpdatedAt() == null ? other.getUpdatedAt() == null : this.getUpdatedAt().equals(other.getUpdatedAt()));
|
||||
}
|
||||
|
||||
@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 + ((getCourseId() == null) ? 0 : getCourseId().hashCode());
|
||||
result = prime * result + ((getHourId() == null) ? 0 : getHourId().hashCode());
|
||||
result = prime * result + ((getTotalDuration() == null) ? 0 : getTotalDuration().hashCode());
|
||||
result = prime * result + ((getFinishedDuration() == null) ? 0 : getFinishedDuration().hashCode());
|
||||
result = prime * result + ((getRealDuration() == null) ? 0 : getRealDuration().hashCode());
|
||||
result = prime * result + ((getIsFinished() == null) ? 0 : getIsFinished().hashCode());
|
||||
result = prime * result + ((getFinishedAt() == null) ? 0 : getFinishedAt().hashCode());
|
||||
result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
|
||||
result = prime * result + ((getUpdatedAt() == null) ? 0 : getUpdatedAt().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(", courseId=").append(courseId);
|
||||
sb.append(", hourId=").append(hourId);
|
||||
sb.append(", totalDuration=").append(totalDuration);
|
||||
sb.append(", finishedDuration=").append(finishedDuration);
|
||||
sb.append(", realDuration=").append(realDuration);
|
||||
sb.append(", isFinished=").append(isFinished);
|
||||
sb.append(", finishedAt=").append(finishedAt);
|
||||
sb.append(", createdAt=").append(createdAt);
|
||||
sb.append(", updatedAt=").append(updatedAt);
|
||||
sb.append(", serialVersionUID=").append(serialVersionUID);
|
||||
sb.append("]");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
143
src/main/java/xyz/playedu/api/domain/UserCourseRecord.java
Normal file
143
src/main/java/xyz/playedu/api/domain/UserCourseRecord.java
Normal file
@ -0,0 +1,143 @@
|
||||
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 com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @TableName user_course_records
|
||||
*/
|
||||
@TableName(value = "user_course_records")
|
||||
@Data
|
||||
public class UserCourseRecord implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@JsonProperty("user_id")
|
||||
private Integer userId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@JsonProperty("course_id")
|
||||
private Integer courseId;
|
||||
|
||||
/**
|
||||
* 课时数量
|
||||
*/
|
||||
@JsonProperty("hour_count")
|
||||
private Integer hourCount;
|
||||
|
||||
/**
|
||||
* 已完成课时数
|
||||
*/
|
||||
@JsonProperty("finished_count")
|
||||
private Integer finishedCount;
|
||||
|
||||
/**
|
||||
* 进度
|
||||
*/
|
||||
private Integer progress;
|
||||
|
||||
/**
|
||||
* 看完[1:是,0:否]
|
||||
*/
|
||||
@JsonProperty("is_finished")
|
||||
private Integer isFinished;
|
||||
|
||||
/**
|
||||
* 看完时间
|
||||
*/
|
||||
@JsonProperty("finished_at")
|
||||
private Date finishedAt;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@JsonProperty("created_at")
|
||||
private Date createdAt;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@JsonProperty("updated_at")
|
||||
private Date updatedAt;
|
||||
|
||||
@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;
|
||||
}
|
||||
UserCourseRecord other = (UserCourseRecord) 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.getCourseId() == null ? other.getCourseId() == null : this.getCourseId().equals(other.getCourseId()))
|
||||
&& (this.getHourCount() == null ? other.getHourCount() == null : this.getHourCount().equals(other.getHourCount()))
|
||||
&& (this.getFinishedCount() == null ? other.getFinishedCount() == null : this.getFinishedCount().equals(other.getFinishedCount()))
|
||||
&& (this.getProgress() == null ? other.getProgress() == null : this.getProgress().equals(other.getProgress()))
|
||||
&& (this.getIsFinished() == null ? other.getIsFinished() == null : this.getIsFinished().equals(other.getIsFinished()))
|
||||
&& (this.getFinishedAt() == null ? other.getFinishedAt() == null : this.getFinishedAt().equals(other.getFinishedAt()))
|
||||
&& (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()))
|
||||
&& (this.getUpdatedAt() == null ? other.getUpdatedAt() == null : this.getUpdatedAt().equals(other.getUpdatedAt()));
|
||||
}
|
||||
|
||||
@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 + ((getCourseId() == null) ? 0 : getCourseId().hashCode());
|
||||
result = prime * result + ((getHourCount() == null) ? 0 : getHourCount().hashCode());
|
||||
result = prime * result + ((getFinishedCount() == null) ? 0 : getFinishedCount().hashCode());
|
||||
result = prime * result + ((getProgress() == null) ? 0 : getProgress().hashCode());
|
||||
result = prime * result + ((getIsFinished() == null) ? 0 : getIsFinished().hashCode());
|
||||
result = prime * result + ((getFinishedAt() == null) ? 0 : getFinishedAt().hashCode());
|
||||
result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
|
||||
result = prime * result + ((getUpdatedAt() == null) ? 0 : getUpdatedAt().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(", courseId=").append(courseId);
|
||||
sb.append(", hourCount=").append(hourCount);
|
||||
sb.append(", finishedCount=").append(finishedCount);
|
||||
sb.append(", progress=").append(progress);
|
||||
sb.append(", isFinished=").append(isFinished);
|
||||
sb.append(", finishedAt=").append(finishedAt);
|
||||
sb.append(", createdAt=").append(createdAt);
|
||||
sb.append(", updatedAt=").append(updatedAt);
|
||||
sb.append(", serialVersionUID=").append(serialVersionUID);
|
||||
sb.append("]");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,106 @@
|
||||
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 com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
* @TableName user_learn_duration_records
|
||||
*/
|
||||
@TableName(value ="user_learn_duration_records")
|
||||
@Data
|
||||
public class UserLearnDurationRecord implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@JsonProperty("user_id")
|
||||
private Integer userId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Date date;
|
||||
|
||||
/**
|
||||
* 已学习时长[微秒]
|
||||
*/
|
||||
private Integer duration;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@JsonProperty("start_at")
|
||||
private Date startAt;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@JsonProperty("end_at")
|
||||
private Date endAt;
|
||||
|
||||
@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;
|
||||
}
|
||||
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.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()));
|
||||
}
|
||||
|
||||
@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 + ((getDate() == null) ? 0 : getDate().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());
|
||||
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(", date=").append(date);
|
||||
sb.append(", duration=").append(duration);
|
||||
sb.append(", startAt=").append(startAt);
|
||||
sb.append(", endAt=").append(endAt);
|
||||
sb.append(", serialVersionUID=").append(serialVersionUID);
|
||||
sb.append("]");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package xyz.playedu.api.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import xyz.playedu.api.domain.UserCourseHourRecord;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author tengteng
|
||||
* @description 针对表【user_course_hour_records】的数据库操作Mapper
|
||||
* @createDate 2023-03-20 16:41:08
|
||||
* @Entity xyz.playedu.api.domain.UserCourseHourRecord
|
||||
*/
|
||||
@Mapper
|
||||
public interface UserCourseHourRecordMapper extends BaseMapper<UserCourseHourRecord> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,20 @@
|
||||
package xyz.playedu.api.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import xyz.playedu.api.domain.UserCourseRecord;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author tengteng
|
||||
* @description 针对表【user_course_records】的数据库操作Mapper
|
||||
* @createDate 2023-03-20 16:41:04
|
||||
* @Entity xyz.playedu.api.domain.UserCourseRecord
|
||||
*/
|
||||
@Mapper
|
||||
public interface UserCourseRecordMapper extends BaseMapper<UserCourseRecord> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,20 @@
|
||||
package xyz.playedu.api.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import xyz.playedu.api.domain.UserLearnDurationRecord;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @author tengteng
|
||||
* @description 针对表【user_learn_duration_records】的数据库操作Mapper
|
||||
* @createDate 2023-03-20 16:41:12
|
||||
* @Entity xyz.playedu.api.domain.UserLearnDurationRecord
|
||||
*/
|
||||
@Mapper
|
||||
public interface UserLearnDurationRecordMapper extends BaseMapper<UserLearnDurationRecord> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,13 @@
|
||||
package xyz.playedu.api.service;
|
||||
|
||||
import xyz.playedu.api.domain.UserCourseHourRecord;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author tengteng
|
||||
* @description 针对表【user_course_hour_records】的数据库操作Service
|
||||
* @createDate 2023-03-20 16:41:08
|
||||
*/
|
||||
public interface UserCourseHourRecordService extends IService<UserCourseHourRecord> {
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package xyz.playedu.api.service;
|
||||
|
||||
import xyz.playedu.api.domain.UserCourseRecord;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author tengteng
|
||||
* @description 针对表【user_course_records】的数据库操作Service
|
||||
* @createDate 2023-03-20 16:41:04
|
||||
*/
|
||||
public interface UserCourseRecordService extends IService<UserCourseRecord> {
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package xyz.playedu.api.service;
|
||||
|
||||
import xyz.playedu.api.domain.UserLearnDurationRecord;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @author tengteng
|
||||
* @description 针对表【user_learn_duration_records】的数据库操作Service
|
||||
* @createDate 2023-03-20 16:41:12
|
||||
*/
|
||||
public interface UserLearnDurationRecordService extends IService<UserLearnDurationRecord> {
|
||||
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package xyz.playedu.api.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import xyz.playedu.api.domain.UserCourseHourRecord;
|
||||
import xyz.playedu.api.service.UserCourseHourRecordService;
|
||||
import xyz.playedu.api.mapper.UserCourseHourRecordMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author tengteng
|
||||
* @description 针对表【user_course_hour_records】的数据库操作Service实现
|
||||
* @createDate 2023-03-20 16:41:08
|
||||
*/
|
||||
@Service
|
||||
public class UserCourseHourRecordServiceImpl extends ServiceImpl<UserCourseHourRecordMapper, UserCourseHourRecord>
|
||||
implements UserCourseHourRecordService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,22 @@
|
||||
package xyz.playedu.api.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import xyz.playedu.api.domain.UserCourseRecord;
|
||||
import xyz.playedu.api.service.UserCourseRecordService;
|
||||
import xyz.playedu.api.mapper.UserCourseRecordMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author tengteng
|
||||
* @description 针对表【user_course_records】的数据库操作Service实现
|
||||
* @createDate 2023-03-20 16:41:04
|
||||
*/
|
||||
@Service
|
||||
public class UserCourseRecordServiceImpl extends ServiceImpl<UserCourseRecordMapper, UserCourseRecord>
|
||||
implements UserCourseRecordService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,22 @@
|
||||
package xyz.playedu.api.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import xyz.playedu.api.domain.UserLearnDurationRecord;
|
||||
import xyz.playedu.api.service.UserLearnDurationRecordService;
|
||||
import xyz.playedu.api.mapper.UserLearnDurationRecordMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author tengteng
|
||||
* @description 针对表【user_learn_duration_records】的数据库操作Service实现
|
||||
* @createDate 2023-03-20 16:41:12
|
||||
*/
|
||||
@Service
|
||||
public class UserLearnDurationRecordServiceImpl extends ServiceImpl<UserLearnDurationRecordMapper, UserLearnDurationRecord>
|
||||
implements UserLearnDurationRecordService{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
27
src/main/resources/mapper/UserCourseHourRecordMapper.xml
Normal file
27
src/main/resources/mapper/UserCourseHourRecordMapper.xml
Normal file
@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="xyz.playedu.api.mapper.UserCourseHourRecordMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="xyz.playedu.api.domain.UserCourseHourRecord">
|
||||
<id property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="userId" column="user_id" jdbcType="INTEGER"/>
|
||||
<result property="courseId" column="course_id" jdbcType="INTEGER"/>
|
||||
<result property="hourId" column="hour_id" jdbcType="INTEGER"/>
|
||||
<result property="totalDuration" column="total_duration" jdbcType="INTEGER"/>
|
||||
<result property="finishedDuration" column="finished_duration" jdbcType="INTEGER"/>
|
||||
<result property="realDuration" column="real_duration" jdbcType="INTEGER"/>
|
||||
<result property="isFinished" column="is_finished" jdbcType="TINYINT"/>
|
||||
<result property="finishedAt" column="finished_at" jdbcType="TIMESTAMP"/>
|
||||
<result property="createdAt" column="created_at" jdbcType="TIMESTAMP"/>
|
||||
<result property="updatedAt" column="updated_at" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,user_id,course_id,
|
||||
hour_id,total_duration,finished_duration,
|
||||
real_duration,is_finished,finished_at,
|
||||
created_at,updated_at
|
||||
</sql>
|
||||
</mapper>
|
26
src/main/resources/mapper/UserCourseRecordMapper.xml
Normal file
26
src/main/resources/mapper/UserCourseRecordMapper.xml
Normal file
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="xyz.playedu.api.mapper.UserCourseRecordMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="xyz.playedu.api.domain.UserCourseRecord">
|
||||
<id property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="userId" column="user_id" jdbcType="INTEGER"/>
|
||||
<result property="courseId" column="course_id" jdbcType="INTEGER"/>
|
||||
<result property="hourCount" column="hour_count" jdbcType="INTEGER"/>
|
||||
<result property="finishedCount" column="finished_count" jdbcType="INTEGER"/>
|
||||
<result property="progress" column="progress" jdbcType="INTEGER"/>
|
||||
<result property="isFinished" column="is_finished" jdbcType="TINYINT"/>
|
||||
<result property="finishedAt" column="finished_at" jdbcType="TIMESTAMP"/>
|
||||
<result property="createdAt" column="created_at" jdbcType="TIMESTAMP"/>
|
||||
<result property="updatedAt" column="updated_at" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,user_id,course_id,
|
||||
hour_count,finished_count,progress,
|
||||
is_finished,finished_at,created_at,
|
||||
updated_at
|
||||
</sql>
|
||||
</mapper>
|
20
src/main/resources/mapper/UserLearnDurationRecordMapper.xml
Normal file
20
src/main/resources/mapper/UserLearnDurationRecordMapper.xml
Normal file
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="xyz.playedu.api.mapper.UserLearnDurationRecordMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="xyz.playedu.api.domain.UserLearnDurationRecord">
|
||||
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="userId" column="user_id" jdbcType="INTEGER"/>
|
||||
<result property="date" column="date" jdbcType="DATE"/>
|
||||
<result property="duration" column="duration" jdbcType="INTEGER"/>
|
||||
<result property="startAt" column="start_at" jdbcType="TIMESTAMP"/>
|
||||
<result property="endAt" column="end_at" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,user_id,date,
|
||||
duration,start_at,end_at
|
||||
</sql>
|
||||
</mapper>
|
Loading…
x
Reference in New Issue
Block a user