using System.Text.Json.Serialization; namespace WalkingTec.Mvvm.Core.ConfigOptions { public class UEditorOptions { #region 上传图片配置项 /// /// 执行上传图片的action名称 /// /// [JsonPropertyName("imageActionName")] public string ImageActionName { get; set; } = "UploadForLayUIUEditor"; /// /// 提交的图片表单名称 /// /// [JsonPropertyName("imageFieldName")] public string ImageFieldName { get; set; } = "FileID"; /// /// 上传大小限制,单位B /// /// [JsonPropertyName("imageMaxSize")] public int ImageMaxSize { get; set; } = 2048000; /// /// 上传图片格式显示 /// /// [JsonPropertyName("imageAllowFiles")] public string[] ImageAllowFiles { get; set; } = new string[] { ".png", ".jpg", ".jpeg", ".gif", ".bmp" }; /// /// 是否压缩图片,默认是true /// /// [JsonPropertyName("imageCompressEnable")] public bool ImageCompressEnable { get; set; } = true; /// /// 图片压缩最长边限制 /// /// [JsonPropertyName("imageCompressBorder")] public int ImageCompressBorder { get; set; } = 1600; /// /// 插入的图片浮动方式 /// /// [JsonPropertyName("imageInsertAlign")] public string ImageInsertAlign { get; set; } = "none"; /// /// 图片访问路径前缀 默认返回全路径 /// /// [JsonPropertyName("imageUrlPrefix")] public string ImageUrlPrefix { get; set; } = string.Empty; /* {filename} 会替换成原文件名,配置这项需要注意中文乱码问题 */ /* {rand:6} 会替换成随机数,后面的数字是随机数的位数 */ /* {time} 会替换成时间戳 */ /* {yyyy} 会替换成四位年份 */ /* {yy} 会替换成两位年份 */ /* {mm} 会替换成两位月份 */ /* {dd} 会替换成两位日期 */ /* {hh} 会替换成两位小时 */ /* {ii} 会替换成两位分钟 */ /* {ss} 会替换成两位秒 */ /* 非法字符 \ : * ? " < > | */ /* 具请体看线上文档: fex.baidu.com/ueditor/#use-format_upload_filename */ /// /// 上传保存路径,可以自定义保存路径和文件名格式 /// /// [JsonPropertyName("imagePathFormat")] public string ImagePathFormat { get; set; } = "upload/image/{yyyy}{mm}{dd}/{time}{rand:6}"; #endregion #region 涂鸦图片上传配置项 /// /// 执行上传涂鸦的action名称 /// /// [JsonPropertyName("scrawlActionName")] public string ScrawlActionName { get; set; } = "UploadForLayUIUEditor"; /// /// 提交的图片表单名称 /// /// [JsonPropertyName("scrawlFieldName")] public string ScrawlFieldName { get; set; } = "FileID"; /// /// 上传保存路径,可以自定义保存路径和文件名格式 /// /// [JsonPropertyName("scrawlPathFormat")] public string ScrawlPathFormat { get; set; } = "upload/image/{yyyy}{mm}{dd}/{time}{rand:6}"; /// /// 上传大小限制,单位B /// /// [JsonPropertyName("scrawlMaxSize")] public int ScrawlMaxSize { get; set; } = 2048000; /// /// 图片访问路径前缀 /// /// [JsonPropertyName("scrawlUrlPrefix")] public string ScrawlUrlPrefix { get; set; } = string.Empty; /// /// 插入的图片浮动方式 /// /// [JsonPropertyName("scrawlInsertAlign")] public string ScrawlInsertAlign { get; set; } = "none"; #endregion #region 截图工具上传 /// /// 执行上传截图的action名称 /// /// [JsonPropertyName("snapscreenActionName")] public string SnapscreenActionName { get; set; } = "UploadForLayUIUEditor"; /// /// 上传保存路径,可以自定义保存路径和文件名格式 /// /// [JsonPropertyName("snapscreenPathFormat")] public string SnapscreenPathFormat { get; set; } = "upload/image/{yyyy}{mm}{dd}/{time}{rand:6}"; /// /// 图片访问路径前缀 /// /// [JsonPropertyName("snapscreenUrlPrefix")] public string SnapscreenUrlPrefix { get; set; } = string.Empty; /// /// 插入的图片浮动方式 /// /// [JsonPropertyName("snapscreenInsertAlign")] public string SnapscreenInsertAlign { get; set; } = "none"; #endregion #region 抓取远程图片配置 [JsonPropertyName("catcherLocalDomain")] public string[] CatcherLocalDomain { get; set; } = new string[] { "127.0.0.1", "localhost", "img.baidu.com" }; /// /// 执行抓取远程图片的action名称 /// /// [JsonPropertyName("catcherActionName")] public string CatcherActionName { get; set; } = "catchimage"; /// /// 提交的图片列表表单名称 /// /// [JsonPropertyName("catcherFieldName")] public string CatcherFieldName { get; set; } = "source"; /// /// 上传保存路径,可以自定义保存路径和文件名格式 /// /// [JsonPropertyName("catcherPathFormat")] public string CatcherPathFormat { get; set; } = "upload/image/{yyyy}{mm}{dd}/{time}{rand:6}"; /// /// 图片访问路径前缀 /// /// [JsonPropertyName("catcherUrlPrefix")] public string CatcherUrlPrefix { get; set; } = string.Empty; /// /// 上传大小限制,单位B /// /// [JsonPropertyName("catcherMaxSize")] public int CatcherMaxSize { get; set; } = 2048000; /// /// 抓取图片格式显示 /// /// [JsonPropertyName("catcherAllowFiles")] public string[] CatcherAllowFiles { get; set; } = new string[] { ".png", ".jpg", ".jpeg", ".gif", ".bmp" }; #endregion #region 上传视频配置 /// /// 执行上传视频的action名称 /// /// [JsonPropertyName("videoActionName")] public string VideoActionName { get; set; } = "UploadForLayUIUEditor"; /// /// 提交的视频表单名称 /// /// [JsonPropertyName("videoFieldName")] public string VideoFieldName { get; set; } = "FileID"; /// /// 上传保存路径,可以自定义保存路径和文件名格式 /// /// [JsonPropertyName("videoPathFormat")] public string VideoPathFormat { get; set; } = "upload/video/{yyyy}{mm}{dd}/{time}{rand:6}"; /// /// 视频访问路径前缀 /// /// [JsonPropertyName("videoUrlPrefix")] public string VideoUrlPrefix { get; set; } = string.Empty; /// /// 上传大小限制,单位B,默认100MB /// /// [JsonPropertyName("videoMaxSize")] public int VideoMaxSize { get; set; } = 102400000; /// /// 上传视频格式显示 /// /// [JsonPropertyName("videoAllowFiles")] public string[] VideoAllowFiles { get; set; } = new string[] { ".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg", ".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid" }; #endregion #region 上传文件配置 /// /// controller里,执行上传视频的action名称 /// /// [JsonPropertyName("fileActionName")] public string FileActionName { get; set; } = "UploadForLayUIUEditor"; /// /// 提交的文件表单名称 /// /// [JsonPropertyName("fileFieldName")] public string FileFieldName { get; set; } = "FileID"; /// /// 上传保存路径,可以自定义保存路径和文件名格式 /// /// [JsonPropertyName("filePathFormat")] public string FilePathFormat { get; set; } = "upload/file/{yyyy}{mm}{dd}/{time}{rand:6}"; /// /// 文件访问路径前缀 /// /// [JsonPropertyName("fileUrlPrefix")] public string FileUrlPrefix { get; set; } = string.Empty; /// /// 上传大小限制,单位B,默认50MB /// /// [JsonPropertyName("fileMaxSize")] public int FileMaxSize { get; set; } = 51200000; /// /// 上传文件格式显示 /// /// [JsonPropertyName("fileAllowFiles")] public string[] FileAllowFiles { get; set; } = new string[] { ".png", ".jpg", ".jpeg", ".gif", ".bmp", ".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg", ".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid", ".rar", ".zip", ".tar", ".gz", ".7z", ".bz2", ".cab", ".iso", ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".pdf", ".txt", ".md", ".xml" }; #endregion #region 列出指定目录下的图片 /// /// 执行图片管理的action名称 /// /// [JsonPropertyName("imageManagerActionName")] public string ImageManagerActionName { get; set; } = "listimage"; /// /// 指定要列出图片的目录 /// /// [JsonPropertyName("imageManagerListPath")] public string ImageManagerListPath { get; set; } = string.Empty; /// /// 每次列出文件数量 /// /// [JsonPropertyName("imageManagerListSize")] public int ImageManagerListSize { get; set; } = 20; /// /// 图片访问路径前缀 /// /// [JsonPropertyName("imageManagerUrlPrefix")] public string ImageManagerUrlPrefix { get; set; } = string.Empty; /// /// 插入的图片浮动方式 /// /// [JsonPropertyName("imageManagerInsertAlign")] public string ImageManagerInsertAlign { get; set; } = "none"; /// /// 列出的文件类型 /// /// [JsonPropertyName("imageManagerAllowFiles")] public string[] ImageManagerAllowFiles { get; set; } = new string[] { ".png", ".jpg", ".jpeg", ".gif", ".bmp" }; #endregion #region 列出指定目录下的文件 /// /// 执行文件管理的action名称 /// /// [JsonPropertyName("fileManagerActionName")] public string FileManagerActionName { get; set; } = "listfile"; /// /// 指定要列出文件的目录 /// /// [JsonPropertyName("fileManagerListPath")] public string FileManagerListPath { get; set; } = "upload/file"; /// /// 文件访问路径前缀 /// /// [JsonPropertyName("fileManagerUrlPrefix")] public string FileManagerUrlPrefix { get; set; } = "/ueditor/net/"; /// /// 每次列出文件数量 /// /// [JsonPropertyName("fileManagerListSize")] public int FileManagerListSize { get; set; } = 20; /// /// 列出的文件类型 /// /// [JsonPropertyName("fileManagerAllowFiles")] public string[] FileManagerAllowFiles { get; set; } = new string[] { ".png", ".jpg", ".jpeg", ".gif", ".bmp", ".flv", ".swf", ".mkv", ".avi", ".rm", ".rmvb", ".mpeg", ".mpg", ".ogg", ".ogv", ".mov", ".wmv", ".mp4", ".webm", ".mp3", ".wav", ".mid", ".rar", ".zip", ".tar", ".gz", ".7z", ".bz2", ".cab", ".iso", ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".pdf", ".txt", ".md", ".xml" }; #endregion } }