This commit is contained in:
ky_sunl
2021-03-16 05:49:42 +00:00
parent 67839640ff
commit 1688c9f8d1
93 changed files with 11945 additions and 166 deletions

View File

@@ -1,4 +1,5 @@
using System;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
@@ -9,6 +10,17 @@ namespace Ewide.Core.Common
{
public class BaseDisplayJSON
{
public static object DisplayJSON(object obj)
{
var _result = JsonConvert.SerializeObject(obj, Formatting.Indented, new JsonSerializerSettings
{
ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver(),
DateFormatString = "yyyy-MM-dd HH:mm:ss"
});
return JsonConvert.DeserializeObject(_result);
}
public static object Display(HttpStatusCode status, object result)
{
return new

View File

@@ -1,20 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Ewide.Core.Common
{
public enum ResponseStatus
{
// 权限验证失败
Unauthorized = 401,
// 未找到
NotFound = 404,
// 接口错误
Error = 500,
// 接口成功
Success = 200
}
}

View File

@@ -9,9 +9,10 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Ewide.Core.Common</RootNamespace>
<AssemblyName>Ewide.Core.Common</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -31,6 +32,9 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.11.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
@@ -42,8 +46,13 @@
</ItemGroup>
<ItemGroup>
<Compile Include="BaseDisplayJSON.cs" />
<Compile Include="EnumCode\ResponseStatus.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="EnumCode\" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="11.0.1" targetFramework="net45" />
</packages>