DeeplinkParseRuleDTO.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 string deeplink_template { get; set; } = string.Empty;
  19. public string prompt_text { get; set; } = string.Empty;
  20. public bool enable { get; set; } = true;
  21. public List<DeeplinkParseRule> childs { get; set; } = new();
  22. public List<DeeplinkResources> resources { get; set; } = new();
  23. }
  24. public class DeeplinkResources
  25. {
  26. public string name { get; set; } = string.Empty;
  27. public string url_pattern { get; set; } = string.Empty;
  28. public UrlAction url_action { get; set; } = UrlAction.None;
  29. public List<string> pattern { get; set; } = [];
  30. public bool enable { get; set; } = true;
  31. }
  32. [Table("deeplink_parse_rule")]
  33. public class DeeplinkParseRuleDTO
  34. {
  35. [Key]
  36. public int id { get; set; }
  37. public int channel_id { get; set; } = 0;
  38. public string channel_name { get; set; } = string.Empty;
  39. public string name { get; set; } = string.Empty;
  40. public string logo { get; set; } = string.Empty;
  41. public string rules { get; set; } = string.Empty;
  42. public string IgnorePercentageCity { get; set; } = string.Empty;
  43. public bool status { get; set; } = false;
  44. public DateTime create_time { get; set; } = DateTime.Now;
  45. [IgnoreUpdate]
  46. public DateTime last_time { get; set; } = DateTime.Now;
  47. }
  48. }