修改接口

This commit is contained in:
2025-10-16 15:21:52 +08:00
parent 82220ce0b8
commit dd398c1c32
274 changed files with 22777 additions and 22905 deletions

View File

@@ -0,0 +1,44 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace FutureMailAPI.Models
{
public class OAuthToken
{
[Key]
public int Id { get; set; }
[Required]
[MaxLength(255)]
public string AccessToken { get; set; } = string.Empty;
[Required]
[MaxLength(255)]
public string RefreshToken { get; set; } = string.Empty;
[Required]
public string TokenType { get; set; } = "Bearer";
public DateTime ExpiresAt { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime? UpdatedAt { get; set; }
public DateTime? RevokedAt { get; set; }
public string? Scope { get; set; }
// 外键
public int UserId { get; set; }
public int ClientId { get; set; }
// 导航属性
[ForeignKey("UserId")]
public virtual User User { get; set; } = null!;
[ForeignKey("ClientId")]
public virtual OAuthClient Client { get; set; } = null!;
}
}