| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- using System.ComponentModel.DataAnnotations;
- using System.ComponentModel.DataAnnotations.Schema;
- using Abp.Domain.Entities;
- using Abp.Domain.Entities.Auditing;
- namespace IwbZero.Authorization.Base.SystemInfo
- {
- /// <summary>
- /// Represents a setting for a tenant or user.
- /// </summary>
- [Table("Sys_Settings")]
- public class SysSetting : AuditedEntity<long>, IMayHaveTenant
- {
- /// <summary>
- /// Maximum length of the <see cref="Name"/> property.
- /// </summary>
- public const int MaxNameLength = 256;
- /// <summary>
- /// Maximum length of the <see cref="Value"/> property.
- /// </summary>
- public const int MaxValueLength = int.MaxValue;
- public const int DisplayNameMaxLength = 50;
- public const int DescriptionMaxLength = 500;
- public const int RemarkMaxLength = 500;
- /// <summary>
- /// TenantId for this setting.
- /// TenantId is null if this setting is not Tenant level.
- /// </summary>
- [Index]
- public int? TenantId { get; set; }
- /// <summary>
- /// UserId for this setting.
- /// UserId is null if this setting is not user level.
- /// </summary>
- [Index]
- public long? UserId { get; set; }
- /// <summary>
- /// Unique name of the setting.
- /// </summary>
- [Required]
- [StringLength(MaxNameLength)]
- public string Name { get; set; }
- /// <summary>
- /// Value of the setting.
- /// </summary>
- [StringLength(MaxValueLength)]
- public string Value { get; set; }
- [StringLength(DisplayNameMaxLength)]
- public string DisplayName { get; set; }
- public int? Type { get; set; }
- [StringLength(DescriptionMaxLength)]
- public string Description { get; set; }
- [StringLength(RemarkMaxLength)]
- public string Remark { get; set; }
- /// <summary>
- /// Creates a new <see cref="SysSetting"/> object.
- /// </summary>
- public SysSetting()
- {
- }
- /// <summary>
- /// Creates a new <see cref="SysSetting"/> object.
- /// </summary>
- /// <param name="tenantId">TenantId for this setting</param>
- /// <param name="userId">UserId for this setting</param>
- /// <param name="name">Unique name of the setting</param>
- /// <param name="value">Value of the setting</param>
- /// <param name="displayName"></param>
- /// <param name="type"></param>
- public SysSetting(int? tenantId, long? userId, string name, string value, string displayName, int? type = null)
- {
- TenantId = tenantId;
- UserId = userId;
- Name = name;
- Value = value;
- DisplayName = displayName;
- Type = type;
- }
- }
- }
|