From 7437cf33efac561c8ec2e0fc5811ade0aea917a4 Mon Sep 17 00:00:00 2001 From: wenyu441069198 <14186472+wenyu441069198@user.noreply.gitee.com> Date: Fri, 26 Jul 2024 17:23:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=82=96=E6=B5=B7=E5=8D=97=E8=AE=BF=E9=97=AE?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E3=80=81=E5=AD=A6=E7=94=9F=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 9 ++- .../controller/courses/CoursesController.java | 12 +++ .../controller/umsAdmin/ReportController.java | 47 ++++++++++++ .../umsAdmin/UmsUserController.java | 27 ++++--- .../umsStudent/UmsStudentController.java | 13 ++++ .../mapper/courses/StudentCoursesMapper.java | 3 + .../backend/mapper/report/ReportMapper.java | 14 ++++ .../mapper/umsAdmin/UmsUserMapper.java | 2 + .../backend/model/dto/report/ReportDTO.java | 21 ++++++ .../dto/umsAdmin/UmsStudentAndTeacherDTO.java | 2 +- .../backend/model/entity/report/Report.java | 24 ++++++ .../model/vo/report/BrowseReportVO.java | 20 +++++ .../service/courses/ICoursesService.java | 5 ++ .../impl/courses/CoursesServiceImpl.java | 21 ++++++ .../impl/report/ReportServiceImpl.java | 73 +++++++++++++++++++ .../umsAdmin}/UmsRoleServiceImpl.java | 3 +- .../umsAdmin}/UmsUserServiceImpl.java | 2 +- .../backend/service/report/ReportService.java | 21 ++++++ src/main/resources/mapper/ReportMapper.xml | 18 +++++ .../resources/mapper/StudentCoursesMapper.xml | 8 ++ src/main/resources/mapper/UmsUserMapper.xml | 1 + 21 files changed, 326 insertions(+), 20 deletions(-) create mode 100644 src/main/java/com/teaching/backend/controller/umsAdmin/ReportController.java create mode 100644 src/main/java/com/teaching/backend/controller/umsStudent/UmsStudentController.java create mode 100644 src/main/java/com/teaching/backend/mapper/report/ReportMapper.java create mode 100644 src/main/java/com/teaching/backend/model/dto/report/ReportDTO.java create mode 100644 src/main/java/com/teaching/backend/model/entity/report/Report.java create mode 100644 src/main/java/com/teaching/backend/model/vo/report/BrowseReportVO.java create mode 100644 src/main/java/com/teaching/backend/service/impl/report/ReportServiceImpl.java rename src/main/java/com/teaching/backend/service/{umsAdmin/impl => impl/umsAdmin}/UmsRoleServiceImpl.java (95%) rename src/main/java/com/teaching/backend/service/{umsAdmin/impl => impl/umsAdmin}/UmsUserServiceImpl.java (99%) create mode 100644 src/main/java/com/teaching/backend/service/report/ReportService.java create mode 100644 src/main/resources/mapper/ReportMapper.xml diff --git a/pom.xml b/pom.xml index 4e0f3ce..af309d8 100644 --- a/pom.xml +++ b/pom.xml @@ -117,10 +117,6 @@ 4.4.0 - - org.apache.commons - commons-lang3 - cn.hutool hutool-all @@ -206,6 +202,11 @@ redisson 3.13.6 + + commons-lang + commons-lang + 2.6 + diff --git a/src/main/java/com/teaching/backend/controller/courses/CoursesController.java b/src/main/java/com/teaching/backend/controller/courses/CoursesController.java index 4768bd4..ca4298d 100644 --- a/src/main/java/com/teaching/backend/controller/courses/CoursesController.java +++ b/src/main/java/com/teaching/backend/controller/courses/CoursesController.java @@ -2,6 +2,7 @@ package com.teaching.backend.controller.courses; import com.teaching.backend.common.BaseResponse; +import com.teaching.backend.common.CommonResult; import com.teaching.backend.common.ErrorCode; import com.teaching.backend.common.ResultUtils; import com.teaching.backend.exception.BusinessException; @@ -11,8 +12,10 @@ import com.teaching.backend.model.dto.courses.CoursesDTO; import com.teaching.backend.model.dto.courses.PageDTO; import com.teaching.backend.model.entity.courses.Courses; +import com.teaching.backend.model.entity.umsAdmin.UmsStudent; import com.teaching.backend.model.query.CourseQuery; import com.teaching.backend.model.vo.courses.CoursesVO; +import com.teaching.backend.model.vo.umsAdmin.UmsStudentVO; import com.teaching.backend.service.courses.ICoursesService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -120,4 +123,13 @@ public class CoursesController { String id = "de3100cad98f76be3176dd39aa748a9e"; coursesService.down(response, id); } + + @ApiOperation("查询学生列表") +// @ValidateParams({"username"}) + @PostMapping("/studentList") + public CommonResult> getStudentList(CourseQuery courseQuery){ + HashSet umsStudentList = coursesService.queryStudentList(courseQuery); + return CommonResult.success(umsStudentList); + } + } diff --git a/src/main/java/com/teaching/backend/controller/umsAdmin/ReportController.java b/src/main/java/com/teaching/backend/controller/umsAdmin/ReportController.java new file mode 100644 index 0000000..99a7d8c --- /dev/null +++ b/src/main/java/com/teaching/backend/controller/umsAdmin/ReportController.java @@ -0,0 +1,47 @@ +package com.teaching.backend.controller.umsAdmin; + +import com.teaching.backend.common.CommonResult; +import com.teaching.backend.model.dto.report.ReportDTO; +import com.teaching.backend.model.vo.report.BrowseReportVO; +import com.teaching.backend.service.report.ReportService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +@RestController +@Api(tags = "ReportController") +@RequestMapping("/api/report") +@Slf4j +public class ReportController { + + @Autowired + private ReportService reportService; + + /** + * 浏览统计 + * @return + */ + @GetMapping("/browseStatistics") + @ApiOperation("浏览统计") + public CommonResult browseStatistics(){ + return CommonResult.success(reportService.getBrowseStatistics()); + } + + /** + * 接收每日浏览量 + * @return + */ + @PostMapping("/receptionBrowse") + @ApiOperation("接收每日浏览量") + public CommonResult receptionBrowse(@RequestBody ReportDTO reportDTO){ + + boolean receptionBrowse = reportService.getReceptionBrowse(reportDTO); + if (receptionBrowse == false){ + return CommonResult.failed(); + } + return CommonResult.success(receptionBrowse); + } + +} diff --git a/src/main/java/com/teaching/backend/controller/umsAdmin/UmsUserController.java b/src/main/java/com/teaching/backend/controller/umsAdmin/UmsUserController.java index 7a46257..530f25f 100644 --- a/src/main/java/com/teaching/backend/controller/umsAdmin/UmsUserController.java +++ b/src/main/java/com/teaching/backend/controller/umsAdmin/UmsUserController.java @@ -30,7 +30,7 @@ import java.util.Map; * @Description:login */ @RestController -@Api(tags = "UmsAdminController") +@Api(tags = "UmsUserController") @RequestMapping("/api/user") @Slf4j public class UmsUserController { @@ -145,17 +145,6 @@ public class UmsUserController { return CommonResult.failed(); } - @ApiOperation("修改指定用户密码") - @PostMapping("/updatePassword") - public CommonResult updatePassword(@Validated @RequestBody UpdateUserPasswordParam updatePasswordParam) { - int status = umsUserService.updatePassword(updatePasswordParam); - if (status == 1) { - return CommonResult.success(status); - } else { - return CommonResult.failed(); - } - } - @ApiOperation("获取指定个人信息") @PostMapping("/personal/info") public CommonResult getByIdPersonalInfo(@RequestParam String id) { @@ -179,6 +168,19 @@ public class UmsUserController { return CommonResult.failed(); } + @ApiOperation("修改指定用户密码") + @PostMapping("/updatePassword") + public CommonResult updatePassword(@Validated @RequestBody UpdateUserPasswordParam updatePasswordParam) { + int status = umsUserService.updatePassword(updatePasswordParam); + if (status == 1) { + return CommonResult.success(status); + } else { + return CommonResult.failed(); + } + } + + + @ApiOperation("获取教师信息列表,关联教师的username和name") @GetMapping("/get_teacherinf_list") public BaseResponse> getTeacherInfList(){ @@ -186,4 +188,5 @@ public class UmsUserController { return ResultUtils.success(teacherInfVO); } + } diff --git a/src/main/java/com/teaching/backend/controller/umsStudent/UmsStudentController.java b/src/main/java/com/teaching/backend/controller/umsStudent/UmsStudentController.java new file mode 100644 index 0000000..a2db786 --- /dev/null +++ b/src/main/java/com/teaching/backend/controller/umsStudent/UmsStudentController.java @@ -0,0 +1,13 @@ +package com.teaching.backend.controller.umsStudent; + +import io.swagger.annotations.Api; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@Api(tags = "UmsStudentController") +@RequestMapping("/api/student") +@Slf4j +public class UmsStudentController { +} diff --git a/src/main/java/com/teaching/backend/mapper/courses/StudentCoursesMapper.java b/src/main/java/com/teaching/backend/mapper/courses/StudentCoursesMapper.java index b6042f9..8a57f24 100644 --- a/src/main/java/com/teaching/backend/mapper/courses/StudentCoursesMapper.java +++ b/src/main/java/com/teaching/backend/mapper/courses/StudentCoursesMapper.java @@ -17,4 +17,7 @@ import java.util.List; public interface StudentCoursesMapper extends BaseMapper { void insertBatchSomeColumn(List studentCoursesList); + + + List selectBatchSomeStudent(String courseId); } diff --git a/src/main/java/com/teaching/backend/mapper/report/ReportMapper.java b/src/main/java/com/teaching/backend/mapper/report/ReportMapper.java new file mode 100644 index 0000000..6da6396 --- /dev/null +++ b/src/main/java/com/teaching/backend/mapper/report/ReportMapper.java @@ -0,0 +1,14 @@ +package com.teaching.backend.mapper.report; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.teaching.backend.model.dto.report.ReportDTO; +import com.teaching.backend.model.entity.report.Report; + +import java.time.LocalDate; + +public interface ReportMapper extends BaseMapper { + + String getBrowseByTime(LocalDate day); + + boolean addTodayBrowse(ReportDTO reportDTO); +} diff --git a/src/main/java/com/teaching/backend/mapper/umsAdmin/UmsUserMapper.java b/src/main/java/com/teaching/backend/mapper/umsAdmin/UmsUserMapper.java index c1d1a74..ca18264 100644 --- a/src/main/java/com/teaching/backend/mapper/umsAdmin/UmsUserMapper.java +++ b/src/main/java/com/teaching/backend/mapper/umsAdmin/UmsUserMapper.java @@ -1,6 +1,7 @@ package com.teaching.backend.mapper.umsAdmin; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.teaching.backend.model.entity.courses.StudentCourses; import com.teaching.backend.model.entity.umsAdmin.UmsRole; import com.teaching.backend.model.entity.umsAdmin.UmsTeacher; import com.teaching.backend.model.entity.umsAdmin.UmsUser; @@ -17,4 +18,5 @@ public interface UmsUserMapper extends BaseMapper { UmsTeacher getByIdTeacher(String id); UmsStudentVO getByIdStudent(String id); + } diff --git a/src/main/java/com/teaching/backend/model/dto/report/ReportDTO.java b/src/main/java/com/teaching/backend/model/dto/report/ReportDTO.java new file mode 100644 index 0000000..26bb311 --- /dev/null +++ b/src/main/java/com/teaching/backend/model/dto/report/ReportDTO.java @@ -0,0 +1,21 @@ +package com.teaching.backend.model.dto.report; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDate; + +@Data +@TableName("report") +public class ReportDTO implements Serializable { + + //时间 + private LocalDate createTime; + + //浏览量 + private String pageView; + +} diff --git a/src/main/java/com/teaching/backend/model/dto/umsAdmin/UmsStudentAndTeacherDTO.java b/src/main/java/com/teaching/backend/model/dto/umsAdmin/UmsStudentAndTeacherDTO.java index 4d8d3b5..42011e6 100644 --- a/src/main/java/com/teaching/backend/model/dto/umsAdmin/UmsStudentAndTeacherDTO.java +++ b/src/main/java/com/teaching/backend/model/dto/umsAdmin/UmsStudentAndTeacherDTO.java @@ -117,7 +117,7 @@ public class UmsStudentAndTeacherDTO implements Serializable { /** * user_id */ - private Integer userId; + private Long userId; /** * role_id diff --git a/src/main/java/com/teaching/backend/model/entity/report/Report.java b/src/main/java/com/teaching/backend/model/entity/report/Report.java new file mode 100644 index 0000000..83b4272 --- /dev/null +++ b/src/main/java/com/teaching/backend/model/entity/report/Report.java @@ -0,0 +1,24 @@ +package com.teaching.backend.model.entity.report; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDate; + +@Data +@TableName("report") +public class Report implements Serializable { + //主键 + @TableId(type = IdType.AUTO) + private Long id; + + //时间 + private LocalDate createTime; + + //浏览量 + private String pageView; + +} diff --git a/src/main/java/com/teaching/backend/model/vo/report/BrowseReportVO.java b/src/main/java/com/teaching/backend/model/vo/report/BrowseReportVO.java new file mode 100644 index 0000000..202690a --- /dev/null +++ b/src/main/java/com/teaching/backend/model/vo/report/BrowseReportVO.java @@ -0,0 +1,20 @@ +package com.teaching.backend.model.vo.report; + +import lombok.Builder; +import lombok.Data; + +import java.io.Serializable; + +@Data +@Builder +public class BrowseReportVO implements Serializable { + + //日期,以逗号分隔,例如:2022-10-01,2022-10-02,2022-10-03 + private String dateList; + + //本月浏览量,以逗号分隔,例如:200,210,220 + private String ThisMonthBrowseList; + + //上月浏览量,以逗号分隔,例如:20,21,10 + private String LastMonthBrowseList; +} diff --git a/src/main/java/com/teaching/backend/service/courses/ICoursesService.java b/src/main/java/com/teaching/backend/service/courses/ICoursesService.java index 7d3014b..11156c8 100644 --- a/src/main/java/com/teaching/backend/service/courses/ICoursesService.java +++ b/src/main/java/com/teaching/backend/service/courses/ICoursesService.java @@ -5,10 +5,13 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.teaching.backend.model.dto.courses.CoursesDTO; import com.teaching.backend.model.dto.courses.PageDTO; import com.teaching.backend.model.entity.courses.Courses; +import com.teaching.backend.model.entity.umsAdmin.UmsStudent; import com.teaching.backend.model.query.CourseQuery; import com.teaching.backend.model.vo.courses.CoursesVO; +import com.teaching.backend.model.vo.umsAdmin.UmsStudentVO; import javax.servlet.http.HttpServletResponse; +import java.util.HashSet; import java.util.List; import java.util.Map; @@ -41,4 +44,6 @@ public interface ICoursesService extends IService { CoursesVO getByIdCourseVo(String courseid); Map getPagePageSize2(int page, int pageSize); + + HashSet queryStudentList(CourseQuery courseQuery); } diff --git a/src/main/java/com/teaching/backend/service/impl/courses/CoursesServiceImpl.java b/src/main/java/com/teaching/backend/service/impl/courses/CoursesServiceImpl.java index ebc2af3..3e9b28a 100644 --- a/src/main/java/com/teaching/backend/service/impl/courses/CoursesServiceImpl.java +++ b/src/main/java/com/teaching/backend/service/impl/courses/CoursesServiceImpl.java @@ -13,6 +13,7 @@ import com.teaching.backend.exception.BusinessException; import com.teaching.backend.mapper.chapter.ChapterMapper; import com.teaching.backend.mapper.courses.*; import com.teaching.backend.mapper.records.LearningRecordsMapper; +import com.teaching.backend.mapper.umsAdmin.UmsStudentMapper; import com.teaching.backend.mapper.umsAdmin.UmsTeacherMapper; import com.teaching.backend.mapper.umsAdmin.UmsUserMapper; import com.teaching.backend.model.dto.courses.CoursesDTO; @@ -20,11 +21,13 @@ import com.teaching.backend.model.dto.courses.PageDTO; import com.teaching.backend.model.entity.chapter.Chapter; import com.teaching.backend.model.entity.courses.*; import com.teaching.backend.model.entity.records.LearningRecords; +import com.teaching.backend.model.entity.umsAdmin.UmsStudent; import com.teaching.backend.model.entity.umsAdmin.UmsTeacher; import com.teaching.backend.model.entity.umsAdmin.UmsUser; import com.teaching.backend.model.query.CourseQuery; import com.teaching.backend.model.vo.courses.CourseObjectivesTreeVO; import com.teaching.backend.model.vo.courses.CoursesVO; +import com.teaching.backend.model.vo.umsAdmin.UmsStudentVO; import com.teaching.backend.service.courses.ICoursesService; import com.teaching.backend.utils.CourseCode; import org.apache.poi.xwpf.usermodel.*; @@ -75,6 +78,8 @@ public class CoursesServiceImpl extends ServiceImpl impl @Autowired UmsTeacherMapper umsTeacherMapper; @Autowired + UmsStudentMapper umsStudentMapper; + @Autowired StudentCoursesMapper studentCoursesMapper; @Autowired ObjectiveContentKnowMapper objectiveContentKnowMapper; @@ -327,6 +332,22 @@ public class CoursesServiceImpl extends ServiceImpl impl } + @Override + public HashSet queryStudentList(CourseQuery courseQuery) { + PageDTO queryCourses = queryCourses(courseQuery); + List coursesList = queryCourses.getList(); + List courseIds = coursesList.stream().map(CoursesVO::getId).collect(Collectors.toList()); + HashSet studentNameList = new HashSet<>(); + for (String courseId : courseIds) { + List studentUsernames = studentCoursesMapper.selectBatchSomeStudent(courseId); + for (StudentCourses studentUsername : studentUsernames) { + UmsStudent umsStudent = umsStudentMapper.selectByUserId(Integer.valueOf(studentUsername.getStudent())); + studentNameList.add(umsStudent); + } + } + return studentNameList; + } + @Override public List getPagePageSize(int page, int pageSize) { int startIndex = (page-1) * pageSize; diff --git a/src/main/java/com/teaching/backend/service/impl/report/ReportServiceImpl.java b/src/main/java/com/teaching/backend/service/impl/report/ReportServiceImpl.java new file mode 100644 index 0000000..3cabf56 --- /dev/null +++ b/src/main/java/com/teaching/backend/service/impl/report/ReportServiceImpl.java @@ -0,0 +1,73 @@ +package com.teaching.backend.service.impl.report; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.teaching.backend.mapper.report.ReportMapper; +import com.teaching.backend.model.dto.report.ReportDTO; +import com.teaching.backend.model.entity.report.Report; +import com.teaching.backend.model.vo.report.BrowseReportVO; +import com.teaching.backend.service.report.ReportService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import java.time.LocalDate; +import java.util.ArrayList; +import java.util.List; + +@Service +@Slf4j +public class ReportServiceImpl extends ServiceImpl implements ReportService { + + @Autowired + private ReportMapper reportMapper; + + @Override + public BrowseReportVO getBrowseStatistics() { + //存放访问的前一天至前七天的每天对应的日期 + List dateList = new ArrayList<>(); + //存放这个月访问的前一天至前七天的每天对应的浏览量 + List ThisMonthBrowseList = new ArrayList<>(); + //存放上个月访问的前一天至前七天的每天对应的浏览量 + List LastMonthBrowseList = new ArrayList<>(); + + //获取今天的日期 + LocalDate end = LocalDate.now(); + + // 获取前七天的日期 + for (int i = 1; i <= 7; i++) { + LocalDate day = end.minusDays(i); + dateList.add(day); + + //查询今天对应的浏览量 + String browse = reportMapper.getBrowseByTime(day); + ThisMonthBrowseList.add(browse); + + //获取上个月的今天 + LocalDate lastMonthToday = end.minusMonths(1); + LocalDate lastMonth = lastMonthToday.minusDays(i); + //查询上个月的今天对应的浏览量 + String lastMonthBrowse = reportMapper.getBrowseByTime(lastMonth); + LastMonthBrowseList.add(lastMonthBrowse); + + } + return BrowseReportVO + .builder() + .dateList(StringUtils.join(dateList,",")) + .ThisMonthBrowseList(StringUtils.join(ThisMonthBrowseList,",")) + .LastMonthBrowseList(StringUtils.join(LastMonthBrowseList,",")) + .build(); + } + + @Override + public boolean getReceptionBrowse(ReportDTO reportDTO) { + if (reportDTO.getCreateTime() == null || reportDTO.getPageView() == null){ + return false; + } + boolean todayBrowse = reportMapper.addTodayBrowse(reportDTO); + if (todayBrowse == false){ + return false; + } + return true; + } + +} diff --git a/src/main/java/com/teaching/backend/service/umsAdmin/impl/UmsRoleServiceImpl.java b/src/main/java/com/teaching/backend/service/impl/umsAdmin/UmsRoleServiceImpl.java similarity index 95% rename from src/main/java/com/teaching/backend/service/umsAdmin/impl/UmsRoleServiceImpl.java rename to src/main/java/com/teaching/backend/service/impl/umsAdmin/UmsRoleServiceImpl.java index 8b65d65..e1209d5 100644 --- a/src/main/java/com/teaching/backend/service/umsAdmin/impl/UmsRoleServiceImpl.java +++ b/src/main/java/com/teaching/backend/service/impl/umsAdmin/UmsRoleServiceImpl.java @@ -1,4 +1,4 @@ -package com.teaching.backend.service.umsAdmin.impl; +package com.teaching.backend.service.impl.umsAdmin; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.teaching.backend.mapper.umsAdmin.UmsPermissionMapper; @@ -10,7 +10,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.*; -import java.util.stream.Collectors; /** diff --git a/src/main/java/com/teaching/backend/service/umsAdmin/impl/UmsUserServiceImpl.java b/src/main/java/com/teaching/backend/service/impl/umsAdmin/UmsUserServiceImpl.java similarity index 99% rename from src/main/java/com/teaching/backend/service/umsAdmin/impl/UmsUserServiceImpl.java rename to src/main/java/com/teaching/backend/service/impl/umsAdmin/UmsUserServiceImpl.java index 410378a..8d715d4 100644 --- a/src/main/java/com/teaching/backend/service/umsAdmin/impl/UmsUserServiceImpl.java +++ b/src/main/java/com/teaching/backend/service/impl/umsAdmin/UmsUserServiceImpl.java @@ -1,4 +1,4 @@ -package com.teaching.backend.service.umsAdmin.impl; +package com.teaching.backend.service.impl.umsAdmin; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.StrUtil; diff --git a/src/main/java/com/teaching/backend/service/report/ReportService.java b/src/main/java/com/teaching/backend/service/report/ReportService.java new file mode 100644 index 0000000..5fbe678 --- /dev/null +++ b/src/main/java/com/teaching/backend/service/report/ReportService.java @@ -0,0 +1,21 @@ +package com.teaching.backend.service.report; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.teaching.backend.model.dto.report.ReportDTO; +import com.teaching.backend.model.entity.report.Report; +import com.teaching.backend.model.vo.report.BrowseReportVO; + +public interface ReportService extends IService { + + /** + * 浏览统计 + * @return + */ + BrowseReportVO getBrowseStatistics(); + + /** + * 接收每日浏览量 + * @return + */ + boolean getReceptionBrowse(ReportDTO reportDTO); +} diff --git a/src/main/resources/mapper/ReportMapper.xml b/src/main/resources/mapper/ReportMapper.xml new file mode 100644 index 0000000..163d2d2 --- /dev/null +++ b/src/main/resources/mapper/ReportMapper.xml @@ -0,0 +1,18 @@ + + + + + INSERT INTO report (create_time, page_view) + VALUES + (#{createTime}, #{pageView}) + + + + diff --git a/src/main/resources/mapper/StudentCoursesMapper.xml b/src/main/resources/mapper/StudentCoursesMapper.xml index dfd2bba..cf56d3f 100644 --- a/src/main/resources/mapper/StudentCoursesMapper.xml +++ b/src/main/resources/mapper/StudentCoursesMapper.xml @@ -9,4 +9,12 @@ (#{item.student}, #{item.course}) + diff --git a/src/main/resources/mapper/UmsUserMapper.xml b/src/main/resources/mapper/UmsUserMapper.xml index 3b5dd71..7c422c1 100644 --- a/src/main/resources/mapper/UmsUserMapper.xml +++ b/src/main/resources/mapper/UmsUserMapper.xml @@ -76,4 +76,5 @@ WHERE s.user_id = #{id} +