生成单文件
This commit is contained in:
@@ -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; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
14
电子展板/Models/UploadFiles.cs
Normal file
14
电子展板/Models/UploadFiles.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user