You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.2 KiB
40 lines
1.2 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using PhilExampleCrawler.Common.Interfaces;
|
|
|
|
namespace PhilExampleCrawler.Common.Models
|
|
{
|
|
/// <summary>
|
|
/// TODO: turn into record (+ rename to CrawlRequest?)
|
|
/// </summary>
|
|
public class CrawlSession : IDeepCloneable<CrawlSession>
|
|
{
|
|
public int ID { get; set; }
|
|
public CrawlSearchParams SearchParams { get; set; }
|
|
public int MinPrice { get; set; }
|
|
public int MaxPrice { get; set; }
|
|
public bool IsPrivate { get; set; }
|
|
public bool IsCommercial { get; set; }
|
|
|
|
public CrawlSession(int id, CrawlSearchParams searchParams,
|
|
int minPrice = -1, int maxPrice = -1,
|
|
bool isPrivate = false,
|
|
bool isCommercial = false)
|
|
{
|
|
ID = id;
|
|
SearchParams = searchParams;
|
|
MinPrice = minPrice;
|
|
MaxPrice = maxPrice;
|
|
IsPrivate = isPrivate;
|
|
IsCommercial = isCommercial;
|
|
}
|
|
|
|
|
|
public CrawlSession Clone()
|
|
{
|
|
return new CrawlSession(ID, SearchParams, MinPrice, MaxPrice, IsPrivate, IsCommercial);
|
|
}
|
|
}
|
|
}
|