fanmingyou3_wd

解决语法检查报错

... ... @@ -19,26 +19,30 @@ export class DetailViewModel extends BaseViewModel {
* 例:https://pd-apis-uat.pdnews.cn/api/rmrb-bff-display-zh/content/zh/c/content/detail?relId=500000008738&contentId=30001373964&relType=1
* @return {string} resDTO.data
*/
async getDetailPageData(relId: string, contentId: string, relType: string): Promise<ContentDetailDTO> {
getDetailPageData(relId: string, contentId: string, relType: string): Promise<ContentDetailDTO> {
Logger.debug(TAG, 'getDetailPageData contentId: ' + contentId);
return new Promise<ContentDetailDTO>((success, error) => {
PageRepository.fetchDetailData(relId, contentId, relType)
.then((resDTO: ResponseDTO<ContentDetailDTO>) => {
if (this.isRespondsInvalid(resDTO, 'getDetailPageData')) {
error("detail data invalid");
return
}
Logger.info(TAG, "getDetailPageData then,resDTO.timeStamp:" + resDTO.timestamp);
success(resDTO.data);
})
.catch((err: Error) => {
Logger.error(TAG, `getDetailPageData catch, error.name : ${err.name}, error.message:${err.message}`);
error(err);
})
PageRepository.fetchDetailData(relId, contentId, relType).then((resDTO: ResponseDTO<ContentDetailDTO>) => {
if (!resDTO || !resDTO.data) {
Logger.error(TAG, 'getDetailPageData then resDTO is empty');
error('resDTO is empty');
return
}
if (resDTO.code != 0) {
Logger.error(TAG, `getDetailPageData then code:${resDTO.code}, message:${resDTO.message}`);
error('resDTO Response Code is failure');
return
}
Logger.info(TAG, "getDetailPageData then,resDTO.timeStamp:" + resDTO.timestamp);
success(resDTO.data);
}).catch((err: Error) => {
Logger.error(TAG, `getDetailPageData catch, error.name : ${err.name}, error.message:${err.message}`);
error(err);
})
})
}
private dataTranslate(json: string): ContentDetailDTO {
private dataTranslate(json: string): ContentDetailDTO | null {
if (StringUtils.isEmpty(json)) {
return null;
}
... ...
{
"license": "Apache-2.0",
"devDependencies": {},
"author": "",
"name": "wddetailplayapi",
"version": "1.0.0",
"description": "Please describe the basic information.",
"main": "Index.ets",
"author": "",
"license": "Apache-2.0",
"version": "1.0.0",
"dependencies": {
"wdBean": "file:../wdBean",
"wdKit": "file:../wdKit",
"wdNetwork": "file:../wdNetwork",
"wdRouter": "file:../wdRouter"
"wdBean": "file:../wdBean",
"wdRouter": "file:../wdRouter",
"wdNetwork": "file:../wdNetwork"
}
}
\ No newline at end of file
}
... ...
{
"license": "Apache-2.0",
"devDependencies": {},
"author": "",
"name": "wddetailplaylive",
"version": "1.0.0",
"description": "Please describe the basic information.",
"main": "Index.ets",
"author": "",
"license": "Apache-2.0",
"dependencies": {
}
}
\ No newline at end of file
"version": "1.0.0",
"dependencies": {}
}
... ...
{
"license": "Apache-2.0",
"devDependencies": {},
"author": "",
"name": "wddetailplayshortvideo",
"version": "1.0.0",
"description": "Please describe the basic information.",
"main": "Index.ets",
"author": "",
"license": "Apache-2.0",
"version": "1.0.0",
"dependencies": {
"wdBean": "file:../wdBean",
"wdPlayer": "file:../wdPlayer",
"wdKit": "file:../wdKit",
"wdBean": "file:../wdBean",
"wdRouter": "file:../wdRouter",
"wdNetwork": "file:../wdNetwork",
"wdDetailPlayApi": "file:../wdDetailPlayApi",
"wdRouter": "file:../wdRouter"
"wdDetailPlayApi": "file:../wdDetailPlayApi"
}
}
\ No newline at end of file
}
... ...
import { BusinessError } from '@ohos.base'
import { Logger } from 'wdKit'
import { ResponseDTO} from 'wdNetwork'
import { ContentDetailDTO, ContentDetailRequest } from 'wdDetailPlayApi'
import { ContentDetailRequest } from 'wdDetailPlayApi'
import { ContentDetailDTO } from 'wdBean'
const TAG = 'PlayViewModel';
... ...
{
"license": "Apache-2.0",
"devDependencies": {},
"author": "",
"name": "wddetailplayvod",
"version": "1.0.0",
"description": "Please describe the basic information.",
"main": "Index.ets",
"author": "",
"license": "Apache-2.0",
"version": "1.0.0",
"dependencies": {
"wdBean": "file:../wdBean",
"wdPlayer": "file:../wdPlayer",
"wdKit": "file:../wdKit",
"wdDetailPlayApi": "file:../wdDetailPlayApi",
"wdRouter": "file:../wdRouter"
"wdBean": "file:../wdBean",
"wdRouter": "file:../wdRouter",
"wdDetailPlayApi": "file:../wdDetailPlayApi"
}
}
\ No newline at end of file
}
... ...
... ... @@ -7,8 +7,8 @@
"main": "Index.ets",
"version": "1.0.0",
"dependencies": {
"wdKit": "file:../wdKit",
"wdConstant": "file:../wdConstant",
"wdKit": "file:../wdKit",
"@ohos/axios": "^2.1.1"
}
}
... ...
{
"license": "Apache-2.0",
"devDependencies": {},
"author": "",
"name": "wdplayer",
"version": "1.0.0",
"description": "Please describe the basic information.",
"main": "Index.ets",
"author": "",
"license": "Apache-2.0",
"dependencies": {
}
}
\ No newline at end of file
"version": "1.0.0",
"dependencies": {}
}
... ...