fase(3): crawling module domain and application
This commit is contained in:
45
src/modules/crawling/domain/entities/CrawlState.ts
Normal file
45
src/modules/crawling/domain/entities/CrawlState.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import { Entity } from '../../../../shared/domain/Entity';
|
||||
import { UniqueId } from '../../../../shared/domain/UniqueId';
|
||||
|
||||
interface CrawlStateProps {
|
||||
url: string;
|
||||
title: string;
|
||||
domSnapshot: string;
|
||||
visitCount: number;
|
||||
stateId: string;
|
||||
sessionId: string;
|
||||
}
|
||||
|
||||
export class CrawlState extends Entity<CrawlStateProps> {
|
||||
private constructor(props: CrawlStateProps, id?: UniqueId) {
|
||||
super(props, id);
|
||||
}
|
||||
|
||||
static create(props: CrawlStateProps, id?: UniqueId): CrawlState {
|
||||
return new CrawlState(props, id);
|
||||
}
|
||||
|
||||
get url(): string {
|
||||
return this.props.url;
|
||||
}
|
||||
|
||||
get title(): string {
|
||||
return this.props.title;
|
||||
}
|
||||
|
||||
get domSnapshot(): string {
|
||||
return this.props.domSnapshot;
|
||||
}
|
||||
|
||||
get visitCount(): number {
|
||||
return this.props.visitCount;
|
||||
}
|
||||
|
||||
get stateId(): string {
|
||||
return this.props.stateId;
|
||||
}
|
||||
|
||||
get sessionId(): string {
|
||||
return this.props.sessionId;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user