DeeplinkParseRuleDTO.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using dodohold.core;
  2. using Spire.Pdf.Exporting.XPS.Schema;
  3. namespace molilian.core
  4. {
  5. public enum UrlAction
  6. {
  7. None = 0,
  8. Redirect = 1,
  9. Body = 2,
  10. }
  11. public class DeeplinkParseRule
  12. {
  13. public UrlAction url_action { get; set; } = UrlAction.None;
  14. public string body_pattern { get; set; } = string.Empty;
  15. public string url_pattern { get; set; } = string.Empty;
  16. public string pattern { get; set; } = string.Empty;
  17. public string plugin { get; set; } = string.Empty;
  18. public List<string[]> replace { get; set; } = new();
  19. public string deeplink_template { get; set; } = string.Empty;
  20. public string prompt_text { get; set; } = string.Empty;
  21. public bool enable { get; set; } = true;
  22. public List<DeeplinkParseRule> childs { get; set; } = new();
  23. public List<DeeplinkResources> resources { get; set; } = new();
  24. }
  25. public class DeeplinkResources
  26. {
  27. public string name { get; set; } = string.Empty;
  28. public string url_pattern { get; set; } = string.Empty;
  29. public UrlAction url_action { get; set; } = UrlAction.None;
  30. public List<string> pattern { get; set; } = [];
  31. public bool enable { get; set; } = true;
  32. }
  33. [Table("deeplink_parse_rule")]
  34. public class DeeplinkParseRuleDTO
  35. {
  36. [Key]
  37. public int id { get; set; }
  38. public int channel_id { get; set; } = 0;
  39. public string channel_name { get; set; } = string.Empty;
  40. public string name { get; set; } = string.Empty;
  41. public string logo { get; set; } = string.Empty;
  42. public string rules { get; set; } = string.Empty;
  43. public string IgnorePercentageCity { get; set; } = string.Empty;
  44. public bool status { get; set; } = false;
  45. public DateTime create_time { get; set; } = DateTime.Now;
  46. [IgnoreUpdate]
  47. public DateTime last_time { get; set; } = DateTime.Now;
  48. }
  49. }