| | |
| | | import com.yeshi.buwan.dao.CategoryVideoDao; |
| | | import com.yeshi.buwan.dao.ResourceVideoDao; |
| | | import com.yeshi.buwan.domain.*; |
| | | import com.yeshi.buwan.dto.mq.VideoExtraInfoChangeMQMsg; |
| | | import com.yeshi.buwan.util.mq.CMQManager; |
| | | import org.hibernate.HibernateException; |
| | | import org.hibernate.Query; |
| | | import org.hibernate.Session; |
| | |
| | | |
| | | public void addCategoryVideo(String videoId, long categoryId) { |
| | | List<CategoryVideo> list = categoryVideoDao.listByVideoIdAndCategoryId(videoId, categoryId); |
| | | if (list == null && list.size() == 0) { |
| | | if (list == null || list.size() == 0) { |
| | | CategoryVideo cv = new CategoryVideo(); |
| | | 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)); |
| | | } |
| | | } |
| | | |