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:
2025-11-17 23:37:04 +08:00
parent ebf05ab189
commit 755ba1153e
18 changed files with 1057 additions and 5 deletions

View File

@@ -77,9 +77,11 @@
</delete>
<select id="list" resultType="com.ycwl.basic.model.pc.video.resp.VideoRespVO">
select v.id, v.scenic_id, template_id, task_id, worker_id, video_url, v.create_time, v.update_time,
t.name templateName, t.price templatePrice,t.cover_url templateCoverUrl
t.name templateName, t.price templatePrice,t.cover_url templateCoverUrl,
tk.task_params taskParams
from video v
left join template t on v.template_id = t.id
left join task tk on v.task_id = tk.id
<where>
<if test="scenicId!= null">and v.scenic_id = #{scenicId} </if>
<if test="templateId!= null">and template_id = #{templateId} </if>
@@ -98,9 +100,11 @@
<select id="getById" resultType="com.ycwl.basic.model.pc.video.resp.VideoRespVO">
select v.id, v.scenic_id, template_id, task_id, worker_id, video_url, v.create_time, v.update_time,
t.name templateName,t.price templatePrice, t.cover_url templateCoverUrl, t.slash_price slashPrice,
v.height, v.width, v.duration
v.height, v.width, v.duration,
tk.task_params taskParams
from video v
left join template t on v.template_id = t.id
left join task tk on v.task_id = tk.id
where v.id = #{id}
</select>
<select id="findByTaskId" resultType="com.ycwl.basic.model.pc.video.entity.VideoEntity">
@@ -108,10 +112,12 @@
</select>
<select id="queryByRelation" resultType="com.ycwl.basic.model.pc.video.resp.VideoRespVO">
select v.id, mv.scenic_id, v.template_id, mv.task_id, mv.face_id, worker_id, video_url, v.create_time, v.update_time,
t.name templateName, t.price templatePrice,t.cover_url templateCoverUrl, mv.is_buy
t.name templateName, t.price templatePrice,t.cover_url templateCoverUrl, mv.is_buy,
tk.task_params taskParams
from member_video mv
left join video v on mv.video_id = v.id
left join template t on mv.template_id = t.id
left join task tk on mv.task_id = tk.id
<where>
<if test="scenicId!= null">and mv.scenic_id = #{scenicId} </if>
<if test="memberId!= null">and mv.member_id = #{memberId} </if>
@@ -175,4 +181,11 @@
set member_id = #{memberId}
where face_id = #{faceId}
</update>
<!-- 查询指定视频是否存在已购买记录 -->
<select id="countBuyRecordByVideoId" resultType="int">
select count(*)
from member_video
where video_id = #{videoId} and is_buy = 1
</select>
</mapper>