Browse Source

Merge branch 'feature/1113-vipCourse' of http://git.dayaedu.com/yonge/cooleshow into feature/1113-vipCourse

刘俊驰 4 months ago
parent
commit
8f4c8cc824

+ 7 - 7
cooleshow-app/src/main/java/com/yonge/cooleshow/student/controller/ExposureReportController.java → cooleshow-app/src/main/java/com/yonge/cooleshow/student/controller/ExposureRecordController.java

@@ -1,7 +1,7 @@
 package com.yonge.cooleshow.student.controller;
 
-import com.yonge.cooleshow.biz.dal.service.ExposureReportService;
-import com.yonge.cooleshow.biz.dal.wrapper.ExposureReportWrapper;
+import com.yonge.cooleshow.biz.dal.service.ExposureRecordService;
+import com.yonge.cooleshow.biz.dal.wrapper.ExposureRecordWrapper;
 import com.yonge.cooleshow.common.controller.BaseController;
 import com.yonge.cooleshow.common.entity.HttpResponseResult;
 import io.swagger.annotations.Api;
@@ -17,16 +17,16 @@ import java.util.List;
 @Api(tags = "曝光记录")
 @RestController
 @RequestMapping("${app-config.url.student:}/exposure")
-public class ExposureReportController extends BaseController {
+public class ExposureRecordController extends BaseController {
 
     @Resource
-    private ExposureReportService exposureReportService;
+    private ExposureRecordService exposureRecordService;
 
 
     @ApiOperation(value = "记录曝光信息")
-    @PostMapping("/report")
-    public HttpResponseResult report(@RequestBody List<ExposureReportWrapper.SaveExposureReportDto> exposureReportDto) {
-        exposureReportService.report(exposureReportDto);
+    @PostMapping("/record")
+    public HttpResponseResult record(@RequestBody List<ExposureRecordWrapper.SaveExposureRecordDto> exposureReportDto) {
+        exposureRecordService.record(exposureReportDto);
         return succeed();
     }
 

+ 13 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/ExposureRecordDao.java

@@ -0,0 +1,13 @@
+package com.yonge.cooleshow.biz.dal.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.yonge.cooleshow.biz.dal.entity.ExposureRecord;
+import com.yonge.cooleshow.biz.dal.wrapper.ExposureRecordWrapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface ExposureRecordDao extends BaseMapper<ExposureRecord> {
+    void saveExposureRecord(@Param("beans") List<ExposureRecordWrapper.SaveExposureRecordDto> exposureRecordDto);
+}
+

+ 0 - 13
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/dao/ExposureReportDao.java

@@ -1,13 +0,0 @@
-package com.yonge.cooleshow.biz.dal.dao;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.yonge.cooleshow.biz.dal.entity.ExposureReport;
-import com.yonge.cooleshow.biz.dal.wrapper.ExposureReportWrapper;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-
-public interface ExposureReportDao extends BaseMapper<ExposureReport> {
-    void saveExposureReport(@Param("beans") List<ExposureReportWrapper.SaveExposureReportDto> exposureReportDto);
-}
-

+ 1 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/ExposureReport.java → cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/entity/ExposureRecord.java

@@ -12,7 +12,7 @@ import java.util.Date;
 
 @Data
 @ApiModel(value = "exposure_record-曝光记录表")
-public class ExposureReport implements Serializable {
+public class ExposureRecord implements Serializable {
     @TableId(value = "id_", type = IdType.AUTO)
     @ApiModelProperty(value = "主键")
     private Long id;

+ 12 - 0
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/ExposureRecordService.java

@@ -0,0 +1,12 @@
+package com.yonge.cooleshow.biz.dal.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.yonge.cooleshow.biz.dal.entity.ExposureRecord;
+import com.yonge.cooleshow.biz.dal.wrapper.ExposureRecordWrapper;
+
+import java.util.List;
+
+public interface ExposureRecordService extends IService<ExposureRecord> {
+
+    void record(List<ExposureRecordWrapper.SaveExposureRecordDto> exposureRecordDto);
+}

+ 0 - 12
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/ExposureReportService.java

@@ -1,12 +0,0 @@
-package com.yonge.cooleshow.biz.dal.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.yonge.cooleshow.biz.dal.entity.ExposureReport;
-import com.yonge.cooleshow.biz.dal.wrapper.ExposureReportWrapper;
-
-import java.util.List;
-
-public interface ExposureReportService extends IService<ExposureReport> {
-
-    void report(List<ExposureReportWrapper.SaveExposureReportDto> exposureReportDto);
-}

+ 13 - 13
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/ExposureReportServiceImpl.java → cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/ExposureRecordServiceImpl.java

@@ -1,13 +1,13 @@
 package com.yonge.cooleshow.biz.dal.service.impl;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.yonge.cooleshow.biz.dal.dao.ExposureReportDao;
-import com.yonge.cooleshow.biz.dal.entity.ExposureReport;
+import com.yonge.cooleshow.biz.dal.dao.ExposureRecordDao;
+import com.yonge.cooleshow.biz.dal.entity.ExposureRecord;
 import com.yonge.cooleshow.biz.dal.service.CourseGroupService;
-import com.yonge.cooleshow.biz.dal.service.ExposureReportService;
+import com.yonge.cooleshow.biz.dal.service.ExposureRecordService;
 import com.yonge.cooleshow.biz.dal.service.MusicSheetService;
 import com.yonge.cooleshow.biz.dal.service.VideoLessonGroupService;
-import com.yonge.cooleshow.biz.dal.wrapper.ExposureReportWrapper;
+import com.yonge.cooleshow.biz.dal.wrapper.ExposureRecordWrapper;
 import com.yonge.toolset.utils.date.DateUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -21,8 +21,8 @@ import java.util.Map;
 import java.util.stream.Collectors;
 
 @Service
-public class ExposureReportServiceImpl extends ServiceImpl<ExposureReportDao, ExposureReport> implements ExposureReportService {
-    private final static Logger log = LoggerFactory.getLogger(ExposureReportServiceImpl.class);
+public class ExposureRecordServiceImpl extends ServiceImpl<ExposureRecordDao, ExposureRecord> implements ExposureRecordService {
+    private final static Logger log = LoggerFactory.getLogger(ExposureRecordServiceImpl.class);
 
     @Resource
     private CourseGroupService courseGroupService;
@@ -31,23 +31,23 @@ public class ExposureReportServiceImpl extends ServiceImpl<ExposureReportDao, Ex
     @Resource
     private VideoLessonGroupService videoLessonGroupService;
 
-    public ExposureReportDao getDao() {
+    public ExposureRecordDao getDao() {
         return baseMapper;
     }
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public void report(List<ExposureReportWrapper.SaveExposureReportDto> exposureReportDto) {
+    public void record(List<ExposureRecordWrapper.SaveExposureRecordDto> exposureRecordDto) {
         Date now = new Date();
         String exposureTime = DateUtil.format(now, DateUtil.DEFAULT_PATTERN);
-        exposureReportDto.forEach(e->e.setExposureTime(exposureTime));
-        baseMapper.saveExposureReport(exposureReportDto);
+        exposureRecordDto.forEach(e->e.setExposureTime(exposureTime));
+        baseMapper.saveExposureRecord(exposureRecordDto);
         //按类型分组
-        Map<String, List<ExposureReportWrapper.SaveExposureReportDto>> typeMap = exposureReportDto.stream().collect(Collectors.groupingBy(ExposureReportWrapper.SaveExposureReportDto::getObjectType));
+        Map<String, List<ExposureRecordWrapper.SaveExposureRecordDto>> typeMap = exposureRecordDto.stream().collect(Collectors.groupingBy(ExposureRecordWrapper.SaveExposureRecordDto::getObjectType));
         typeMap.forEach((k,v)->{
-            List<ExposureReportWrapper.SaveExposureReportDto> saveExposureReportDtos = typeMap.get(k);
+            List<ExposureRecordWrapper.SaveExposureRecordDto> saveExposureReportDtos = typeMap.get(k);
             //按对象id分组,并获取集合数量
-            Map<Long, Integer> exposureNumMap = saveExposureReportDtos.stream().collect(Collectors.groupingBy(ExposureReportWrapper.SaveExposureReportDto::getObjectId, Collectors.summingInt(e -> 1)));
+            Map<Long, Integer> exposureNumMap = saveExposureReportDtos.stream().collect(Collectors.groupingBy(ExposureRecordWrapper.SaveExposureRecordDto::getObjectId, Collectors.summingInt(e -> 1)));
             exposureNumMap.forEach((objectId,exposureNum)-> {
                 if ("LIVE".equals(k)) {
                     courseGroupService.getDao().updateExposureNum(objectId, exposureNum);

+ 2 - 2
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/ExposureReportWrapper.java → cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/wrapper/ExposureRecordWrapper.java

@@ -12,13 +12,13 @@ import lombok.NoArgsConstructor;
  * 2022-12-07 10:16:58
  */
 @ApiModel(value = "ExposureReportWrapper", description = "曝光记录")
-public class ExposureReportWrapper {
+public class ExposureRecordWrapper {
 
     @Data
     @Builder
     @NoArgsConstructor
     @AllArgsConstructor
-    public static class SaveExposureReportDto {
+    public static class SaveExposureRecordDto {
         @ApiModelProperty("分类")
         private String objectType;
 

+ 3 - 3
cooleshow-user/user-biz/src/main/resources/config/mybatis/ExposureReportMapper.xml → cooleshow-user/user-biz/src/main/resources/config/mybatis/ExposureRecordDao.xml

@@ -1,10 +1,10 @@
 <?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="com.yonge.cooleshow.biz.dal.dao.ExposureReportDao">
+<mapper namespace="com.yonge.cooleshow.biz.dal.dao.ExposureRecordDao">
 
-	<update id="saveExposureReport">
-		insert into exposure_report (exposure_time_, exposure_num_, object_id_, object_type_, platform_)
+	<update id="saveExposureRecord">
+		insert into exposure_record (exposure_time_, exposure_num_, object_id_, object_type_, platform_)
 		values
 		<foreach collection="beans" item="bean" separator="," >
 			(#{bean.exposureTime}, 1, #{bean.objectId}, #{bean.objectType}, #{bean.platform})