zxl
9 天以前 9c6c57d3a81571e10a6a46446e18175067f4a8df
视频评论删除
6个文件已修改
2个文件已添加
135 ■■■■■ 已修改文件
framework/src/main/java/cn/lili/modules/lmk/domain/query/VideoCommentMangerQuery.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
framework/src/main/java/cn/lili/modules/lmk/mapper/VideoCommentMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
framework/src/main/java/cn/lili/modules/lmk/service/VideoCommentService.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
framework/src/main/java/cn/lili/modules/lmk/service/impl/ActivityServiceImpl.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoCommentServiceImpl.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoServiceImpl.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
framework/src/main/resources/mapper/lmk/VideoCommentMapper.xml 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
manager-api/src/main/java/cn/lili/controller/lmk/VideoCommentController.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
framework/src/main/java/cn/lili/modules/lmk/domain/query/VideoCommentMangerQuery.java
New file
@@ -0,0 +1,42 @@
package cn.lili.modules.lmk.domain.query;
import cn.lili.base.AbsQuery;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank;
import java.util.Date;
/**
 * lmk-shop-java
 *
 * @author : zxl
 * @date : 2025-08-14 10:37
 **/
@Data
@ApiModel(value = "VideoCommentMangerQuery查询参数", description = "管理端视频评论查询参数")
public class VideoCommentMangerQuery extends AbsQuery {
    @ApiModelProperty("视频id")
    private String videoId;
    @ApiModelProperty("评论内容")
    private String commentContent;
    @ApiModelProperty("用户名称")
    private String nickName;
    @ApiModelProperty("起始时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;
    @ApiModelProperty("结束时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;
}
framework/src/main/java/cn/lili/modules/lmk/mapper/VideoCommentMapper.java
@@ -1,6 +1,7 @@
package cn.lili.modules.lmk.mapper;
import cn.lili.modules.lmk.domain.entity.VideoComment;
import cn.lili.modules.lmk.domain.query.VideoCommentMangerQuery;
import cn.lili.modules.lmk.domain.vo.CollectTypeNumVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -27,6 +28,9 @@
     */
    VideoCommentVO getById(String id);
    IPage getManagerPage (IPage page, @Param("query") VideoCommentMangerQuery query);
    /**
    *  分页
    */
framework/src/main/java/cn/lili/modules/lmk/service/VideoCommentService.java
@@ -3,6 +3,7 @@
import cn.lili.modules.lmk.domain.entity.ThumbsUpRecord;
import cn.lili.modules.lmk.domain.entity.VideoComment;
import cn.lili.modules.lmk.domain.form.ThumbsUpRecordForm;
import cn.lili.modules.lmk.domain.query.VideoCommentMangerQuery;
import cn.lili.modules.lmk.domain.vo.CollectTypeNumVO;
import com.baomidou.mybatisplus.extension.service.IService;
import cn.lili.base.Result;
@@ -18,6 +19,8 @@
 */
public interface VideoCommentService extends IService<VideoComment> {
    Result mangerComment(VideoCommentMangerQuery query);
    /**
     * 添加
     * @param form
framework/src/main/java/cn/lili/modules/lmk/service/impl/ActivityServiceImpl.java
@@ -105,8 +105,11 @@
    public Result remove(List<String> ids) {
        //判断活动id是否已经存在报名人员
        for(String id : ids){
            canDeleteActivity(id);
            Result result = canDeleteActivity(id);
            Integer code = (Integer) result.get("CODE");
            if (code != 200){
                return result;
            }
        }
        return Result.ok("删除成功");
framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoCommentServiceImpl.java
@@ -9,6 +9,7 @@
import cn.lili.modules.lmk.constant.RedisKeyExpireConstant;
import cn.lili.modules.lmk.domain.entity.ThumbsUpRecord;
import cn.lili.modules.lmk.domain.form.ThumbsUpRecordForm;
import cn.lili.modules.lmk.domain.query.VideoCommentMangerQuery;
import cn.lili.modules.lmk.domain.vo.CollectTypeNumVO;
import cn.lili.modules.lmk.enums.general.VideoCommentStatusEnum;
import cn.lili.modules.lmk.event.event.VideoCommentNumCacheEvent;
@@ -63,6 +64,13 @@
    private final RocketmqCustomProperties rocketmqCustomProperties;
    private final ApplicationEventPublisher eventPublisher;
    @Override
    public Result mangerComment(VideoCommentMangerQuery query) {
        IPage<VideoCommentVO> page = PageUtil.getPage(query, VideoCommentVO.class);
        baseMapper.getManagerPage(page, query);
        return Result.ok().data(page.getRecords()).total(page.getTotal());
    }
    /**
     * 添加
     * @param form
framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoServiceImpl.java
@@ -743,8 +743,12 @@
                }
                if (VideoContentTypeEnum.VIDEO.getValue().equals(v.getVideoContentType())) {
                    v.setVideoUrl(cosUtil.getPreviewUrl(v.getVideoFileKey()));
                    String coverFileKey = v.getCoverFileKey();
                    v.setCoverUrl(cosUtil.getPreviewUrl(coverFileKey));
                    if (StringUtils.isNotBlank(coverFileKey) && !coverFileKey.contains("http")) {
                        v.setCoverUrl(cosUtil.getPreviewUrl(coverFileKey));
                    }
                } else if (VideoContentTypeEnum.IMG.getValue().equals(v.getVideoContentType()) && StringUtils.isNotBlank(v.getVideoImgs())) {
                    v.setImgs(JSON.parseArray(v.getVideoImgs(), String.class).stream().map(fileKey -> cosUtil.getPreviewUrl(fileKey)).collect(Collectors.toList()));
                }
framework/src/main/resources/mapper/lmk/VideoCommentMapper.xml
@@ -49,6 +49,38 @@
            LVC.id = #{id} AND LVC.delete_flag = 0
    </select>
    <select id="getManagerPage" resultMap="BaseResultMap">
        SELECT
            LVC.video_id,
            LVC.comment_content,
            LVC.reply_id,
            LVC.reply_user_id,
            LVC.reply_user_nickname,
            LVC.master_comment_id,
            LVC.status,
            LVC.thumbs_up_num,
            LVC.id,
            LVC.user_id,
            LVC.user_nickname,
            LVC.user_avatar,
            LVC.create_time
        FROM
            lmk_video_comment LVC
        WHERE
         LVC.video_id = #{query.videoId} AND LVC.delete_flag = 0
        <if test="query.commentContent != null and query.commentContent !=''">
            AND LVC.comment_content like concat('%',#{query.commentContent},'%')
        </if>
        <if test="query.nickName != null and query.nickName !=''">
            AND LVC.user_nickname like concat('%',#{query.nickName},'%')
        </if>
        <if test="query.startTime != null">
            AND LVC.create_time >= #{query.startTime}
        </if>
        <if test="query.endTime != null">
            AND LVC.create_time &lt;= #{query.endTime}
        </if>
    </select>
    <select id="getPage" resultMap="BaseResultMap">
        SELECT
manager-api/src/main/java/cn/lili/controller/lmk/VideoCommentController.java
New file
@@ -0,0 +1,33 @@
package cn.lili.controller.lmk;
import cn.lili.base.Result;
import cn.lili.modules.lmk.domain.query.VideoCommentMangerQuery;
import cn.lili.modules.lmk.service.VideoCommentService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
/**
 * lmk-shop-java
 * 管理端评价管理
 *
 * @author : zxl
 * @date : 2025-08-14 10:50
 **/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/manager/lmk/videoComment")
public class VideoCommentController {
    private final VideoCommentService videoCommentService;
    @GetMapping()
    public Result getPage(VideoCommentMangerQuery query){
        return videoCommentService.mangerComment(query);
    }
    @DeleteMapping("/{id}")
    public Result delete(@PathVariable("id")String id){
        return videoCommentService.removeById(id);
    }
}