-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
145 additions
and
29 deletions.
There are no files selected for viewing
This file contains 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 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
Binary file not shown.
This file contains 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 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 was deleted.
Oops, something went wrong.
This file contains 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,23 @@ | ||
using Microsoft.EntityFrameworkCore; | ||
|
||
namespace Afdian.Server.Models | ||
{ | ||
public class ApplicationDbContext : DbContext | ||
{ | ||
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) | ||
: base(options) | ||
{ | ||
} | ||
|
||
protected override void OnModelCreating(ModelBuilder builder) | ||
{ | ||
base.OnModelCreating(builder); | ||
// Customize the ASP.NET Identity model and override the defaults if needed. | ||
// For example, you can rename the ASP.NET Identity table names and more. | ||
// Add your customizations after calling base.OnModelCreating(builder); | ||
} | ||
|
||
public virtual DbSet<Badge> Badge { get; set; } | ||
|
||
} | ||
} |
This file contains 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,18 @@ | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace Afdian.Server.Models | ||
{ | ||
public class Badge | ||
{ | ||
[Key] | ||
public int Id { get; set; } | ||
|
||
public string UserId { get; set; } | ||
|
||
public string Token { get; set; } | ||
|
||
public DateTime CreateTime { get; set; } | ||
|
||
public string Ip { get; set; } | ||
} | ||
} |
This file contains 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,15 @@ | ||
| ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace Afdian.Server.RequestModels | ||
{ | ||
/// <summary> | ||
/// 模型绑定: https://docs.microsoft.com/zh-cn/aspnet/core/mvc/models/model-binding?view=aspnetcore-6.0 | ||
/// </summary> | ||
public class BadgeRequestModel | ||
{ | ||
public string PlanId { get; set; } = ""; | ||
|
||
|
||
} | ||
} |
This file contains 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 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 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 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 |
---|---|---|
|
@@ -2,9 +2,32 @@ | |
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title></title> | ||
<title>Afdian.Server | Afdian.Sdk | 爱发电 非官方 .NET SDK</title> | ||
<!-- 移动端设置 --> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> | ||
<!-- CSS only --> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous"> | ||
</head> | ||
<body> | ||
<div>Hello World!</div> | ||
<div class="container"> | ||
<div class="row align-items-center"> | ||
<div class="col align-self-center"> | ||
<div class="form"> | ||
<div class="form-group"> | ||
<label>user_id</label> | ||
<input id="js-input-userId" type="text" class="form-control"> | ||
</div> | ||
<div class="form-group"> | ||
<label>token</label> | ||
<input id="js-input-token" type="text" class="form-control"> | ||
</div> | ||
<button id="js-btn-getBadge-1" class="btn btn-info btn-block" style="margin-top:14px;">获取Badge - 显式UserId,Token</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<!-- JavaScript Bundle with Popper --> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script> | ||
<script src="js/main.js"></script> | ||
</body> | ||
</html> |
This file contains 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 @@ | ||
|