using System.Collections; using System.Collections.Generic; using UnityEngine; public enum RoomFileType { png, jpg, jpeg, mp4, zip, pdf, unknown } public class FileConfig { private string peerId; private string from; private string createTime; private string url; private string path; private string fileName; private string onlineUrl; private string extname; private string objectName; private string bucket; private string uuid; public string PeerId { get => peerId; set => peerId = value; } public string From { get => from; set => from = value; } public string CreateTime { get => createTime; set => createTime = value; } public string Url { get => url; set => url = value; } public string Path { get => path; set => path = value; } public string FileName { get => fileName; set => fileName = value; } public string OnLineUrl { get => onlineUrl; set => onlineUrl = value; } public string Extname { get => extname; set => extname = value; } public string ObjectName { get => objectName; set => objectName = value; } public string Bucket { get => bucket; set => bucket = value; } public string UUid { get => uuid; set => uuid = value; } public RoomFileType FileType { get { if (!string.IsNullOrEmpty(this.FileName)) { string[] str = this.FileName.Split('.'); switch (str[str.Length-1]) { case "png": return RoomFileType.png; case "jpg": return RoomFileType.jpg; case "jpeg": return RoomFileType.jpeg; case "mp4": return RoomFileType.mp4; case "zip": return RoomFileType.zip; case "pdf": return RoomFileType.pdf; } } return RoomFileType.unknown; } } }