FileConfig.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public enum RoomFileType
  5. {
  6. png,
  7. jpg,
  8. jpeg,
  9. mp4,
  10. zip,
  11. pdf,
  12. unknown
  13. }
  14. public class FileConfig
  15. {
  16. private string peerId;
  17. private string from;
  18. private string createTime;
  19. private string url;
  20. private string path;
  21. private string fileName;
  22. private string onlineUrl;
  23. private string extname;
  24. private string objectName;
  25. private string bucket;
  26. private string uuid;
  27. public string PeerId { get => peerId; set => peerId = value; }
  28. public string From { get => from; set => from = value; }
  29. public string CreateTime { get => createTime; set => createTime = value; }
  30. public string Url { get => url; set => url = value; }
  31. public string Path { get => path; set => path = value; }
  32. public string FileName { get => fileName; set => fileName = value; }
  33. public string OnLineUrl { get => onlineUrl; set => onlineUrl = value; }
  34. public string Extname { get => extname; set => extname = value; }
  35. public string ObjectName { get => objectName; set => objectName = value; }
  36. public string Bucket { get => bucket; set => bucket = value; }
  37. public string UUid { get => uuid; set => uuid = value; }
  38. public RoomFileType FileType
  39. {
  40. get
  41. {
  42. if (!string.IsNullOrEmpty(this.FileName))
  43. {
  44. string[] str = this.FileName.Split('.');
  45. switch (str[str.Length-1])
  46. {
  47. case "png":
  48. return RoomFileType.png;
  49. case "jpg":
  50. return RoomFileType.jpg;
  51. case "jpeg":
  52. return RoomFileType.jpeg;
  53. case "mp4":
  54. return RoomFileType.mp4;
  55. case "zip":
  56. return RoomFileType.zip;
  57. case "pdf":
  58. return RoomFileType.pdf;
  59. }
  60. }
  61. return RoomFileType.unknown;
  62. }
  63. }
  64. }