using Newtonsoft.Json; using System.Collections.Generic; namespace Jiguang.JPush.Model { /// /// 定期任务触发器。 /// /// public class Trigger { /// /// 定期任务开始日期,必须为 24 小时制。 /// 类似:"2017-08-01 12:00:00" /// [JsonProperty("start")] public string StartDate { get; set; } /// /// 定期任务终止日期,必须为 24 小时制。 /// 类似:"2017-12-30 12:00:00" /// [JsonProperty("end")] public string EndDate { get; set; } /// /// 具体的触发时间。 /// 类似:"12:00:00" /// [JsonProperty("time")] public string TriggerTime { get; set; } /// /// 定期任务执行的最小时间单位。 /// 必须为 "day" / "week" / "month" 中的一种。 /// [JsonProperty("time_unit")] public string TimeUnit { get; set; } /// /// 定期任务的执行周期(目前最大支持 100)。 /// 比如,当 TimeUnit 为 "day",Frequency 为 2 时,表示每两天触发一次推送。 /// [JsonProperty("frequency")] public int Frequency { get; set; } /// /// 当 TimeUnit 为 "week" 或 "month"时,具体的时间表。 /// - 如果 TimeUnit 为 "week": {"mon", "tue", "wed", "thu", "fri", "sat", "sun"}; /// - 如果 TimeUnit 为 "month": {"01", "02"...}; /// [JsonProperty("point")] public List TimeList { get; set; } private string GetJson() { return JsonConvert.SerializeObject(this, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore, DefaultValueHandling = DefaultValueHandling.Ignore }); } public override string ToString() { return GetJson(); } } }