Skip to content

Commit 86289b0

Browse files
author
jason.wang
committed
update IsDisable => IsDisabled
1 parent d85e16d commit 86289b0

File tree

6 files changed

+6
-8
lines changed

6 files changed

+6
-8
lines changed

src/Infrastructure/BotSharp.Abstraction/Users/Enums/UserRole.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,4 @@ public class UserRole
3333
/// AI Assistant
3434
/// </summary>
3535
public const string Assistant = "assistant";
36-
public const string Affiliate = "affiliate";
3736
}

src/Infrastructure/BotSharp.Abstraction/Users/Enums/UserSource.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,5 @@ namespace BotSharp.Abstraction.Users.Enums
99
public static class UserSource
1010
{
1111
public const string Internal = "internal";
12-
public const string Affiliate = "affiliate";
1312
}
1413
}

src/Infrastructure/BotSharp.Abstraction/Users/Models/User.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class User
2222
public string? VerificationCode { get; set; }
2323
public bool Verified { get; set; }
2424
public string? AffiliateId { get; set; }
25-
public bool IsDisable { get; set; }
25+
public bool IsDisabled { get; set; }
2626
public DateTime UpdatedTime { get; set; } = DateTime.UtcNow;
2727
public DateTime CreatedTime { get; set; } = DateTime.UtcNow;
2828
}

src/Infrastructure/BotSharp.Core/Users/Services/UserService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public async Task<Token> GetAffiliateToken(string authorization)
114114
var db = _services.GetRequiredService<IBotSharpRepository>();
115115
var record = db.GetUserByPhone(id);
116116

117-
var isCanLoginAffiliateRoleType = record != null && !record.IsDisable && record.Type != UserType.Client;
117+
var isCanLoginAffiliateRoleType = record != null && !record.IsDisabled && record.Type != UserType.Client;
118118
if (!isCanLoginAffiliateRoleType)
119119
{
120120
return default;

src/Plugins/BotSharp.Plugin.MongoStorage/Collections/UserDocument.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class UserDocument : MongoBase
1919
public string? VerificationCode { get; set; }
2020
public bool Verified { get; set; }
2121
public string? AffiliateId { get; set; }
22-
public bool IsDisable { get; set; }
22+
public bool IsDisabled { get; set; }
2323
public DateTime CreatedTime { get; set; }
2424
public DateTime UpdatedTime { get; set; }
2525

@@ -40,7 +40,7 @@ public User ToUser()
4040
Type = Type,
4141
Role = Role,
4242
AffiliateId = AffiliateId,
43-
IsDisable = IsDisable,
43+
IsDisabled = IsDisabled,
4444
VerificationCode = VerificationCode,
4545
Verified = Verified,
4646
};

src/Plugins/BotSharp.Plugin.MongoStorage/Repository/MongoRepository.User.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public void CreateUser(User user)
7171
VerificationCode = user.VerificationCode,
7272
Verified = user.Verified,
7373
AffiliateId = user.AffiliateId,
74-
IsDisable = user.IsDisable,
74+
IsDisabled = user.IsDisabled,
7575
CreatedTime = DateTime.UtcNow,
7676
UpdatedTime = DateTime.UtcNow
7777
};
@@ -122,7 +122,7 @@ public void UpdateUserPhone(string userId, string phone)
122122
public void UpdateUserIsDisable(string userId, bool isDisable)
123123
{
124124
var filter = Builders<UserDocument>.Filter.Eq(x => x.Id, userId);
125-
var update = Builders<UserDocument>.Update.Set(x => x.IsDisable, isDisable)
125+
var update = Builders<UserDocument>.Update.Set(x => x.IsDisabled, isDisable)
126126
.Set(x => x.UpdatedTime, DateTime.UtcNow);
127127
_dc.Users.UpdateOne(filter, update);
128128
}

0 commit comments

Comments
 (0)