ContentDTO.ets 5.65 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';

@Observed
export class ContentDTO implements BaseDTO {
  shareFlag?: string = '1';
  appStyle: string = '';
  cityCode: string = '';
  coverSize: string = '';
  coverType: number = -1;
  coverUrl: 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 = '';
  title: string = '';
  vImageUrl: string = '';
  screenType: string = '';
  source: string = '';
  objectId: string = '';
  objectType: string = '';
  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聚合】,视频非原片+清晰度最高的

  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 = '';
  extra: string = ''
  /*
     本地辅助字段
   */
  liveRoomDataBean?: LiveRoomDataBean // 批查获取到的直播观看人数

  static clone(old: ContentDTO): ContentDTO {
    let content = new ContentDTO();
    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.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.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;
  }
}