| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- using System.ComponentModel.DataAnnotations;
- using System.ComponentModel.DataAnnotations.Schema;
- using Abp.Domain.Entities;
- namespace IwbZero.Authorization.Base.Users
- {
- /// <summary>
- /// 用于存储外部登录服务的用户登录名。
- /// </summary>
- [Table("Sys_UserLogins")]
- public class UserLogin : Entity<long>, IMayHaveTenant
- {
- /// <summary>
- /// Maximum length of <see cref="LoginProvider"/> property.
- /// </summary>
- public const int MaxLoginProviderLength = 128;
- /// <summary>
- /// Maximum length of <see cref="ProviderKey"/> property.
- /// </summary>
- public const int MaxProviderKeyLength = 256;
- public virtual int? TenantId { get; set; }
- /// <summary>
- /// Id of the User.
- /// </summary>
- public virtual long UserId { get; set; }
- /// <summary>
- /// Login Provider.
- /// </summary>
- [Required]
- [StringLength(MaxLoginProviderLength)]
- public virtual string LoginProvider { get; set; }
- /// <summary>
- /// Key in the <see cref="LoginProvider"/>.
- /// </summary>
- [Required]
- [StringLength(MaxProviderKeyLength)]
- public virtual string ProviderKey { get; set; }
- public UserLogin()
- {
- }
- public UserLogin(int? tenantId, long userId, string loginProvider, string providerKey)
- {
- TenantId = tenantId;
- UserId = userId;
- LoginProvider = loginProvider;
- ProviderKey = providerKey;
- }
- }
- }
|