生成单文件

This commit is contained in:
2025-09-26 17:42:33 +08:00
parent 0884292626
commit 13b838c7c7
17 changed files with 1671 additions and 206 deletions

View File

@@ -1,7 +1,9 @@
using Nancy.Swagger.Annotations.Attributes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Documents;
using .Base;
namespace .Models
@@ -118,51 +120,8 @@ namespace 电子展板.Models
[Comment("党员字体大小")]
[ModelProperty(Description = "党员字体大小", Required = true, Minimum = 15, Maximum = 60)]
public int CPCMemberSize { get; set; }
/// <summary>
/// 转换成JSON字符串
/// </summary>
/// <returns></returns>
//public string ToJson()
//{
// StringBuilder sb = new StringBuilder();
// sb.AppendLine("{");
// //得到所有的Property
// var properties = GetType().GetProperties();
// for (int i = 0; i < properties.Length; i++)
// {
// var property = properties[i];
// string endChar = ",";
// if (i == properties.Length - 1)
// {
// endChar = "";
// }
// var comment = property.GetCustomAttributes(typeof(CommentAttribute), false).FirstOrDefault() as CommentAttribute;
// string commentText = "";
// if (comment != null)
// {
// commentText = $" /* {comment.Comment} */";
// }
// string propertyName = property.Name;
// var value = property.GetValue(this, null);
// if (value != null)
// {
// var valueType = value.GetType();
// if (valueType == typeof(string))
// {
// string value1 = (string)value;
// value1 = value1.Replace("\"", "\\\"");
// value1 = value1.Replace("\r\n", "\\r\\n");
// sb.AppendLine($" \"{propertyName}\":\"{value1}\"{endChar}{commentText}");
// }
// else
// {
// sb.AppendLine($" \"{propertyName}\":{value}{endChar}{commentText}");
// }
// }
// }
// sb.AppendLine("}");
// return sb.ToString();
//}
public List<UploadFiles> FileUploadList { get; set; }
}

View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace .Models
{
public class UploadFiles
{
public string Name { get; set; }
public byte[] Bin { get; set; }
}
}