Skip to content

#更新sdk# #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion APIJSON.NET/APIJSON.NET.Test/APIJSON.NET.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
32 changes: 16 additions & 16 deletions APIJSON.NET/APIJSON.NET/APIJSON.NET.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand All @@ -15,21 +15,21 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="AspectCore.Extensions.Reflection" Version="1.1.0" />
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.5" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="2.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Cors" Version="2.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Rewrite" Version="2.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel.Https" Version="2.1.3" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.1.5" />
<PackageReference Include="MySql.Data" Version="8.0.13" />
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="2.18.3" />
<PackageReference Include="SqlKata" Version="1.1.3" />
<PackageReference Include="SqlKata.Execution" Version="1.1.3" />
<PackageReference Include="sqlSugarCore" Version="4.9.3" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="3.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="3.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="3.0.0" />
<PackageReference Include="AspectCore.Extensions.Reflection" Version="1.2.0" />
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.2.3" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Cors" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Rewrite" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel.Https" Version="2.2.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.3" />
<PackageReference Include="MySql.Data" Version="8.0.15" />
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="2.18.5" />
<PackageReference Include="SqlKata" Version="1.1.7" />
<PackageReference Include="SqlKata.Execution" Version="1.1.7" />
<PackageReference Include="sqlSugarCore" Version="4.9.9.2" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="4.0.1" />
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="4.0.1" />
</ItemGroup>

<ProjectExtensions><VisualStudio><UserProperties appsettings_1json__JSONSchema="http://json.schemastore.org/config" /></VisualStudio></ProjectExtensions>
Expand Down
5 changes: 2 additions & 3 deletions APIJSON.NET/APIJSON.NET/Controllers/JsonController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -251,15 +251,14 @@ public ActionResult Edit([FromBody]string json)
}

var dt = new Dictionary<string, object>();
dt.Add("id", value["id"].ToString());
foreach (var f in value)
{
if (f.Key.ToLower() != "id"&& selectTable.IsCol(key,f.Key) && (role.Update.Column.Contains ("*")||role.Update.Column.Contains(f.Key, StringComparer.CurrentCultureIgnoreCase)))
{
dt.Add(f.Key, f.Value);
dt.Add(f.Key, f.Value.ToString());
}
}
db.Db.Updateable(dt).AS(key).ExecuteCommand();
db.Db.Updateable(dt).AS(key).Where("id=@id" ,new { id= value["id"].ToString() }).ExecuteCommand();
ht.Add(key, JToken.FromObject(new { code = 200, msg = "success", id = value["id"].ToString() }));
}
}
Expand Down
5 changes: 2 additions & 3 deletions APIJSON.NET/APIJSON.NET/Data/DbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ public DbContext(IConfiguration options)
Db = new SqlSugarClient(new ConnectionConfig()
{
ConnectionString = options.GetConnectionString("ConnectionString"),
DbType = (DbType)Enum.Parse(typeof(SqlSugar.DbType), options.GetConnectionString("DbType")),
IsAutoCloseConnection = true,
InitKeyType= InitKeyType.Attribute
DbType = (DbType)Enum.Parse(typeof(SqlSugar.DbType), options.GetConnectionString("DbType")), InitKeyType= InitKeyType.Attribute,
IsAutoCloseConnection = true
});
Db.Aop.OnLogExecuted = (sql, pars) => //SQL执行完事件
{
Expand Down
2 changes: 1 addition & 1 deletion APIJSON.NET/APIJSON.NET/appsettings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"ConnectionStrings": {
"DbType": 1, //0:MySql,1:SqlServer,2:Sqlite
"ConnectionString": "Server=liaozengbo\\sql2018; Database=Sample; User Id=sa;Password=sa123;"
"ConnectionString": "Server=LIAOZENGBO\\SQL2012; Database=Testdb; User Id=sa;Password=sa123;"
//"ConnectionString": "Server=119.29.9.25;Port=3306;Database=test;Uid=root;Pwd=1q,2w.3e?;CharSet=UTF8;"
},
"Authentication": {
Expand Down