From 86289b0f41fb65e78d6c3c1f423f6c74ff166972 Mon Sep 17 00:00:00 2001 From: "jason.wang" Date: Sat, 21 Sep 2024 23:00:20 +0800 Subject: [PATCH] update IsDisable => IsDisabled --- .../BotSharp.Abstraction/Users/Enums/UserRole.cs | 1 - .../BotSharp.Abstraction/Users/Enums/UserSource.cs | 1 - src/Infrastructure/BotSharp.Abstraction/Users/Models/User.cs | 2 +- .../BotSharp.Core/Users/Services/UserService.cs | 2 +- .../BotSharp.Plugin.MongoStorage/Collections/UserDocument.cs | 4 ++-- .../Repository/MongoRepository.User.cs | 4 ++-- 6 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/Infrastructure/BotSharp.Abstraction/Users/Enums/UserRole.cs b/src/Infrastructure/BotSharp.Abstraction/Users/Enums/UserRole.cs index 1caa4974..22a8eb95 100644 --- a/src/Infrastructure/BotSharp.Abstraction/Users/Enums/UserRole.cs +++ b/src/Infrastructure/BotSharp.Abstraction/Users/Enums/UserRole.cs @@ -33,5 +33,4 @@ public class UserRole /// AI Assistant /// public const string Assistant = "assistant"; - public const string Affiliate = "affiliate"; } diff --git a/src/Infrastructure/BotSharp.Abstraction/Users/Enums/UserSource.cs b/src/Infrastructure/BotSharp.Abstraction/Users/Enums/UserSource.cs index c82fadda..e06dff74 100644 --- a/src/Infrastructure/BotSharp.Abstraction/Users/Enums/UserSource.cs +++ b/src/Infrastructure/BotSharp.Abstraction/Users/Enums/UserSource.cs @@ -9,6 +9,5 @@ namespace BotSharp.Abstraction.Users.Enums public static class UserSource { public const string Internal = "internal"; - public const string Affiliate = "affiliate"; } } diff --git a/src/Infrastructure/BotSharp.Abstraction/Users/Models/User.cs b/src/Infrastructure/BotSharp.Abstraction/Users/Models/User.cs index ba1dccba..cb48701f 100644 --- a/src/Infrastructure/BotSharp.Abstraction/Users/Models/User.cs +++ b/src/Infrastructure/BotSharp.Abstraction/Users/Models/User.cs @@ -22,7 +22,7 @@ public class User public string? VerificationCode { get; set; } public bool Verified { get; set; } public string? AffiliateId { get; set; } - public bool IsDisable { get; set; } + public bool IsDisabled { get; set; } public DateTime UpdatedTime { get; set; } = DateTime.UtcNow; public DateTime CreatedTime { get; set; } = DateTime.UtcNow; } diff --git a/src/Infrastructure/BotSharp.Core/Users/Services/UserService.cs b/src/Infrastructure/BotSharp.Core/Users/Services/UserService.cs index 90099e1d..4a27220a 100644 --- a/src/Infrastructure/BotSharp.Core/Users/Services/UserService.cs +++ b/src/Infrastructure/BotSharp.Core/Users/Services/UserService.cs @@ -114,7 +114,7 @@ public class UserService : IUserService var db = _services.GetRequiredService(); var record = db.GetUserByPhone(id); - var isCanLoginAffiliateRoleType = record != null && !record.IsDisable && record.Type != UserType.Client; + var isCanLoginAffiliateRoleType = record != null && !record.IsDisabled && record.Type != UserType.Client; if (!isCanLoginAffiliateRoleType) { return default; diff --git a/src/Plugins/BotSharp.Plugin.MongoStorage/Collections/UserDocument.cs b/src/Plugins/BotSharp.Plugin.MongoStorage/Collections/UserDocument.cs index fac51450..ffcd71a2 100644 --- a/src/Plugins/BotSharp.Plugin.MongoStorage/Collections/UserDocument.cs +++ b/src/Plugins/BotSharp.Plugin.MongoStorage/Collections/UserDocument.cs @@ -19,7 +19,7 @@ public class UserDocument : MongoBase public string? VerificationCode { get; set; } public bool Verified { get; set; } public string? AffiliateId { get; set; } - public bool IsDisable { get; set; } + public bool IsDisabled { get; set; } public DateTime CreatedTime { get; set; } public DateTime UpdatedTime { get; set; } @@ -40,7 +40,7 @@ public class UserDocument : MongoBase Type = Type, Role = Role, AffiliateId = AffiliateId, - IsDisable = IsDisable, + IsDisabled = IsDisabled, VerificationCode = VerificationCode, Verified = Verified, }; diff --git a/src/Plugins/BotSharp.Plugin.MongoStorage/Repository/MongoRepository.User.cs b/src/Plugins/BotSharp.Plugin.MongoStorage/Repository/MongoRepository.User.cs index ec8c98d0..3a3cf543 100644 --- a/src/Plugins/BotSharp.Plugin.MongoStorage/Repository/MongoRepository.User.cs +++ b/src/Plugins/BotSharp.Plugin.MongoStorage/Repository/MongoRepository.User.cs @@ -71,7 +71,7 @@ public partial class MongoRepository VerificationCode = user.VerificationCode, Verified = user.Verified, AffiliateId = user.AffiliateId, - IsDisable = user.IsDisable, + IsDisabled = user.IsDisabled, CreatedTime = DateTime.UtcNow, UpdatedTime = DateTime.UtcNow }; @@ -122,7 +122,7 @@ public partial class MongoRepository public void UpdateUserIsDisable(string userId, bool isDisable) { var filter = Builders.Filter.Eq(x => x.Id, userId); - var update = Builders.Update.Set(x => x.IsDisable, isDisable) + var update = Builders.Update.Set(x => x.IsDisabled, isDisable) .Set(x => x.UpdatedTime, DateTime.UtcNow); _dc.Users.UpdateOne(filter, update); }