2020-06-03 14:53:58 +00:00
|
|
|
|
using System;
|
|
|
|
|
|
2022-01-21 08:26:25 +00:00
|
|
|
|
using ASC.Common;
|
2020-06-03 14:53:58 +00:00
|
|
|
|
using ASC.Common.Utils;
|
|
|
|
|
|
|
|
|
|
namespace ASC.Feed.Configuration
|
|
|
|
|
{
|
2022-01-21 08:26:25 +00:00
|
|
|
|
[Singletone]
|
2020-06-03 14:53:58 +00:00
|
|
|
|
public class FeedSettings
|
|
|
|
|
{
|
2022-01-21 08:26:25 +00:00
|
|
|
|
private string serverRoot;
|
|
|
|
|
public string ServerRoot { get => serverRoot ?? "http://*/"; set { serverRoot = value; } }
|
2020-06-03 14:53:58 +00:00
|
|
|
|
|
2022-01-21 08:26:25 +00:00
|
|
|
|
private TimeSpan aggregatePeriod;
|
|
|
|
|
public TimeSpan AggregatePeriod { get => aggregatePeriod == TimeSpan.Zero ? TimeSpan.FromMinutes(5) : aggregatePeriod; set { aggregatePeriod = value; } }
|
2020-06-03 14:53:58 +00:00
|
|
|
|
|
2022-01-21 08:26:25 +00:00
|
|
|
|
private TimeSpan aggregateInterval;
|
|
|
|
|
public TimeSpan AggregateInterval { get => aggregateInterval == TimeSpan.Zero ? TimeSpan.FromDays(14) : aggregateInterval; set { aggregateInterval = value; } }
|
2020-06-03 14:53:58 +00:00
|
|
|
|
|
2022-01-21 08:26:25 +00:00
|
|
|
|
private TimeSpan removePeriod;
|
|
|
|
|
public TimeSpan RemovePeriod { get => removePeriod == TimeSpan.Zero ? TimeSpan.FromDays(1) : removePeriod; set { removePeriod = value; } }
|
2020-06-03 14:53:58 +00:00
|
|
|
|
|
2022-01-21 08:26:25 +00:00
|
|
|
|
public FeedSettings(ConfigurationExtension configuration)
|
2020-06-04 10:54:13 +00:00
|
|
|
|
{
|
2022-01-21 08:26:25 +00:00
|
|
|
|
configuration.GetSetting("feed", this);
|
2020-06-04 10:54:13 +00:00
|
|
|
|
}
|
2020-06-03 14:53:58 +00:00
|
|
|
|
}
|
|
|
|
|
}
|