新增按条件选择使用哪种Web框架
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Nancy;
|
||||
#if Nancy
|
||||
using Nancy;
|
||||
using Nancy.Bootstrapper;
|
||||
using Nancy.Configuration;
|
||||
using Nancy.Conventions;
|
||||
@@ -51,5 +52,5 @@ namespace 电子展板.WebModule
|
||||
pipelines.AfterRequest.AddItemToEndOfPipeline(x => x.Response.Headers.Add("Access-Control-Allow-Methods", "*"));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
@@ -1,4 +1,5 @@
|
||||
using Nancy;
|
||||
#if Nancy
|
||||
using Nancy;
|
||||
using Nancy.ModelBinding;
|
||||
using Nancy.Swagger;
|
||||
using Nancy.Swagger.Annotations.Attributes;
|
||||
@@ -6,15 +7,11 @@ using Swagger.ObjectModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.IO.Pipes;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using 电子展板.Base;
|
||||
using 电子展板.Models;
|
||||
using 电子展板.Utility;
|
||||
using 电子展板.Utility.Core;
|
||||
using 电子展板.Utility.Extension;
|
||||
using 电子展板.Utility.Logs;
|
||||
using 电子展板.Utility.Other;
|
||||
|
||||
namespace 电子展板.WebModule
|
||||
@@ -120,11 +117,11 @@ namespace 电子展板.WebModule
|
||||
[Route(Tags = new[] { "上传图片" })]
|
||||
private object UploadImage([RouteParam(ParamIn = ParameterIn.Form, Name = "file", Description = "图片文件", ParamType = typeof(SwaggerFile), Required = true)] HttpFile file)
|
||||
{
|
||||
string uploadPath = MyEnvironment.Root("/Upload/");
|
||||
if (!Directory.Exists(uploadPath))
|
||||
{
|
||||
Directory.CreateDirectory(uploadPath);
|
||||
}
|
||||
//string uploadPath = MyEnvironment.Root("/Upload/");
|
||||
//if (!Directory.Exists(uploadPath))
|
||||
//{
|
||||
// Directory.CreateDirectory(uploadPath);
|
||||
//}
|
||||
string ext = Path.GetExtension(file.Name);
|
||||
string fileName = UUID.StrSnowId + ext;
|
||||
|
||||
@@ -178,3 +175,4 @@ namespace 电子展板.WebModule
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
#if !Nancy
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.Globalization;
|
||||
@@ -180,3 +181,4 @@ namespace 电子展板.WebModule
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user