obsidian-douban/src/org/wanxp/douban/data/search/parser/NotAllPageSearchResultPageParser.ts
2023-12-21 10:25:28 +08:00

20 lines
742 B
TypeScript

import {SupportType} from "../../../../constant/Constsant";
import {SearchResultPageParserInterface} from "./SearchResultPageParserInterface";
import {log} from "../../../../utils/Logutil";
import {SearchPage} from "../../model/SearchPage";
import SearchParserHandler from "../SearchParser";
export class NotAllPageSearchResultPageParser implements SearchResultPageParserInterface {
support(type:SupportType, pageNum:number):boolean {
return type != SupportType.ALL;
}
parse(source:string, type:SupportType, pageNum:number, pageSize:number):SearchPage {
log.debug("解析给多页面结果");
if (!source) {
return new SearchPage(0, 0, 0, type, []);
}
return SearchParserHandler.parseSearchJson(source, type, pageNum);
}
}