Package com.skyline.wo.model

Examples of com.skyline.wo.model.Video


    /**
     * 视频缩略图
     */
    String thumbnail = doc.select("meta[property=og:image]").attr("content");

    Video video = new Video();
    video.setTitle(title);
    video.setThumbnail(thumbnail);
    video.setFlashUrl(flash);
    video.setSource("音悦台MV");
    video.setPageUrl(url);
    video.setSummary(summary);
    video.setHtmlCode(getHtmlCode(flash));
    return video;
  }
View Full Code Here


    }
  }

  @SuppressWarnings("deprecation")
  private void addVideoShare(Long sharerId, String sharerNickname, String sharerPortrait, Long resourceId) {
    Video video = videoService.getVideoById(resourceId);
    Map<String, Object> valueMap = new HashMap<String, Object>();
    valueMap.put("sharerId", sharerId);
    valueMap.put("videoId", video.getId());
    valueMap.put("videoHtmlCode", video.getHtmlCode());
    valueMap.put("thumbnail", video.getThumbnail());
    valueMap.put("videoSummary", video.getSummary());
    String resourceDigest = FreeMarkerUtils.getVideoDigest( valueMap);
    Long shareId = shareDao.insertShare(sharerId, sharerNickname, sharerPortrait, ShareType.VIDEO, resourceId, video.getTitle(),
        "<img src='" + video.getThumbnail() + "'/><br>" + video.getSummary(), video.getOwnerId(), video.getOwnerNickname(),
        video.getOwnerPortrait(), null, null);
    personalFeedService.addFeed(shareId, video.getTitle(), resourceDigest, sharerId, sharerNickname, sharerPortrait, sharerId,
        FeedType.VIDEO_SHARE);
    // return shareId;
  }
View Full Code Here

    return MAPPER;
  }
 
  @Override
  public Video mapRow(ResultSet rs, int arg1) throws SQLException {
    Video v=new Video();
    v.setCommentNum(rs.getInt("commentNum"));
    v.setCreateTime(rs.getTimestamp("createTime"));
    v.setDown(rs.getInt("down"));
    v.setFlashUrl(rs.getString("flashUrl"));
    v.setHtmlCode(rs.getString("htmlCode"));
    v.setId(rs.getLong("id"));
    v.setOwnerId(rs.getLong("ownerId"));
    v.setOwnerNickname(rs.getString("ownerNickname"));
    v.setOwnerPortrait(rs.getString("ownerPortrait"));
    v.setPageUrl(rs.getString("pageUrl"));
    v.setShareNum(rs.getInt("shareNum"));
    v.setSource(rs.getString("source"));
    v.setSummary(rs.getString("summary"));
    v.setThumbnail(rs.getString("thumbnail"));
    v.setTime(rs.getString("time"));
    v.setTitle(rs.getString("title"));
    v.setUp(rs.getInt("up"));
    //v.setUpdateTime()
    v.setVisitNum(rs.getInt("visitNum"));
    //v.setDigest(rs.getString("digest"));
    return v;
  }
View Full Code Here

  Video queryVideoInfo(String url) {
    User user = (User) WebHelper.getSessionAttribute(null, Constant.SESSION_USER);
    if (user == null || user.getId() == 0) {
      return null;
    } else {
      Video video;
      try {
        video = videoService.queryVideoInfo(url);
        if (video != null) {
          video.setOwnerId(user.getId());
          video.setOwnerNickname(user.getNickname());
          video.setOwnerPortrait(user.getPortrait());
          WebHelper.setSessionAttribute(null, "lastQueryVideoInfo", video);
        }
      } catch (Exception e) {
        // 对出错的情况进行处理
        video = null;
View Full Code Here

  }

  @RequestMapping(value = "/addVideo", method = RequestMethod.POST)
  @ResponseBody
  public long addVideo(Video modifyedVideo) {
    Video video = (Video) WebHelper.getSessionAttribute(null, "lastQueryVideoInfo");
    User user = (User) WebHelper.getSessionAttribute(null, Constant.SESSION_USER);
    if (video == null || user == null || user.getId() == 0) {
      return 0;
    } else {
      long id = videoService.addVideo(user.getId(), user.getPortrait(), user.getNickname(), modifyedVideo.getTitle(),
          video.getThumbnail(), modifyedVideo.getSummary(), video.getTime(), video.getSource(), video.getPageUrl(),
          video.getFlashUrl(), video.getHtmlCode());
      return id;
    }
  }
View Full Code Here

  }

  @RequestMapping(value = "/view/{id}", method = RequestMethod.GET)
  public ModelAndView view(@PathVariable Long id) {
    ModelAndView mav = new ModelAndView();
    Video video = videoService.getVideoById(id);
    mav.addObject("video", video);
    mav.setViewName(ViewPaths.VIDEO_VIEW);
    return mav;
  }
View Full Code Here

  @Override
  @Cache(keyPattern = "video-:id", type = CacheCategoryType.VIDEO)
  public Video queryVideoById(@Param("id") Long id) throws NoResourceException {
    try {
      Video video = jdbcTemplate.queryForObject(queryVideoByIdSql, VideoMapper.getMapper(), id);
      return video;
    } catch (Exception e) {
      throw new NoResourceException("id为" + id + "的视频不存在");
    }
  }
View Full Code Here

    return id;
  }

  @Override
  public Video getVideoById(Long id) throws NoResourceException {
    Video video = videoDao.queryVideoById(id);
    videoDao.updateVideoVisitNum(id);
    return video;
  }
View Full Code Here

    //ownerPortrait, ownerNickname, title, thumbnail, summary, time, source, pageUrl, flashUrl, htmlCode)
  }
 
  //@Test
  public void testQueryById(){
    Video video=videoService.getVideoById(2l);
    System.out.println(video.getTitle());
  }
View Full Code Here

        "http://v.youku.com/v_playlist/f16570114o1p0.html",
        "http://v.youku.com/v_show/id_XMzE1ODc2OTY4.html",
        };
    for(String url:urls){
      try {
        Video video=videoService.queryVideoInfo(url);
        System.out.println("出处:\t"+video.getSource());
        System.out.println("标题:\t"+video.getTitle());
        System.out.println("片长:\t"+video.getTime());
        System.out.println("缩略图:\t"+video.getThumbnail());
        System.out.println("flash地址:\t"+video.getFlashUrl());
        System.out.println("html代码:\t"+video.getHtmlCode());
        System.out.println("链接:\t"+video.getPageUrl());
        System.out.println("简介:\t"+video.getSummary());
        System.out.println("==========================");
      } catch (Exception e) {
        //e.printStackTrace();
        System.out.println(url);
      }
View Full Code Here

TOP

Related Classes of com.skyline.wo.model.Video

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.