ContentDTO.ets 7.79 KB
import { FullColumnImgUrlDTO } from '../detail/FullColumnImgUrlDTO';
import { LiveInfoDTO } from '../detail/LiveInfoDTO';
import { VideoInfoDTO } from '../detail/VideoInfoDTO';
import { InteractDataDTO } from './InteractDataDTO';
import { slideShows } from '../morningevening/slideShows';
import { VoiceInfoDTO } from '../detail/VoiceInfoDTO';
import { RmhInfoDTO } from '../detail/RmhInfoDTO';
import { commentInfo } from './commentInfo';
import { BaseDTO } from '../component/BaseDTO';
import { LiveRoomDataBean } from '../live/LiveRoomDataBean';
import { ReserveItemBean } from '../live/ReserveItemBean';

export class ContentShareInfoDTO {
  shareTitle: string = ''
  shareUrl: string = ''
  shareSummary: string = ''
  shareCoverUrl: string = ''
  sharePosterCoverUrl: string = ''
  shareOpen: number = 0
  sharePosterOpen: number = 0
}

@Observed
export class ContentDTO implements BaseDTO {
  seoTags: string = '';
  cornerMark:string = '';
  liveType?: string; // 直播新闻-直播状态
  expIds: string = '';
  itemId: string = '';
  itemType: string = '';
  shareFlag?: string = '1';
  appStyle: string = '';
  cityCode: string = '';
  coverSize: string = '';
  coverType: number = -1;
  coverUrl: string = '';
  cnsTraceId: string = ''
  description: string = '';
  districtCode: string = '';
  endTime: string = '';
  hImageUrl: string = '';
  heatValue: string = '';
  innerUrl: string = '';
  landscape: number = -1;
  lengthTime?: object;
  linkUrl: string = '';
  openLikes: number = 0;
  openComment?: number;
  openUrl: string = '';
  pageId: string = '';
  // playUrls: any[];
  programAuth: string = '';
  programId: string = '';
  programName: string = '';
  programSource: number = -1;
  programType: number = -1;
  provinceCode: string = '';
  // rankingList: any[];
  showTitleEd: string = '';
  showTitleIng: string = '';
  showTitleNo: string = '';
  // sortValue?: any;
  startTime: string = '';
  subType: string = '';
  subtitle: string = '';
  sceneId: string = '';
  subSceneId: string = '';
  title: string = '';
  vImageUrl: string = '';
  screenType: string = '';
  source: string = '';
  objectType: string = '';//0:不跳转 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频,14动态图文,15动态视频
  objectId: string = '';
  objectLevel: string = '';// 对象分类;频道(1:一级频道,2:二级频道),专题(21:文章专题,22:音频专题,23:直播专题,24:话题专题)
  channelId: string = '';
  relId: string = '';
  relType: string = '';
  newsTitle: string = ''; //单图卡/2行标题/3行标题
  publishTime: string = '';
  publishTimestamp: string = '';
  visitorComment: number = 0;
  fullColumnImgUrls: FullColumnImgUrlDTO[] = [];
  liveInfo: LiveInfoDTO = {} as LiveInfoDTO; // 直播新闻信息【BFF聚合】
  videoInfo: VideoInfoDTO = {} as VideoInfoDTO; // 视频新闻信息【BFF聚合】,视频非原片+清晰度最高的
  shareInfo: ContentShareInfoDTO = {} as ContentShareInfoDTO

  newsSummary: string = ''; //appstyle:2 ,新闻详情
  contentText?: string = '';
  // 二次请求接口,返回的数据,这里组装到content里;
  interactData?: InteractDataDTO;
  hasMore: number = -1;
  slideShows: slideShows[] = [];
  voiceInfo: VoiceInfoDTO = {} as VoiceInfoDTO;
  tagWord: number = -1;
  isSelect: boolean = false;
  rmhInfo: RmhInfoDTO = {} as RmhInfoDTO; // 人民号信息
  photoNum: number = 0;
  corner: string = '';
  rmhPlatform: number = 0;
  newTags: string = '';
  titleShow?: number;
  isSearch?: boolean; // 是否是搜索的结果,区分搜索和主页的数据
  isCollection?: boolean; // 是否是收藏的结果,区分搜索和主页的数据
  commentInfo?: commentInfo
  //底部导航栏 id(用于频道跳转)
  bottomNavId: string = '';
  // 链接类型: 0:无链接;1:内链(文章);2:外链
  openType: string = '1';
  extra: string = ''
  sameContentList:ContentDTO[] = []
  sameContentListJson:string = ""
  sameContentListSize:number = 0
  /*
     本地辅助字段
   */
  liveRoomDataBean : LiveRoomDataBean = {} as  LiveRoomDataBean// 批查获取到的直播观看人数
  //本地字段:时间轴专题页节点组件时间;【如果开启模糊则显示时间->左右;0:否,1:是】
  timeBlurred:number = 0
  top:number = 0
  // 直播预约状态
  reserveItemBean : ReserveItemBean = new ReserveItemBean(-1,this.relId,false)

  // keyGenerator相关字符串,用于刷新list布局
  timestamp: String = '1'
  // 自定义参数,用于跳转对应页面时 传递targetLayout参数用
  customParamTargetLayout?: string
  //数据来源接口 0:非推荐楼层接口;1:推荐楼层接口
  sourceInterfaceVal: number = 0
  /**
   * 组件内容源类型  (LIVE_HORIZONTAL_CARD\LIVE_RESERVATION\LIVE_LARGE_CARD\LIVE_END\LIVE_MONTHLY_RANKING  )
   */
  dataSourceType: string = '';
  //组件ID
  compId: string = '';
  /**
   * 是否推荐数据;默认0:否,1:是
   */
  recommend:number = 0
  traceId: string = '';
  traceInfo: string = '';

  // 是否国殇
  isMourning?: boolean = false;

  author: string = ""; ///撰稿人

  static clone(old: ContentDTO): ContentDTO {
    let content = new ContentDTO();
    content.liveType = old.liveType;
    content.seoTags  = old.seoTags;
    content.appStyle = old.appStyle;
    content.cityCode = old.cityCode;
    content.coverSize = old.coverSize;
    content.coverType = old.coverType;
    content.coverUrl = old.coverUrl;
    content.description = old.description;
    content.districtCode = old.districtCode;
    content.endTime = old.endTime;
    content.hImageUrl = old.hImageUrl;
    content.heatValue = old.heatValue;
    content.innerUrl = old.innerUrl;
    content.landscape = old.landscape;
    content.lengthTime = old.lengthTime;
    content.linkUrl = old.linkUrl;
    content.openLikes = old.openLikes;
    content.openComment = old.openComment;
    content.openUrl = old.openUrl;
    content.pageId = old.pageId;
    content.programAuth = old.programAuth;
    content.programId = old.programId;
    content.programName = old.programName;
    content.programSource = old.programSource;
    content.programType = old.programType;
    content.provinceCode = old.provinceCode;
    content.showTitleEd = old.showTitleEd;
    content.showTitleIng = old.showTitleIng;
    content.showTitleNo = old.showTitleNo;
    content.startTime = old.startTime;
    content.subType = old.subType;
    content.subtitle = old.subtitle;
    content.title = old.title;
    content.vImageUrl = old.vImageUrl;
    content.source = old.source;
    content.objectId = old.objectId;
    content.objectType = old.objectType;
    content.channelId = old.channelId;
    content.relId = old.relId;
    content.relType = old.relType;
    content.newsTitle = old.newsTitle;
    content.publishTime = old.publishTime;
    content.publishTimestamp = old.publishTimestamp;
    content.visitorComment = old.visitorComment;
    content.fullColumnImgUrls = old.fullColumnImgUrls;
    content.liveInfo = old.liveInfo;
    content.videoInfo = old.videoInfo;
    content.shareInfo = old.shareInfo
    content.newsSummary = old.newsSummary;
    content.interactData = old.interactData;
    content.hasMore = old.hasMore;
    content.slideShows = old.slideShows;
    content.voiceInfo = old.voiceInfo;
    content.tagWord = old.tagWord;
    content.isSelect = old.isSelect;
    content.rmhInfo = old.rmhInfo;
    content.photoNum = old.photoNum;
    content.corner = old.corner;
    content.cornerMark = old.cornerMark;
    content.rmhPlatform = old.rmhPlatform;
    content.newTags = old.newTags;
    content.titleShow = old.titleShow;
    content.isSearch = old.isSearch;
    content.isCollection = old.isCollection;
    content.commentInfo = old.commentInfo;
    content.bottomNavId = old.bottomNavId;
    content.openType = old.openType;
    content.extra = old.extra;
    return content;
  }
}