PageRepository.ets
766 Bytes
import { ResponseDTO, WDHttp } from 'wdNetwork';
import { NavigationBodyDTO } from './bean/NavigationBodyDTO';
import { PageDTO } from './bean/PageDTO';
import HashMap from '@ohos.util.HashMap';
import { HttpUrlUtils } from '../network/HttpUrlUtils';
export class PageRepository {
static fetchNavigationDataApi(url: string) {
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.get<ResponseDTO<NavigationBodyDTO>>(url, headers)
};
static fetchPageData(pageId: string, groupId: string, channelId: string) {
let url = HttpUrlUtils.getCompInfoUrl(pageId, groupId, channelId)
let headers: HashMap<string, string> = HttpUrlUtils.getCommonHeaders();
return WDHttp.get<ResponseDTO<PageDTO>>(url, headers)
};
}