原型类:UsrPlayRecord
- public class UsrPlayRecord extends BaseRequest2 implements Serializable{
- private static final long serialVersionUID = 1L;
- //播放记录编号
- private Long id;
- //用户ID
- private Long userId;
- //联想用户ID
- private String lenovoUserId;
- //模式 0:默认 1:儿童模式
- private String mode;
- //剧集ID
- private Long conAlbumId;
- //cp剧集ID
- private String outConAlbumId;
- //子剧集ID
- private Long conContentId;
- //cp子剧集ID
- private String outConContentId;
- //一级分类
- private String category1Ids;
- //二级分类
- private String category2Ids;
- //播放内容名称
- private String contentName;
- //播放地址
- private String playUrl;
- //海报
- private String poster;
- //PLATFORM
- private Long platform;
- //创建时间
- private Date cDate;
- //更新时间
- private Date uDate;
- //最后上报时间
- private String updateTime;
- //是否删除
- private String status;
- //播放记录时间
- private Long currPlayTime;
- //总时长
- private Long duration;
- //mm:ss时长
- private String fDuration;
- private String bssToken;
- private String filterShort;
目标类:PlayRecord
- public class PlayRecord {
- /** 主键ID*/
- private Long recordId;
- /** 剧集编号 */
- private Long conAlbumId;
- /** cp剧集编号 */
- private String outConAlbumId;
- /** 子剧集编号 */
- private Long conContentId;
- /** 播放内容名称 */
- private String contentName;
- /** 模式 */
- private String mode;
- /** 播放地址 */
- private String playUrl;
- /** 海报url */
- private String poster="";
- /** 修改时间 */
- private String updateTime;
- /** 修改时间2 */
- private Date updateTime2;
- /** 当前影视播放时间 */
- private Long currPlayTime;
- /** cp子剧集编号 */
- private String outConContentId;
- /** cpId */
- private String cpId;
- /** 剧集时间 */
- private String duration = "";
- /** 剧集时间 */
- private Long durationL = 0L;
- /** 剩余时间 */
- private String remainIngTime = "";
- /** 是否为剧集0:电影1:电视剧、综艺 */
- private String albumType;
- /** 下一集 子剧集编号 */
- private Long nextConContentId = 0L;
- /** 下一集 cp子剧集编号 */
- private String nextOutConContentId = "0";
- /** 播放内容名称 */
- private String nextContentName = "";
- /** 当前集数 */
- private String orderNumber;
- /** 下一集数 */
- private String nextOrderNumber;
- /** 是否是正片 */
- private String isMain;
- /** 一级分类 */
- private String category1Ids;
- /** 二级分类 */
- private String category2Ids;
- /** 是否是VIP视频 */
- private String payMark;
- /** 是否可播放 */
- private String isPlay;
- /** 上次播放平台 */
- private Long platform;
//未使用原型模式之前代码
- private PlayRecord getRecord(UsrPlayRecord record) {
- PlayRecord returnRecord = new PlayRecord();
- returnRecord.setRecordId(record.getId());
- returnRecord.setPlayUrl(record.getPlayUrl());
- returnRecord.setPlatform(record.getPlatform());
- returnRecord.setUpdateTime2(record.getuDate());
- returnRecord.setCpId(record.getCpId());
- returnRecord.setConAlbumId(record.getConAlbumId());
- returnRecord.setCurrPlayTime(record.getCurrPlayTime());
- returnRecord.setContentName(record.getContentName());
- returnRecord.setConContentId(record.getConContentId());
- returnRecord.setOutConAlbumId(record.getOutConAlbumId());
- returnRecord.setOutConContentId(record.getOutConContentId());
- }
使用原型模式后
- private PlayRecord getRecord(UsrPlayRecord record) {
- PlayRecord returnRecord = new PlayRecord();
- try {
- BeanUtils.copyProperties(returnRecord, record);
- } catch (Exception e) {
- throw new RuntimeException("克隆对象出错!");
- }
- return returnRecord ;
- }