128 lines
3.4 KiB
C#
128 lines
3.4 KiB
C#
using Api.Framework.Enums;
|
||
using Api.Framework.SDK;
|
||
using System;
|
||
using System.Collections.Generic;
|
||
using System.ComponentModel;
|
||
using System.Linq;
|
||
using System.Text;
|
||
using System.Threading.Tasks;
|
||
|
||
namespace Weixin.AccurateCircle
|
||
{
|
||
[Config(Name = "插件-精准朋友圈-配置")]
|
||
public class Config
|
||
{
|
||
|
||
#region 发单功能
|
||
|
||
#region 采集
|
||
/// <summary>
|
||
/// 采集开关
|
||
/// </summary>
|
||
[
|
||
Category("1)、自动采集"), DisplayName("01.采集开关"), DefaultValue(SwitchType.开启)
|
||
]
|
||
public SwitchType Switch { get; set; }
|
||
|
||
private int _downInterval;
|
||
/// <summary>
|
||
/// 采集间隔
|
||
/// </summary>
|
||
[
|
||
Category("1)、自动采集"), DisplayName("02.采集间隔"), DefaultValue(5),
|
||
Description(@"定时采集间隔时间(单位/分)")
|
||
]
|
||
public int DownInterval
|
||
{
|
||
get { return _downInterval; }
|
||
set
|
||
{
|
||
try
|
||
{
|
||
if (value < 5) throw new Exception("");
|
||
else _downInterval = value;
|
||
}
|
||
catch (Exception)
|
||
{
|
||
_downInterval = 5;
|
||
throw new Exception($"采集间隔不能小于5分钟");
|
||
}
|
||
_downInterval = value;
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// 采集开关
|
||
/// </summary>
|
||
[
|
||
Category("1)、自动采集"), DisplayName("03.采集地址"), DefaultValue("")
|
||
]
|
||
public string DownUrl { get; set; }
|
||
#endregion
|
||
|
||
/// <summary>
|
||
/// 记录采集的任务ID
|
||
/// </summary>
|
||
[Browsable(false)]
|
||
public long DownID { get; set; }
|
||
|
||
/// <summary>
|
||
/// 记录上一次的时间
|
||
/// </summary>
|
||
[Browsable(false)]
|
||
public DateTime DownTime { get; set; }
|
||
|
||
/// <summary>
|
||
/// 自动清理
|
||
/// </summary>
|
||
[
|
||
Category("2)、定时清理"), DisplayName("01.定时清理"), DefaultValue(SwitchType.开启),
|
||
Description(@"功能开启时,将在设置的时间进行采集数据的清空操作")
|
||
]
|
||
public SwitchType Auto_IsClear { get; set; }
|
||
|
||
private string _autoClearTaskTimes;
|
||
/// <summary>
|
||
/// 定时清理
|
||
/// </summary>
|
||
[
|
||
Category("2)、定时清理"), DisplayName("02.定时清理时间"),
|
||
Description(@"定时清理时间
|
||
格式:HH:mm
|
||
例:23:59
|
||
注:时间为24小时制")
|
||
]
|
||
public string AutoClearTaskTimes //{ get; set; }
|
||
{
|
||
get { return _autoClearTaskTimes; }
|
||
set
|
||
{
|
||
try
|
||
{
|
||
var time = value as string;
|
||
var _time = DateTime.Parse(time);
|
||
}
|
||
catch (Exception)
|
||
{
|
||
throw new Exception($"时间格式不正确");
|
||
}
|
||
_autoClearTaskTimes = value;
|
||
}
|
||
}
|
||
#endregion
|
||
|
||
public Config()
|
||
{
|
||
this.Auto_IsClear = SwitchType.开启;
|
||
this.Switch = SwitchType.开启;
|
||
this._downInterval = 5;
|
||
this._autoClearTaskTimes = "23:59";
|
||
this.DownTime = DateTime.MinValue;
|
||
this.DownID = 0;
|
||
this.DownUrl = string.Empty;
|
||
}
|
||
|
||
}
|
||
}
|
||
|