| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- 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
- {
- /// <summary>
- /// 用于保存用户的登录尝试。
- /// </summary>
- [Table("Sys_UserLoginAttempts")]
- public class UserLoginAttempt : Entity<long>, IHasCreationTime, IMayHaveTenant
- {
- /// <summary>
- /// Max length of the <see cref="TenancyName"/> property.
- /// </summary>
- public const int MaxTenancyNameLength = TenantBase.MaxTenancyNameLength;
- /// <summary>
- /// Max length of the <see cref="TenancyName"/> property.
- /// </summary>
- public const int MaxUserNameOrEmailAddressLength = 255;
- /// <summary>
- /// Maximum length of <see cref="ClientIpAddress"/> property.
- /// </summary>
- public const int MaxClientIpAddressLength = 64;
- /// <summary>
- /// Maximum length of <see cref="ClientName"/> property.
- /// </summary>
- public const int MaxClientNameLength = 128;
- /// <summary>
- /// Maximum length of <see cref="BrowserInfo"/> property.
- /// </summary>
- public const int MaxBrowserInfoLength = 512;
- /// <summary>
- /// Tenant's Id, if <see cref="TenancyName"/> was a valid tenant name.
- /// </summary>
- public virtual int? TenantId { get; set; }
- /// <summary>
- /// Tenancy name.
- /// </summary>
- [StringLength(MaxTenancyNameLength)]
- public virtual string TenancyName { get; set; }
- /// <summary>
- /// User's Id, if <see cref="UserNameOrEmailAddress"/> was a valid username or email address.
- /// </summary>
- public virtual long? UserId { get; set; }
- /// <summary>
- /// User name or email address
- /// </summary>
- [StringLength(MaxUserNameOrEmailAddressLength)]
- public virtual string UserNameOrEmailAddress { get; set; }
- /// <summary>
- /// IP address of the client.
- /// </summary>
- [StringLength(MaxClientIpAddressLength)]
- public virtual string ClientIpAddress { get; set; }
- /// <summary>
- /// Name (generally computer name) of the client.
- /// </summary>
- [StringLength(MaxClientNameLength)]
- public virtual string ClientName { get; set; }
- /// <summary>
- /// Browser information if this method is called in a web request.
- /// </summary>
- [StringLength(MaxBrowserInfoLength)]
- public virtual string BrowserInfo { get; set; }
- /// <summary>
- /// Login attempt result.
- /// </summary>
- public virtual IwbLoginResultType Result { get; set; }
- public virtual DateTime CreationTime { get; set; }
- /// <summary>
- /// Initializes a new instance of the <see cref="UserLoginAttempt"/> class.
- /// </summary>
- public UserLoginAttempt()
- {
- CreationTime = Clock.Now;
- }
- }
- }
|