You've already forked FrameTour-BE
- 移除TaskController上的@Deprecated注解 - 在VideoController中新增/checkBuyStatus接口用于查询视频购买状态 - 新增VideoReviewController控制器,提供评价管理功能 - 新增MapTypeHandler用于处理Map类型与JSON字段的转换 - 在VideoMapper中增加countBuyRecordByVideoId方法查询视频购买记录 - 新增视频评价相关实体类、DTO及Mapper接口 - 实现VideoReviewService服务类,支持评价新增、分页查询、统计分析和Excel导出 - 在VideoServiceImpl中实现checkVideoBuyStatus方法 - 修改VideoMapper.xml,关联task表并查询task_params字段 - 新增VideoReviewMapper.xml配置文件,实现评价相关SQL查询
56 lines
1.6 KiB
Java
56 lines
1.6 KiB
Java
package com.ycwl.basic.controller.pc;
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
import com.ycwl.basic.model.pc.video.entity.VideoEntity;
|
|
import com.ycwl.basic.model.pc.video.req.VideoReqQuery;
|
|
import com.ycwl.basic.model.pc.video.resp.VideoRespVO;
|
|
import com.ycwl.basic.service.pc.VideoService;
|
|
import com.ycwl.basic.utils.ApiResponse;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import java.util.List;
|
|
|
|
/**
|
|
* @Author:longbinbin
|
|
* @Date:2024/12/3 16:28
|
|
*/
|
|
|
|
@RestController
|
|
@RequestMapping("/api/video/v1")
|
|
// 视频成片管理
|
|
public class VideoController {
|
|
|
|
@Autowired
|
|
private VideoService videoService;
|
|
|
|
// 分页查询成片
|
|
@PostMapping("/page")
|
|
public ApiResponse<PageInfo<VideoRespVO>> pageQuery(@RequestBody VideoReqQuery videoReqQuery) {
|
|
return videoService.pageQuery(videoReqQuery);
|
|
}
|
|
// 查询成片列表
|
|
@PostMapping("/list")
|
|
public ApiResponse<List<VideoRespVO>> list(@RequestBody VideoReqQuery videoReqQuery) {
|
|
return videoService.list(videoReqQuery);
|
|
}
|
|
// 查询成片详情
|
|
@GetMapping("/getDetail/{id}")
|
|
public ApiResponse<VideoRespVO> getById(@PathVariable Long id) {
|
|
return videoService.getById(id);
|
|
}
|
|
|
|
/**
|
|
* 查询视频是否被购买
|
|
*
|
|
* @param videoId 视频ID
|
|
* @return 是否已购买
|
|
*/
|
|
@GetMapping("/checkBuyStatus")
|
|
public ApiResponse<Boolean> checkBuyStatus(@RequestParam("videoId") Long videoId) {
|
|
Boolean isBuy = videoService.checkVideoBuyStatus(videoId);
|
|
return ApiResponse.success(isBuy);
|
|
}
|
|
|
|
}
|