Skip to content

Commit 1fb1a59

Browse files
authored
Merge pull request liaozb#1 from liaozb/master
同步代码
2 parents b6eb3ab + 54e893e commit 1fb1a59

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+13316
-406
lines changed

‎APIJSON.NET.zip‎

1.74 MB
Binary file not shown.

‎APIJSON.NET/1.png‎

24.9 KB
Loading

‎APIJSON.NET/2.png‎

23.4 KB
Loading

‎APIJSON.NET/3.png‎

10.5 KB
Loading
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<ProjectSdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>netcoreapp2.1</TargetFramework>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<PackageReferenceInclude="RestSharp"Version="106.3.1" />
10+
</ItemGroup>
11+
12+
</Project>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
usingRestSharp;
2+
usingSystem;
3+
4+
namespaceAPIJSON.NET.Test
5+
{
6+
classProgram
7+
{
8+
staticvoidMain(string[]args)
9+
{
10+
varclient=newRestClient("http://localhost:5000/");
11+
12+
varlogin=newRestRequest("token",Method.POST);
13+
login.AddJsonBody(newTokenInput(){username="admin1",password="123456"});
14+
IRestResponse<TokenData>token=client.Execute<TokenData>(login);
15+
16+
Console.WriteLine(token.Data.data.AccessToken);
17+
18+
varrequest=newRestRequest("get",Method.POST);
19+
request.AddHeader("Content-Type","application/json");
20+
request.AddHeader("Authorization","Bearer "+token.Data.data.AccessToken);
21+
request.AddJsonBody(@"{
22+
'User':{
23+
'id': 38710
24+
}
25+
}
26+
");
27+
IRestResponseresponse=client.Execute(request);
28+
Console.WriteLine(response.Content);
29+
30+
31+
32+
33+
Console.ReadLine();
34+
}
35+
}
36+
publicclassTokenInput
37+
{
38+
publicstringusername{get;set;}
39+
publicstringpassword{get;set;}
40+
}
41+
publicclassTokenData
42+
{
43+
publicAuthenticateResultModeldata{get;set;}
44+
}
45+
publicclassAuthenticateResultModel
46+
{
47+
publicstringAccessToken{get;set;}
48+
49+
publicintExpireInSeconds{get;set;}
50+
51+
52+
}
53+
}

‎APIJSON.NET/APIJSON.NET.sln‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 15
44
VisualStudioVersion =15.0.27703.2035
55
MinimumVisualStudioVersion =10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "APIJSON.NET", "APIJSON.NET\APIJSON.NET.csproj", "{FF647576-A104-4D54-954D-3547B4FDCDB2}"
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "APIJSON.NET", "APIJSON.NET\APIJSON.NET.csproj", "{FF647576-A104-4D54-954D-3547B4FDCDB2}"
7+
EndProject
8+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "APIJSON.NET.Test", "APIJSON.NET.Test\APIJSON.NET.Test.csproj", "{0828346E-207E-49F8-AD57-E1AB6B6E4077}"
79
EndProject
810
Global
911
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -15,6 +17,10 @@ Global
1517
{FF647576-A104-4D54-954D-3547B4FDCDB2}.Debug|Any CPU.Build.0 = Debug|Any CPU
1618
{FF647576-A104-4D54-954D-3547B4FDCDB2}.Release|Any CPU.ActiveCfg = Release|Any CPU
1719
{FF647576-A104-4D54-954D-3547B4FDCDB2}.Release|Any CPU.Build.0 = Release|Any CPU
20+
{0828346E-207E-49F8-AD57-E1AB6B6E4077}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{0828346E-207E-49F8-AD57-E1AB6B6E4077}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{0828346E-207E-49F8-AD57-E1AB6B6E4077}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{0828346E-207E-49F8-AD57-E1AB6B6E4077}.Release|Any CPU.Build.0 = Release|Any CPU
1824
EndGlobalSection
1925
GlobalSection(SolutionProperties) = preSolution
2026
HideSolutionNode =FALSE

‎APIJSON.NET/APIJSON.NET/APIJSON.NET.csproj‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,27 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<FolderInclude="wwwroot\" />
8+
<NoneRemove="Dockerfile" />
99
</ItemGroup>
1010

1111
<ItemGroup>
12+
<ContentInclude="Dockerfile">
13+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
14+
</Content>
15+
</ItemGroup>
16+
17+
<ItemGroup>
18+
<PackageReferenceInclude="AspectCore.Extensions.Reflection"Version="0.7.0" />
1219
<PackageReferenceInclude="Microsoft.AspNetCore.App" />
13-
<PackageReferenceInclude="Microsoft.AspNetCore.Authentication.JwtBearer"Version="2.1.0" />
20+
<PackageReferenceInclude="Microsoft.AspNetCore.Authentication.JwtBearer"Version="2.1.1" />
1421
<PackageReferenceInclude="Microsoft.VisualStudio.Web.CodeGeneration.Design"Version="2.1.0" />
1522
<PackageReferenceInclude="MySql.Data"Version="8.0.11" />
1623
<PackageReferenceInclude="sqlSugarCore"Version="4.6.4.9" />
1724
<PackageReferenceInclude="Swashbuckle.AspNetCore"Version="3.0.0" />
25+
<PackageReferenceInclude="Swashbuckle.AspNetCore.Annotations"Version="3.0.0" />
1826
<PackageReferenceInclude="Swashbuckle.AspNetCore.Swagger"Version="3.0.0" />
1927
</ItemGroup>
2028

29+
<ProjectExtensions><VisualStudio><UserPropertiesappsettings_1json__JSONSchema="http://json.schemastore.org/config" /></VisualStudio></ProjectExtensions>
30+
2131
</Project>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
usingSystem;
2+
usingSystem.Collections.Generic;
3+
usingSystem.Linq;
4+
usingSystem.Threading.Tasks;
5+
usingMicrosoft.AspNetCore.Mvc;
6+
7+
namespaceAPIJSON.NET.Controllers
8+
{
9+
publicclassHomeController:Controller
10+
{
11+
publicIActionResultIndex()
12+
{
13+
returnRedirect("index.html");
14+
}
15+
}
16+
}

0 commit comments

Comments
(0)