forked from liaozb/APIJSON.NET
-
Notifications
You must be signed in to change notification settings - Fork 2
同步代码 #1
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
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
14350a1
#增加权限验证#
liaozb a5da6ab
#优化代码结构#
liaozb 7398af6
#权限优化 别名表优化#
liaozb ffa68ea
Update README
liaozb ef48912
Update README
liaozb 17ea553
#配置说明#
liaozb 5d0d793
#增加前端测试#
liaozb f212872
移除time
liaozb 25fe655
#增加函数调用#
liaozb fc49052
修改验证表和字段方式
liaozb edd2707
##
liaozb 8a6976e
#增加自定义方法调用#
liaozb 92d9384
Update README.md
liaozb 64a6d1d
#说明#
liaozb efb5263
#bug修复#
liaozb 74a845f
##
liaozb 54e893e
#docker 支持#
liaozb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file added
APIJSON.NET.zip
Binary file not shown.
Binary file added
APIJSON.NET/1.png
Binary file added
APIJSON.NET/2.png
Binary file added
APIJSON.NET/3.png
12 changes: 12 additions & 0 deletions
APIJSON.NET/APIJSON.NET.Test/APIJSON.NET.Test.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>netcoreapp2.1</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="RestSharp" Version="106.3.1" /> | ||
</ItemGroup> | ||
|
||
</Project> |
53 changes: 53 additions & 0 deletions
APIJSON.NET/APIJSON.NET.Test/Program.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
using RestSharp; | ||
using System; | ||
|
||
namespace APIJSON.NET.Test | ||
{ | ||
class Program | ||
{ | ||
static void Main(string[] args) | ||
{ | ||
var client = new RestClient("http://localhost:5000/"); | ||
|
||
var login = new RestRequest("token", Method.POST); | ||
login.AddJsonBody(new TokenInput() { username = "admin1", password = "123456" }); | ||
IRestResponse<TokenData> token = client.Execute<TokenData>(login); | ||
|
||
Console.WriteLine(token.Data.data.AccessToken); | ||
|
||
var request = new RestRequest("get", Method.POST); | ||
request.AddHeader("Content-Type", "application/json"); | ||
request.AddHeader("Authorization", "Bearer " + token.Data.data.AccessToken); | ||
request.AddJsonBody(@"{ | ||
'User': { | ||
'id': 38710 | ||
} | ||
} | ||
"); | ||
IRestResponse response = client.Execute(request); | ||
Console.WriteLine(response.Content); | ||
|
||
|
||
|
||
|
||
Console.ReadLine(); | ||
} | ||
} | ||
public class TokenInput | ||
{ | ||
public string username { get; set; } | ||
public string password { get; set; } | ||
} | ||
public class TokenData | ||
{ | ||
public AuthenticateResultModel data { get; set; } | ||
} | ||
public class AuthenticateResultModel | ||
{ | ||
public string AccessToken { get; set; } | ||
|
||
public int ExpireInSeconds { get; set; } | ||
|
||
|
||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
APIJSON.NET/APIJSON.NET/Controllers/HomeController.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace APIJSON.NET.Controllers | ||
{ | ||
public class HomeController : Controller | ||
{ | ||
public IActionResult Index() | ||
{ | ||
return Redirect("index.html"); | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.