using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Abp.Domain.Entities; using Abp.Domain.Entities.Auditing; using Abp.Timing; using IwbZero.MultiTenancy; namespace IwbZero.Authorization.Base.Users { /// /// 用于保存用户的登录尝试。 /// [Table("Sys_UserLoginAttempts")] public class UserLoginAttempt : Entity, IHasCreationTime, IMayHaveTenant { /// /// Max length of the property. /// public const int MaxTenancyNameLength = TenantBase.MaxTenancyNameLength; /// /// Max length of the property. /// public const int MaxUserNameOrEmailAddressLength = 255; /// /// Maximum length of property. /// public const int MaxClientIpAddressLength = 64; /// /// Maximum length of property. /// public const int MaxClientNameLength = 128; /// /// Maximum length of property. /// public const int MaxBrowserInfoLength = 512; /// /// Tenant's Id, if was a valid tenant name. /// public virtual int? TenantId { get; set; } /// /// Tenancy name. /// [StringLength(MaxTenancyNameLength)] public virtual string TenancyName { get; set; } /// /// User's Id, if was a valid username or email address. /// public virtual long? UserId { get; set; } /// /// User name or email address /// [StringLength(MaxUserNameOrEmailAddressLength)] public virtual string UserNameOrEmailAddress { get; set; } /// /// IP address of the client. /// [StringLength(MaxClientIpAddressLength)] public virtual string ClientIpAddress { get; set; } /// /// Name (generally computer name) of the client. /// [StringLength(MaxClientNameLength)] public virtual string ClientName { get; set; } /// /// Browser information if this method is called in a web request. /// [StringLength(MaxBrowserInfoLength)] public virtual string BrowserInfo { get; set; } /// /// Login attempt result. /// public virtual IwbLoginResultType Result { get; set; } public virtual DateTime CreationTime { get; set; } /// /// Initializes a new instance of the class. /// public UserLoginAttempt() { CreationTime = Clock.Now; } } }