You've already forked FrameTour-BE
feat(video): 新增视频评价功能及购买状态查询
- 移除TaskController上的@Deprecated注解 - 在VideoController中新增/checkBuyStatus接口用于查询视频购买状态 - 新增VideoReviewController控制器,提供评价管理功能 - 新增MapTypeHandler用于处理Map类型与JSON字段的转换 - 在VideoMapper中增加countBuyRecordByVideoId方法查询视频购买记录 - 新增视频评价相关实体类、DTO及Mapper接口 - 实现VideoReviewService服务类,支持评价新增、分页查询、统计分析和Excel导出 - 在VideoServiceImpl中实现checkVideoBuyStatus方法 - 修改VideoMapper.xml,关联task表并查询task_params字段 - 新增VideoReviewMapper.xml配置文件,实现评价相关SQL查询
This commit is contained in:
@@ -56,6 +56,13 @@ public interface VideoMapper {
|
||||
int deleteNotBuyFaceRelations(Long userId, Long faceId);
|
||||
|
||||
int deleteUselessVideo();
|
||||
|
||||
|
||||
int updateMemberIdByFaceId(Long faceId, Long memberId);
|
||||
|
||||
/**
|
||||
* 查询指定视频是否存在已购买记录
|
||||
* @param videoId 视频ID
|
||||
* @return 已购买记录数量
|
||||
*/
|
||||
int countBuyRecordByVideoId(Long videoId);
|
||||
}
|
||||
|
||||
71
src/main/java/com/ycwl/basic/mapper/VideoReviewMapper.java
Normal file
71
src/main/java/com/ycwl/basic/mapper/VideoReviewMapper.java
Normal file
@@ -0,0 +1,71 @@
|
||||
package com.ycwl.basic.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ycwl.basic.model.pc.videoreview.dto.VideoReviewListReqDTO;
|
||||
import com.ycwl.basic.model.pc.videoreview.dto.VideoReviewRespDTO;
|
||||
import com.ycwl.basic.model.pc.videoreview.dto.VideoReviewStatisticsRespDTO;
|
||||
import com.ycwl.basic.model.pc.videoreview.entity.VideoReviewEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 视频评价Mapper接口
|
||||
*/
|
||||
@Mapper
|
||||
public interface VideoReviewMapper extends BaseMapper<VideoReviewEntity> {
|
||||
|
||||
/**
|
||||
* 分页查询评价列表(带关联查询)
|
||||
*
|
||||
* @param reqDTO 查询条件
|
||||
* @return 评价列表
|
||||
*/
|
||||
List<VideoReviewRespDTO> selectReviewList(VideoReviewListReqDTO reqDTO);
|
||||
|
||||
/**
|
||||
* 统计总评价数
|
||||
*
|
||||
* @return 总数
|
||||
*/
|
||||
Long countTotal();
|
||||
|
||||
/**
|
||||
* 计算平均评分
|
||||
*
|
||||
* @return 平均评分
|
||||
*/
|
||||
Double calculateAverageRating();
|
||||
|
||||
/**
|
||||
* 统计评分分布
|
||||
*
|
||||
* @return key: 评分, value: 数量
|
||||
*/
|
||||
List<Map<String, Object>> countRatingDistribution();
|
||||
|
||||
/**
|
||||
* 统计最近N天的评价趋势
|
||||
*
|
||||
* @param days 天数
|
||||
* @return key: 日期, value: 数量
|
||||
*/
|
||||
List<Map<String, Object>> countRecentTrend(@Param("days") int days);
|
||||
|
||||
/**
|
||||
* 统计景区评价排行(前N名)
|
||||
*
|
||||
* @param limit 限制数量
|
||||
* @return 景区排行列表
|
||||
*/
|
||||
List<VideoReviewStatisticsRespDTO.ScenicReviewRank> countScenicRank(@Param("limit") int limit);
|
||||
|
||||
/**
|
||||
* 查询所有机位评价数据(用于后端计算平均值)
|
||||
*
|
||||
* @return 机位评价列表
|
||||
*/
|
||||
List<Map<String, Integer>> selectAllCameraPositionRatings();
|
||||
}
|
||||
Reference in New Issue
Block a user