update IsDisable => IsDisabled

This commit is contained in:
jason.wang 2024-09-21 23:00:20 +08:00
parent d85e16dc81
commit 86289b0f41
6 changed files with 6 additions and 8 deletions

View file

@ -33,5 +33,4 @@ public class UserRole
/// AI Assistant
/// </summary>
public const string Assistant = "assistant";
public const string Affiliate = "affiliate";
}

View file

@ -9,6 +9,5 @@ namespace BotSharp.Abstraction.Users.Enums
public static class UserSource
{
public const string Internal = "internal";
public const string Affiliate = "affiliate";
}
}

View file

@ -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;
}

View file

@ -114,7 +114,7 @@ public class UserService : IUserService
var db = _services.GetRequiredService<IBotSharpRepository>();
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;

View file

@ -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,
};

View file

@ -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<UserDocument>.Filter.Eq(x => x.Id, userId);
var update = Builders<UserDocument>.Update.Set(x => x.IsDisable, isDisable)
var update = Builders<UserDocument>.Update.Set(x => x.IsDisabled, isDisable)
.Set(x => x.UpdatedTime, DateTime.UtcNow);
_dc.Users.UpdateOne(filter, update);
}