NodeConfig.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. namespace OrBit.MesFileServiceNode.Host.Model
  2. {
  3. public class MimeModifer
  4. {
  5. /// <summary>
  6. /// 后缀名
  7. /// </summary>
  8. public string Ext { get; set; }
  9. /// <summary>
  10. /// ContentType
  11. /// </summary>
  12. public string Type { get; set; }
  13. /// <summary>
  14. /// 操作,add或remove
  15. /// </summary>
  16. public MimeModiferOpts Opt { get; set; }
  17. }
  18. public enum MimeModiferOpts
  19. {
  20. add = 1,
  21. remove = 2
  22. }
  23. public class NodeConfig
  24. {
  25. /// <summary>
  26. /// mime修改器集合
  27. /// </summary>
  28. public MimeModifer[] MimeModifiers { get; set; }
  29. /// <summary>
  30. /// 域名
  31. /// </summary>
  32. /// <value>The domain.</value>
  33. public string Domain { get; set; }
  34. /// <summary>
  35. /// 文件根目录
  36. /// </summary>
  37. /// <value>The root path.</value>
  38. public string PhysicalPath { get; set; }
  39. /// <summary>
  40. /// 请求根目录
  41. /// </summary>
  42. /// <value>The request path.</value>
  43. public string VirtualPath { get; set; }
  44. /// <summary>
  45. /// 缓存秒数
  46. /// </summary>
  47. /// <value>The cache period.</value>
  48. public int CachePeriod { get; set; }
  49. /// <summary>
  50. /// 是否启用缩略图
  51. /// </summary>
  52. public bool EnableThumbnail { get; set; }
  53. /// <summary>
  54. /// 缩略图后缀
  55. /// </summary>
  56. public HashSet<string> ThumbnailExts { get; set; }
  57. /// <summary>
  58. /// 允许上传的IP列表
  59. /// </summary>
  60. public HashSet<string> AllowIPs { get; set; }
  61. }
  62. }