| | |
| | | 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; |
| | | |
| | |
| | | @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) { |
| | |
| | | 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)); |
| | | } |
| | | } |
| | | |