Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
chenjun3_wd
2024-04-11 16:53:39 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9066762fcead2200f852980807c1ad87c8e3e61f
9066762f
1 parent
882d6b14
动态获取早晚报pageId 直播回看请求
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
79 additions
and
5 deletions
sight_harmony/commons/wdNetwork/src/main/ets/http/HttpUrlUtils.ets
sight_harmony/features/wdComponent/src/main/ets/repository/PageRepository.ets
sight_harmony/features/wdComponent/src/main/ets/viewmodel/PageViewModel.ets
sight_harmony/commons/wdNetwork/src/main/ets/http/HttpUrlUtils.ets
View file @
9066762
...
...
@@ -196,6 +196,14 @@ export class HttpUrlUtils {
* */
static readonly MORNING_EVENING_PAGE_INFO_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/pageInfo";
static readonly MORNING_EVENING_COMP_INFO_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/compInfo";
/**
* 直播回顾
* */
static readonly LIVE_REVIEW_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/channel/live/reviewList"; //?pageNum=1&pageSize=20
/**
* 早晚报获取PAGEID
* */
static readonly DAILY_PAPER_TOPIC: string = "/api/rmrb-bff-display-zh/display/zh/c/dailyPaperTopic";
private static _hostUrl: string = HttpUrlUtils.HOST_PRODUCT;
public static set hostUrl(value: string) {
...
...
@@ -436,6 +444,7 @@ export class HttpUrlUtils {
let url = HttpUrlUtils._hostUrl + "/api/rmrb-user-center/auth/zh/c/checkVerifyCode";
return url;
}
static getAgreement() {
let url = HttpUrlUtils._hostUrl + "/api/rmrb-bff-display-zh/display/zh/c/agreement";
return url;
...
...
sight_harmony/features/wdComponent/src/main/ets/repository/PageRepository.ets
View file @
9066762
...
...
@@ -2,10 +2,11 @@ import HashMap from '@ohos.util.HashMap';
import { HttpUrlUtils, ResponseDTO, WDHttp } from 'wdNetwork';
import { DateTimeUtils, Logger } from 'wdKit';
import {
batchLikeAndCollectResult,
CompInfoBean,
ContentDetailDTO,
contentListParams,
InteractDataDTO,
batchLikeAndCollectResult,
MorningEveningPaperDTO,
NavigationBodyDTO,
NewspaperListBean,
...
...
@@ -14,9 +15,8 @@ import {
PageInfoBean,
postBatchAttentionStatusParams,
postBatchAttentionStatusResult,
postExecuteLikeParams,
postExecuteCollectRecordParams,
contentList
Params,
postExecuteLike
Params,
postInteractAccentionOperateParams
} from 'wdBean';
...
...
@@ -105,6 +105,15 @@ export class PageRepository {
}
/**
* 获取早晚报pageId
* */
static getDailyPaperTopic() {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.DAILY_PAPER_TOPIC;
Logger.info(TAG, "getMorningEveningPageInfoUrl url = " + url)
return url;
}
/**
* 早晚报pageInfo请求
* */
static getMorningEveningPageInfoUrl(pageId: string) {
...
...
@@ -135,6 +144,12 @@ export class PageRepository {
return url;
}
static getLivePreviewUrl() {
let url = HttpUrlUtils.getHost() + HttpUrlUtils.LIVE_REVIEW_PATH;
Logger.info(TAG, "getLivePreviewUrl url = " + url)
return url;
}
static fetchNavigationDataApi() {
let url = PageRepository.getBottomNavGroupUrl();
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
...
...
@@ -270,6 +285,15 @@ export class PageRepository {
};
/**
* 获取早晚报pageid
* */
static fetchDailyPaperTopic() {
let url = PageRepository.getDailyPaperTopic()
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.get<ResponseDTO<PageInfoBean>>(url, headers)
};
/**
* 获取播报pageInfo
* */
static fetchBroadcastPageInfo(pageId: string) {
...
...
@@ -292,4 +316,13 @@ export class PageRepository {
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.get<ResponseDTO<CompInfoBean>>(url, headers)
};
/**
* 获取直播回顾双卡位数据
* */
static fetchLivePreviewUrl() {
let url = PageRepository.getLivePreviewUrl()
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.get<ResponseDTO<PageInfoBean>>(url, headers)
};
}
...
...
sight_harmony/features/wdComponent/src/main/ets/viewmodel/PageViewModel.ets
View file @
9066762
import { NavigationBodyDTO, PageDTO,InteractDataDTO,ContentBean, InteractParam,CompDTO,
MorningEveningPaperDTO } from 'wdBean';
import {
CompDTO,
ContentBean,
InteractDataDTO,
InteractParam,
MorningEveningPaperDTO,
NavigationBodyDTO,
PageDTO,
PageInfoBean
} from 'wdBean';
import { CollectionUtils, Logger, ResourcesUtils, StringUtils } from 'wdKit';
import { ResponseDTO, } from 'wdNetwork';
import { PageRepository } from '../repository/PageRepository';
...
...
@@ -276,6 +284,30 @@ export class PageViewModel extends BaseViewModel {
})
return param;
}
async getLivePreviewUrl(): Promise<PageInfoBean> {
return new Promise<PageInfoBean>((success, error) => {
Logger.info(TAG, `getLivePreviewUrl pageInfo start`);
PageRepository.fetchLivePreviewUrl().then((resDTO: ResponseDTO<PageInfoBean>) => {
if (!resDTO || !resDTO.data) {
Logger.error(TAG, 'getLivePreviewUrl then navResDTO is empty');
error('resDTO is empty');
return
}
if (resDTO.code != 0) {
Logger.error(TAG, `getLivePreviewUrl then code:${resDTO.code}, message:${resDTO.message}`);
error('resDTO Response Code is failure');
return
}
// let navResStr = JSON.stringify(navResDTO);
Logger.info(TAG, "getLivePreviewUrl then,navResDTO.timestamp:" + resDTO.timestamp);
success(resDTO.data);
}).catch((err: Error) => {
Logger.error(TAG, `getLivePreviewUrl catch, error.name : ${err.name}, error.message:${err.message}`);
error(err);
})
})
}
}
...
...
Please
register
or
login
to post a comment