| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.yeshi.buwan.dao.CategoryVideoDao; |
| | | import com.yeshi.buwan.dao.juhe.SoHuAlbumDao; |
| | | import com.yeshi.buwan.dao.juhe.SoHuVideoDao; |
| | | import com.yeshi.buwan.dao.juhe.sohu.SoHuAlbumDao; |
| | | import com.yeshi.buwan.dao.juhe.sohu.SoHuVideoDao; |
| | | import com.yeshi.buwan.domain.CategoryVideo; |
| | | import com.yeshi.buwan.domain.ResourceVideo; |
| | | import com.yeshi.buwan.domain.VideoDetailInfo; |
| | |
| | | import com.yeshi.buwan.domain.push.VideoPushHistory; |
| | | import com.yeshi.buwan.service.imp.StatisticsService; |
| | | import com.yeshi.buwan.service.imp.push.PushService; |
| | | import com.yeshi.buwan.sohu.SoHuUtil; |
| | | import com.yeshi.buwan.sohu.entity.SoHuAlbum; |
| | | import com.yeshi.buwan.sohu.entity.SoHuVideo; |
| | | import com.yeshi.buwan.sohu.entity.VideoSoHu; |
| | | import com.yeshi.buwan.videos.sohu.SoHuUtil; |
| | | import com.yeshi.buwan.videos.sohu.entity.SoHuAlbum; |
| | | import com.yeshi.buwan.videos.sohu.entity.SoHuVideo; |
| | | import com.yeshi.buwan.videos.sohu.entity.VideoSoHu; |
| | | import com.yeshi.buwan.util.StringUtil; |
| | | |
| | | @Service |
| | |
| | | private PushService pushService; |
| | | @Resource |
| | | private CategoryVideoDao categoryVideoDao; |
| | | |
| | | public PushService getPushService() { |
| | | return pushService; |
| | | } |
| | | |
| | | public void setPushService(PushService pushService) { |
| | | this.pushService = pushService; |
| | | } |
| | | |
| | | public StatisticsService getStatisticsService() { |
| | | return statisticsService; |
| | | } |
| | | |
| | | public void setStatisticsService(StatisticsService statisticsService) { |
| | | this.statisticsService = statisticsService; |
| | | } |
| | | |
| | | public SoHuVideoDao getSoHuVideoDao() { |
| | | return soHuVideoDao; |
| | | } |
| | | |
| | | public void setSoHuVideoDao(SoHuVideoDao soHuVideoDao) { |
| | | this.soHuVideoDao = soHuVideoDao; |
| | | } |
| | | |
| | | public SoHuAlbumDao getSoHuAlbumDao() { |
| | | return soHuAlbumDao; |
| | | } |
| | | |
| | | public void setSoHuAlbumDao(SoHuAlbumDao soHuAlbumDao) { |
| | | this.soHuAlbumDao = soHuAlbumDao; |
| | | } |
| | | |
| | | @SuppressWarnings("unchecked") |
| | | public String addAlbum(final SoHuAlbum album) { |
| | |
| | | session.getTransaction().commit(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | if (session.getTransaction().isActive()) |
| | | session.getTransaction().rollback(); |
| | | } |
| | | return vid; |
| | |
| | | } |
| | | |
| | | public List<VideoType> getVideoTypeList(SoHuAlbum sa) { |
| | | List<VideoType> list = new ArrayList<VideoType>(); |
| | | List<VideoType> list = new ArrayList<>(); |
| | | String cateCode = sa.getCate_code(); |
| | | String[] ca = cateCode.split(";"); |
| | | for (int i = 1; i < ca.length; i++) { |
| | |
| | | } |
| | | |
| | | @SuppressWarnings("unchecked") |
| | | public List<VideoDetailInfo> getVideoDetailList(final String videoid) { |
| | | public List<VideoDetailInfo> getVideoDetailList(final String videoid,int page,int pageSize) { |
| | | return (List<VideoDetailInfo>) soHuAlbumDao.excute(new HibernateCallback<List<VideoDetailInfo>>() { |
| | | public List<VideoDetailInfo> doInHibernate(Session session) throws HibernateException { |
| | | List<VideoDetailInfo> detailList = new ArrayList<VideoDetailInfo>(); |
| | | List<VideoDetailInfo> detailList = new ArrayList<>(); |
| | | try { |
| | | List<SoHuAlbum> list = session.createQuery("select vs.album from VideoSoHu vs where vs.video.id=?") |
| | | .setParameter(0, videoid).list(); |
| | |
| | | public VideoDetailInfo getLatestVideoDetail(final String videoid) { |
| | | return (VideoDetailInfo) soHuAlbumDao.excute(new HibernateCallback<VideoDetailInfo>() { |
| | | public VideoDetailInfo doInHibernate(Session session) throws HibernateException { |
| | | List<VideoDetailInfo> detailList = new ArrayList<VideoDetailInfo>(); |
| | | List<VideoDetailInfo> detailList = new ArrayList<>(); |
| | | try { |
| | | List<SoHuAlbum> list = session.createQuery("select vs.album from VideoSoHu vs where vs.video.id=?") |
| | | .setParameter(0, videoid).list(); |