chenjun3_wd

动态获取早晚报pageId 直播回看请求

@@ -196,6 +196,14 @@ export class HttpUrlUtils { @@ -196,6 +196,14 @@ export class HttpUrlUtils {
196 * */ 196 * */
197 static readonly MORNING_EVENING_PAGE_INFO_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/pageInfo"; 197 static readonly MORNING_EVENING_PAGE_INFO_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/pageInfo";
198 static readonly MORNING_EVENING_COMP_INFO_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/compInfo"; 198 static readonly MORNING_EVENING_COMP_INFO_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/compInfo";
  199 + /**
  200 + * 直播回顾
  201 + * */
  202 + static readonly LIVE_REVIEW_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/channel/live/reviewList"; //?pageNum=1&pageSize=20
  203 + /**
  204 + * 早晚报获取PAGEID
  205 + * */
  206 + static readonly DAILY_PAPER_TOPIC: string = "/api/rmrb-bff-display-zh/display/zh/c/dailyPaperTopic";
199 private static _hostUrl: string = HttpUrlUtils.HOST_PRODUCT; 207 private static _hostUrl: string = HttpUrlUtils.HOST_PRODUCT;
200 208
201 public static set hostUrl(value: string) { 209 public static set hostUrl(value: string) {
@@ -436,6 +444,7 @@ export class HttpUrlUtils { @@ -436,6 +444,7 @@ export class HttpUrlUtils {
436 let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/auth/zh/c/checkVerifyCode"; 444 let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/auth/zh/c/checkVerifyCode";
437 return url; 445 return url;
438 } 446 }
  447 +
439 static getAgreement() { 448 static getAgreement() {
440 let url = HttpUrlUtils._hostUrl + "/api/rmrb-bff-display-zh/display/zh/c/agreement"; 449 let url = HttpUrlUtils._hostUrl + "/api/rmrb-bff-display-zh/display/zh/c/agreement";
441 return url; 450 return url;
@@ -2,10 +2,11 @@ import HashMap from '@ohos.util.HashMap'; @@ -2,10 +2,11 @@ import HashMap from '@ohos.util.HashMap';
2 import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork'; 2 import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork';
3 import { DateTimeUtils, Logger } from 'wdKit'; 3 import { DateTimeUtils, Logger } from 'wdKit';
4 import { 4 import {
  5 + batchLikeAndCollectResult,
5 CompInfoBean, 6 CompInfoBean,
6 ContentDetailDTO, 7 ContentDetailDTO,
  8 + contentListParams,
7 InteractDataDTO, 9 InteractDataDTO,
8 - batchLikeAndCollectResult,  
9 MorningEveningPaperDTO, 10 MorningEveningPaperDTO,
10 NavigationBodyDTO, 11 NavigationBodyDTO,
11 NewspaperListBean, 12 NewspaperListBean,
@@ -14,9 +15,8 @@ import { @@ -14,9 +15,8 @@ import {
14 PageInfoBean, 15 PageInfoBean,
15 postBatchAttentionStatusParams, 16 postBatchAttentionStatusParams,
16 postBatchAttentionStatusResult, 17 postBatchAttentionStatusResult,
17 - postExecuteLikeParams,  
18 postExecuteCollectRecordParams, 18 postExecuteCollectRecordParams,
19 - contentListParams, 19 + postExecuteLikeParams,
20 postInteractAccentionOperateParams 20 postInteractAccentionOperateParams
21 } from 'wdBean'; 21 } from 'wdBean';
22 22
@@ -105,6 +105,15 @@ export class PageRepository { @@ -105,6 +105,15 @@ export class PageRepository {
105 } 105 }
106 106
107 /** 107 /**
  108 + * 获取早晚报pageId
  109 + * */
  110 + static getDailyPaperTopic() {
  111 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.DAILY_PAPER_TOPIC;
  112 + Logger.info(TAG, "getMorningEveningPageInfoUrl url = " + url)
  113 + return url;
  114 + }
  115 +
  116 + /**
108 * 早晚报pageInfo请求 117 * 早晚报pageInfo请求
109 * */ 118 * */
110 static getMorningEveningPageInfoUrl(pageId: string) { 119 static getMorningEveningPageInfoUrl(pageId: string) {
@@ -135,6 +144,12 @@ export class PageRepository { @@ -135,6 +144,12 @@ export class PageRepository {
135 return url; 144 return url;
136 } 145 }
137 146
  147 + static getLivePreviewUrl() {
  148 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.LIVE_REVIEW_PATH;
  149 + Logger.info(TAG, "getLivePreviewUrl url = " + url)
  150 + return url;
  151 + }
  152 +
138 static fetchNavigationDataApi() { 153 static fetchNavigationDataApi() {
139 let url = PageRepository.getBottomNavGroupUrl(); 154 let url = PageRepository.getBottomNavGroupUrl();
140 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 155 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
@@ -270,6 +285,15 @@ export class PageRepository { @@ -270,6 +285,15 @@ export class PageRepository {
270 }; 285 };
271 286
272 /** 287 /**
  288 + * 获取早晚报pageid
  289 + * */
  290 + static fetchDailyPaperTopic() {
  291 + let url = PageRepository.getDailyPaperTopic()
  292 + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
  293 + return WDHttp.get<ResponseDTO<PageInfoBean>>(url, headers)
  294 + };
  295 +
  296 + /**
273 * 获取播报pageInfo 297 * 获取播报pageInfo
274 * */ 298 * */
275 static fetchBroadcastPageInfo(pageId: string) { 299 static fetchBroadcastPageInfo(pageId: string) {
@@ -292,4 +316,13 @@ export class PageRepository { @@ -292,4 +316,13 @@ export class PageRepository {
292 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders(); 316 let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
293 return WDHttp.get<ResponseDTO<CompInfoBean>>(url, headers) 317 return WDHttp.get<ResponseDTO<CompInfoBean>>(url, headers)
294 }; 318 };
  319 +
  320 + /**
  321 + * 获取直播回顾双卡位数据
  322 + * */
  323 + static fetchLivePreviewUrl() {
  324 + let url = PageRepository.getLivePreviewUrl()
  325 + let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
  326 + return WDHttp.get<ResponseDTO<PageInfoBean>>(url, headers)
  327 + };
295 } 328 }
1 -import { NavigationBodyDTO, PageDTO,InteractDataDTO,ContentBean, InteractParam,CompDTO,  
2 - MorningEveningPaperDTO } from 'wdBean'; 1 +import {
  2 + CompDTO,
  3 + ContentBean,
  4 + InteractDataDTO,
  5 + InteractParam,
  6 + MorningEveningPaperDTO,
  7 + NavigationBodyDTO,
  8 + PageDTO,
  9 + PageInfoBean
  10 +} from 'wdBean';
3 import { CollectionUtils, Logger, ResourcesUtils, StringUtils } from 'wdKit'; 11 import { CollectionUtils, Logger, ResourcesUtils, StringUtils } from 'wdKit';
4 import { ResponseDTO, } from 'wdNetwork'; 12 import { ResponseDTO, } from 'wdNetwork';
5 import { PageRepository } from '../repository/PageRepository'; 13 import { PageRepository } from '../repository/PageRepository';
@@ -276,6 +284,30 @@ export class PageViewModel extends BaseViewModel { @@ -276,6 +284,30 @@ export class PageViewModel extends BaseViewModel {
276 }) 284 })
277 return param; 285 return param;
278 } 286 }
  287 +
  288 + async getLivePreviewUrl(): Promise<PageInfoBean> {
  289 + return new Promise<PageInfoBean>((success, error) => {
  290 + Logger.info(TAG, `getLivePreviewUrl pageInfo start`);
  291 + PageRepository.fetchLivePreviewUrl().then((resDTO: ResponseDTO<PageInfoBean>) => {
  292 + if (!resDTO || !resDTO.data) {
  293 + Logger.error(TAG, 'getLivePreviewUrl then navResDTO is empty');
  294 + error('resDTO is empty');
  295 + return
  296 + }
  297 + if (resDTO.code != 0) {
  298 + Logger.error(TAG, `getLivePreviewUrl then code:${resDTO.code}, message:${resDTO.message}`);
  299 + error('resDTO Response Code is failure');
  300 + return
  301 + }
  302 + // let navResStr = JSON.stringify(navResDTO);
  303 + Logger.info(TAG, "getLivePreviewUrl then,navResDTO.timestamp:" + resDTO.timestamp);
  304 + success(resDTO.data);
  305 + }).catch((err: Error) => {
  306 + Logger.error(TAG, `getLivePreviewUrl catch, error.name : ${err.name}, error.message:${err.message}`);
  307 + error(err);
  308 + })
  309 + })
  310 + }
279 } 311 }
280 312
281 313