diff --git a/web/src/main/java/com/ibeetl/jlw/dao/StudentDao.java b/web/src/main/java/com/ibeetl/jlw/dao/StudentDao.java index 17fdaa21..e03811e4 100644 --- a/web/src/main/java/com/ibeetl/jlw/dao/StudentDao.java +++ b/web/src/main/java/com/ibeetl/jlw/dao/StudentDao.java @@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil; import com.ibeetl.jlw.entity.CourseInfo; import com.ibeetl.jlw.entity.Student; import com.ibeetl.jlw.entity.StudentExtendSchoolInfo; +import com.ibeetl.jlw.entity.api.student.StudentActiveInfo; import com.ibeetl.jlw.entity.dto.StudentEditPasswordDTO; import com.ibeetl.jlw.web.query.StudentQuery; import org.beetl.sql.core.engine.PageQuery; @@ -71,4 +72,6 @@ public interface StudentDao extends BaseMapper{ * @return */ Student getStudentByStudentEditPasswordDTO(StudentEditPasswordDTO dto); + + StudentActiveInfo studentActiveInfo(Long studentId); } \ No newline at end of file diff --git a/web/src/main/java/com/ibeetl/jlw/entity/api/student/StudentActiveInfo.java b/web/src/main/java/com/ibeetl/jlw/entity/api/student/StudentActiveInfo.java new file mode 100644 index 00000000..b4a39bbc --- /dev/null +++ b/web/src/main/java/com/ibeetl/jlw/entity/api/student/StudentActiveInfo.java @@ -0,0 +1,31 @@ +package com.ibeetl.jlw.entity.api.student; + +import com.ibeetl.admin.core.entity.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 学生端-活跃度信息 + */ +@Data +@EqualsAndHashCode(callSuper = false) +public class StudentActiveInfo extends BaseEntity { + + /** + * 学习时长 + */ + private String studyDuration; + /** + * 平台排名 + */ + private String platformRankNo; + /** + * 班级排名 + */ + private String classRankNo; + /** + * 登录天数 + */ + private String loginDays; + +} diff --git a/web/src/main/java/com/ibeetl/jlw/service/api/student/ApiStudentService.java b/web/src/main/java/com/ibeetl/jlw/service/api/student/ApiStudentService.java index cb6a645d..23f3d04f 100644 --- a/web/src/main/java/com/ibeetl/jlw/service/api/student/ApiStudentService.java +++ b/web/src/main/java/com/ibeetl/jlw/service/api/student/ApiStudentService.java @@ -8,6 +8,7 @@ import com.ibeetl.jlw.dao.StudentDao; import com.ibeetl.jlw.dao.TeacherOpenCourseMergeStudentDao; import com.ibeetl.jlw.entity.*; import com.ibeetl.jlw.entity.api.CurrentUserInfo; +import com.ibeetl.jlw.entity.api.student.StudentActiveInfo; import com.ibeetl.jlw.entity.api.student.StudentIndexData; import com.ibeetl.jlw.entity.dto.StudentEditPasswordDTO; import com.ibeetl.jlw.entity.dto.StudentRegisterDTO; @@ -25,6 +26,8 @@ import org.springframework.validation.annotation.Validated; import javax.validation.constraints.NotNull; import java.util.List; +import static cn.jlw.util.CacheUserUtil.getStudent; + /** *

* 学生端-API接口 @@ -138,4 +141,14 @@ public class ApiStudentService { Boolean updateSuccess = coreUserService.editPwdByOld(dto.getOldPwd(), dto.getNewPwd(), studentInfo.getUserId()); Assert.isTrue(updateSuccess, "密码修改失败!"); } + + /** + * 学生活跃度信息 + * @return + */ + public StudentActiveInfo studentActiveInfo() { + Student student = getStudent(); + Assert.notNull(student, "该接口只能学生查看!"); + return studentDao.studentActiveInfo(student.getStudentId()); + } } diff --git a/web/src/main/java/com/ibeetl/jlw/web/api/student/ApiStudentController.java b/web/src/main/java/com/ibeetl/jlw/web/api/student/ApiStudentController.java index b3520484..6a0c779f 100644 --- a/web/src/main/java/com/ibeetl/jlw/web/api/student/ApiStudentController.java +++ b/web/src/main/java/com/ibeetl/jlw/web/api/student/ApiStudentController.java @@ -58,4 +58,8 @@ public class ApiStudentController { return JsonResult.success(); } + @PostMapping("studentActiveInfo.do") + public JsonResult studentActiveInfo() { + return JsonResult.success(apiStudentService.studentActiveInfo()); + } } diff --git a/web/src/main/resources/sql/jlw/student.md b/web/src/main/resources/sql/jlw/student.md index 5f5d0a98..dc5427a0 100644 --- a/web/src/main/resources/sql/jlw/student.md +++ b/web/src/main/resources/sql/jlw/student.md @@ -1449,4 +1449,14 @@ getStudentByStudentEditPasswordDTO AND t.student_name = #studentName# AND t.student_sn = #studentSn# AND ta.PASSWORD = #oldPwd# - \ No newline at end of file + + +studentActiveInfo +=== +* 学生端-活跃度信息 + select + '0天10小时2分钟' as study_duration, + 230 as platform_rank_no, + 10 as class_rank_no, + 20 as login_days, + '该数据仅用于测试' as data_type \ No newline at end of file