You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
698 B
29 lines
698 B
using System;
|
|
|
|
namespace Kean.Domain.Identity.Models
|
|
{
|
|
/// <summary>
|
|
/// 令牌
|
|
/// </summary>
|
|
public sealed class Token : ValueObject
|
|
{
|
|
/// <summary>
|
|
/// 初始化 Kean.Domain.Identity.Models.Token 类的新实例
|
|
/// </summary>
|
|
public Token()
|
|
{
|
|
Content = Guid.NewGuid().ToString("N");
|
|
}
|
|
|
|
/// <summary>
|
|
/// 令牌内容
|
|
/// </summary>
|
|
public string Content { get; }
|
|
|
|
/// <summary>
|
|
/// 以字符串表示令牌
|
|
/// </summary>
|
|
/// <param name="token">令牌</param>
|
|
public static implicit operator string(Token token) => token.Content;
|
|
}
|
|
}
|