admin
2024-10-17 b30fb8afd3cd6228bda9b182dc412bb3c8daf69c
src/main/java/com/yeshi/buwan/service/imp/CategoryVideoService.java
@@ -6,11 +6,12 @@
import com.yeshi.buwan.domain.VideoType;
import com.yeshi.buwan.dto.mq.VideoDataChangeMQMsg;
import com.yeshi.buwan.dto.mq.VideoExtraInfoChangeMQMsg;
import com.yeshi.buwan.util.mq.CMQManager;
import com.yeshi.buwan.util.mq.rabbit.RabbitmqManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.yeshi.utils.StringUtil;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
@@ -20,6 +21,9 @@
    @Autowired
    private CategoryVideoDao categoryVideoDao;
    @Resource
    private RabbitmqManager rabbitmqManager;
    public void addCategoryVideo(String videoId, long categoryId) {
        List<CategoryVideo> list = categoryVideoDao.listByVideoIdAndCategoryId(videoId, categoryId);
        if (list == null || list.size() == 0) {
@@ -27,8 +31,8 @@
            cv.setVideo(new VideoInfo(videoId));
            cv.setVideoType(new VideoType(categoryId));
            categoryVideoDao.save(cv);
            CMQManager.getInstance().addVideoExtraInfoChanged(new VideoExtraInfoChangeMQMsg(VideoExtraInfoChangeMQMsg.TYPE_CATEGORY, videoId, VideoExtraInfoChangeMQMsg.ACTION_ADD));
            CMQManager.getInstance().addVideoDataChanged(new VideoDataChangeMQMsg(VideoDataChangeMQMsg.TYPE_VIDEO_CATEGORY, videoId, VideoDataChangeMQMsg.ACTION_ADD));
            rabbitmqManager.addVideoExtraInfoChanged(new VideoExtraInfoChangeMQMsg(VideoExtraInfoChangeMQMsg.TYPE_CATEGORY, videoId, VideoExtraInfoChangeMQMsg.ACTION_ADD));
            rabbitmqManager.addVideoDataChanged(new VideoDataChangeMQMsg(VideoDataChangeMQMsg.TYPE_VIDEO_CATEGORY, videoId, VideoDataChangeMQMsg.ACTION_ADD));
        }
    }