mirror of
https://github.com/DrizzleTime/Foxel.git
synced 2026-05-31 21:20:52 +08:00
feat: implement account binding functionality for GitHub and LinuxDo
This commit is contained in:
@@ -14,6 +14,8 @@ public class User : BaseModel
|
||||
[Required] [StringLength(255)] public required string PasswordHash { get; set; }
|
||||
|
||||
[StringLength(255)] public string? GithubId { get; set; }
|
||||
[StringLength(255)] public string? LinuxDoId { get; set; }
|
||||
|
||||
public int? RoleId { get; set; }
|
||||
|
||||
public Role? Role { get; set; }
|
||||
|
||||
25
Models/Request/Auth/BindAccountRequest.cs
Normal file
25
Models/Request/Auth/BindAccountRequest.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Foxel.Models.Request.Auth;
|
||||
|
||||
public class BindAccountRequest
|
||||
{
|
||||
[Required(ErrorMessage = "邮箱不能为空")]
|
||||
[EmailAddress(ErrorMessage = "邮箱格式不正确")]
|
||||
public string Email { get; set; } = string.Empty;
|
||||
|
||||
[Required(ErrorMessage = "密码不能为空")]
|
||||
[MinLength(6, ErrorMessage = "密码长度不能少于6位")]
|
||||
public string Password { get; set; } = string.Empty;
|
||||
|
||||
[Required(ErrorMessage = "绑定类型不能为空")] public BindType BindType { get; set; }
|
||||
|
||||
[Required(ErrorMessage = "第三方用户ID不能为空")]
|
||||
public string ThirdPartyUserId { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public enum BindType
|
||||
{
|
||||
GitHub,
|
||||
LinuxDo
|
||||
}
|
||||
Reference in New Issue
Block a user